Commit Graph

489 Commits

Author SHA1 Message Date
Max Desiatov
2b5857b0c9 Mark Xcode 13.2.1 as supported (#40778)
Currently, when trying to build with the latest stable Xcode, you get this error:

```
using unsupported Xcode version:

Xcode 13.2.1
Build version 13C100
```

Xcode 13.2.1 can successfully build the toolchain and should be marked as supported.
2022-01-10 08:10:25 +00:00
Butta
a3ea28ff19 [android] Remove ICU build flags since that requirement was dropped in #40340 2021-12-20 12:06:13 +05:30
Mishal Shah
465f9690df Revert "build-swift: Explicitly use python3" 2021-12-03 14:29:36 -08:00
Rob Prentiss
6f2077e784 build-swift: Explicitly use python3
This changes build-swift script shebang to use Python 3 explicitly. The
code is already compatible and functional with python3, so this removes
any implied backward compatibility, and removes any ambiguity based on
the user's current environment, especially since some systems, like
macOS, still link 'python' to Python 2.

This also removes the now unnecessary 'from __future__' imports, and the
'six' module, which is only necessary for python2 compatibility.
2021-12-01 10:56:56 -08:00
Dave Lee
74b0bf5072 [build] Don't overwrite user NINJA_STATUS 2021-11-16 16:59:48 -08:00
Stephen Canon
06ef8f955b Mark Xcode 13.2 beta as supported in build-script. (#40021) 2021-11-04 08:37:41 -04:00
Arnold Schwaighofer
5bc464255e Merge pull request #39874 from aschwaighofer/build_script_deployment_targets_arm64
build-script: Allow building other deployment targets on macos arm64
2021-10-24 08:30:54 -07:00
Arnold Schwaighofer
38b2f8b59d build-script: Allow building other deployment targets on macos arm64
Enable ./build-script ... --ios --tvos --watchos on macos arm64 hosts.
2021-10-22 07:16:31 -07:00
冀卓疌
9f0b6436c0 support Xcode 13.0 and 13.1 RC 1 2021-10-22 21:12:05 +08:00
Michael Gottesman
8794dd1003 [build-script] Add an option for cleaning the install destdir
Useful to make sure that one is not hitting weird behavior due to a stale just
built toolchain.
2021-09-02 12:25:40 -07:00
Michael Gottesman
c86e3af454 [build-script] Refactor out BuildScriptInvocation into its own file and out of the top level build-script file.
This shrinks the number of lines in build-script by 50% and just makes it easier
to read. It will also enable me to refactor parts of it into pieces without
touching the main build-script file. This is really library code... build-script
itself doesn't care about how BuildScriptInvocation is actually implemented
under the hood.
2021-08-15 20:01:58 -07:00
Mishal Shah
5363a80aeb Update the Xcode version to support Xcode 13 beta 4 2021-07-28 15:25:41 -07:00
Butta
a4ff4db508 [build] Add the flags to enable cross-compiling the corelibs
Pass the Swift and CMake flags needed to cross-compile Foundation and so on, with
the first example of Android. Add a new flag, --cross-compile-deps-path, which is
used to search for cross-compiled libraries, like libcurl, that the corelibs
depend on. Also add a new flag, --common-swift-flags, to pass additional Swift
flags to the corelibs.
2021-06-29 06:41:41 +05:30
Dave Lee
0c472f8af7 [build] Clear out old supported Xcode versions (#37875)
* [build] Clear out old supported Xcode versions

* restore 12.3 and 12.4
2021-06-11 06:59:44 -07:00
Mishal Shah
89813cdf24 Update supported Xcode build number in build-script 2021-06-10 15:13:03 -07:00
Artem Chikin
71fb04aed6 Merge pull request #37349 from artemcm/InferEarlyDriver
[Build Script] Fix `--infer` with `earlyswiftdriver`.
2021-06-01 15:54:50 -07:00
Artem Chikin
3511d5f4f5 [Build Script] Fix --infer with earlyswiftdriver.
In the original implementation (https://github.com/apple/swift/pull/36377), using `--infer` accidentally disables the `earlyswiftdriver` product (`before_impl_product_classes` set to always empty). This change fixes that and makes sure early SwiftDriver is always built, regardless of whether or not `--infer` is used.

This change also ensures that `install_all` setting triggered by `--infer` does not affect products which specify `is_ignore_install_all_product` to return True. This is useful for products which should not be installed into the toolchain (corresponding build products that use the just-built toolchain are the products that get installed, e.g. `swiftdriver` to `earlyswiftdriver`).
2021-06-01 13:13:04 -07:00
Dario Rexin
da880d9c86 [Build] Pass '--reconfigure' to build-script-impl (#37677)
We recently started using the flag in build-script and forgot to pass it on the build-script-impl

rdar://78578996
2021-05-27 22:34:24 -07:00
Dario Rexin
7cfabf51f1 Revert "Revert "[Build] Make cmark build a build-script product (#37102)""
This reverts commit 3150086b0f.
2021-05-24 07:03:12 -07:00
Ben Langmuir
3150086b0f Revert "[Build] Make cmark build a build-script product (#37102)"
This reverts commit 3c19cc432d.
2021-05-23 09:02:29 -07:00
Dario Rexin
3c19cc432d [Build] Make cmark build a build-script product (#37102) 2021-05-22 09:04:45 -07:00
Eric Miotto
c3f8dacdf0 [Build] allow to generate symbols for a subset of binaries (#37120)
This would be needed to reduce overall build times in scenarios when
generating symbols for all binaries is too expensive and/or not needed.

At the same time, introduce tests around the logic that handles symbols.

Addresses rdar://76865276
2021-05-13 07:32:41 -07:00
Eric Miotto
1e5f790d06 [Build] allow to generate symbols for a subset of binaries
This would be needed to reduce overall build times in scenarios when
generating symbols for all binaries is too expensive and/or not needed.

Addresses rdar://76865276
2021-05-12 10:02:41 -07:00
Artem Chikin
6f44ba4ff1 Merge pull request #37122 from artemcm/BringBackNewDriver
Revert "Merge pull request #37114 from apple/revert-36377-NewDriverDefault"
2021-05-07 09:42:38 -07:00
Luciano Almeida
83ac07f264 [build-script] Allow new Xcode 12.5 official release version 2021-04-29 23:27:09 -03:00
Artem Chikin
ae2e856f9b Revert "Merge pull request #37114 from apple/revert-36377-NewDriverDefault"
This reverts commit 937e1a365c, reversing
changes made to a5440a8abd.
2021-04-28 15:11:36 -07:00
Artem Chikin
1e44ed00eb Revert "Always build SwiftDriver and use it as default compiler driver" 2021-04-28 11:20:21 -07:00
Artem Chikin
23452d5bad Merge pull request #36377 from artemcm/NewDriverDefault
Always build SwiftDriver and use it as default compiler driver
2021-04-27 09:53:06 -07:00
Artem Chikin
c2dc8e3d07 Always build (and use) the new SwiftDriver as the default compiler driver.
This will make sure that compiler developers are using the new driver when they build the compiler locally and use it.

- Adds a new build-script product category: before_build_script_impl for products we wish to build before the impl products.
- Adds a new EarlySwiftDriver product to that category, which gets built with the host toolchain.
- Adds an escape hatch: --skip-early-swift-driver
- Adjusts the swift CMake configuration with an additional step: swift_create_early_driver_symlinks which (if one was built) creates symlinks in the swift build bin directory to the EarlySwiftDriver swift-driver and swift-help executables.
- Adds a new test subset : only_early_swiftdriver, which will get built into a corresponding CMake test target: check-swift-only_early_swiftdriver-* which runs a small subset of driver-related tests against the Early SwiftDriver.
  - This subset is run always when the compiler itself is tested (--test is specified)
  - With an escape disable-switch: --skip-test-early-swift-driver
  - All tests outside of only_early_swiftdriver are forced to run using the legacy C++ driver (to ensure it gets tested, still).

NOTE: SwiftDriver product (no 'Early') is still the main product used to build the driver for toolchain installation into and for executing the product's own tests. This change does not affect that.
2021-04-26 12:17:32 -07:00
Mishal Shah
b5a01ba5e0 Support for x86_64 watchOS simulator
* Start testing watchOS simulator x86_64 and i386 by default

Users will require to install watchOS 6.2 or older simulator to support i386.

1. Install watchOS 6.2 or older simulator (Xcode -> Preferences -> Components -> Simulators).
2. Create a 32-bit watchOS device.
3. Run:
`xcrun simctl create 'Apple Watch Series 2 - 42mm' com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-42mm com.apple.CoreSimulator.SimRuntime.watchOS-6-2`
2021-04-22 20:06:17 -07:00
Mishal Shah
1b099067bf Merge pull request #36324 from apple/add_build_script_log
Add build_script_log file to help us understand the build times for e…
2021-04-20 16:41:09 -07:00
Mishal Shah
f6d04a0f1a Don't create build_script_log file with --dry-run flag 2021-04-19 21:30:36 -07:00
Eric Miotto
3a551f8fcc [build] allow to specify ninja targets to build for LLVM (#36910)
This is meant to support scenarios in which we need to build as little as
LLVM as possible for performance reasons (e.g. when enabling LTO).

While LLVM CMake build system offers options in this sense,
in our investigation they turned out not to be suitable,
since either they are not granular enough (`LLVM_INCLUDE/BUILD` flags)
or they require active opt out for any new tool added
(`*_BUILD_*_TOOL` flags)

When using this mechanism, there is the possibility to specify different
targets to use for cross-compile hosts.

Supports rdar://32019390
2021-04-15 12:45:00 -07:00
Eric Miotto
d350a0525e [build] Clean llbuild before building by default (#36686)
Introduce a new parameter `--skip-llbuild-clean` to prevent this from
happening.

This mimicks similar logic in place for `swiftpm`, `swift-driver`
(#33563)  and `xctest` (#19512)

Addresses rdar://75057069
2021-04-05 07:19:40 -07:00
Cassie Jones
ae66a940a6 [build-script] Ensure the sccache server is started before building
Sometimes with the --sccache flag passed to build-script, the first
round of compiler invocations will time-out waiting for the sccache
server to start. Here we ensure the server is started ahead of time
to avoid this failure.

Resolves rdar://74951999
2021-03-23 17:00:28 -04:00
Mishal Shah
08097964e9 Log build-script calls to .build_script_log file to help understand the build
times for each command.
2021-03-15 23:39:59 -07:00
Xi Ge
b948f20e41 build-script: keep SwiftDriver as the last product to build 2021-03-13 22:07:26 -08:00
Ben Rimmington
385fa77fd1 Add support for Xcode 12.4 (12D4e) (#35739) 2021-02-09 12:39:18 +00:00
Dario Rexin
bcd6416c89 Revert "[Concurrency] Build C only libdispatch before Swift on non-Darwin pla… (#35738)" (#35789)
This reverts commit 74e59ab77f.
2021-02-05 13:51:39 -08:00
Dario Rexin
74e59ab77f [Concurrency] Build C only libdispatch before Swift on non-Darwin pla… (#35738)
* [Concurrency] Build C only libdispatch before Swift on non-Darwin platforms

_Concurrency depends on libdispatch and since it is not available by
default on non-Darwin platforms, it needs to be built before the Swift
project, so that the dependency can be resolved.

* Fix clibdispatch installation and BuildSystem tests

* Fix build system tests on Darwin and formatting
2021-02-04 17:15:30 -08:00
Eric Miotto
187f4dbaf8 [Build] Add option to alter default location of module cache in Linux (#35711)
This is meant to support parallel CI runs on the same Linux bot, so that
they don't share the module cache and reduce (hopefully) the likelihood
of issues related to invalid signatures.

When the option is enabled, the environment variable `XDG_CACHE_HOME`
is explicitly set in `build-script` and should be inherited by all the
child processes.
Currently we don't check the operating system before setting the
variable (since it should be a noop for other OSes).

Addresses rdar://73887745
2021-02-03 07:32:29 -08:00
Minhyuk Kim
16e635b005 Fix test 2021-01-31 12:51:24 +09:00
Minhyuk Kim
b0426829fe Add swift_disable_dead_stripping option for disabling dead stripping in Swift build 2021-01-22 23:56:02 +09:00
swift-ci
186717f583 Merge pull request #34628 from buttaface/native-clang 2021-01-06 15:54:22 -08:00
Daniel Duan
3eab86185e [build] Make home directory portable
Using `os.path.expanduser('~')` is more portable (in case we want to use
this script on Windows some day in the future).
2020-12-24 20:51:15 -08:00
Mishal Shah
1653edc4ad Add support for Xcode 12.3 (12C33) 2020-12-14 20:00:11 -08:00
Butta
bd81fb8e13 Revert "Revert "[build-script] Move --native-{clang,llvm,swift}-tools-path flags into the Python build-script""
Also, fix two places where the LLVM path was wrongly employed to set up clang,
and use the Swift path in install_toolchain_path().
2020-12-13 18:22:33 +05:30
Robert Widmann
46f53a0ce5 Merge pull request #34854 from keith/ks/nfc-remove-unnecessary-constant
[NFC] Remove unnecessary constant
2020-12-02 14:35:37 -08:00
Eric Miotto
8fc2598167 [build-script] Allow to tune dsymutil parallelism (#34795)
This should enable scaling when using machines with large amount of
RAM.

To better support machines with lower spec, process one binary per
dsymutil invocation (reverting #34149).

Add some (limited) facilities to gather the time taken to execute
dsymutil to better assist in tuning the parameter -- these are printed in
JSON format in the log to allow for easier scraping

```
{ "command": "dsymutil", "start": "2020-11-18T18:10:47" }
{ "command": "dsymutil", "end": "2020-11-18T18:14:45" }
```

Addresses rdar://71018443
2020-12-01 07:11:10 -08:00
Keith Smiley
de373246b8 Update utils/build-script
Co-authored-by: Xiaodi Wu <13952+xwu@users.noreply.github.com>
2020-11-21 19:15:20 -08:00