Commit Graph

521 Commits

Author SHA1 Message Date
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
Keith Smiley
cff9b37dc7 [NFC] Remove unnecessary constant 2020-11-20 16:21:21 -08:00
Mishal Shah
806e0b5161 Merge pull request #34702 from apple/shahmishal/test/xcode12.2-rc
Add support to use Xcode 12.2 Release Candidate
2020-11-17 16:13:51 -08:00
Mishal Shah
429dcef8a4 Update utils/build-script
Co-authored-by: Ben Rimmington <me@benrimmington.com>
2020-11-17 16:13:32 -08:00
Mishal Shah
d575c0a281 Add support to use Xcode 12.2 Release Candidate 2020-11-11 22:17:02 -08:00
Butta
b7d26337e3 [android] Add support for x86_64 arch 2020-11-11 11:19:14 +05:30
Mishal Shah
827abdcd6f Revert "[build-script] Move --native-{clang,llvm,swift}-tools-path flags into the Python build-script" 2020-11-10 12:57:47 -08:00
Butta
9ed6766856 [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-10-27 00:24:46 +05:30
Keith Smiley
3c4ffcf0ee Fix python lint 2020-10-19 09:13:59 -07:00
Keith Smiley
15937f4091 Update to 12.2b3 2020-10-16 20:58:20 -07:00
Keith Smiley
58924f0b06 Add comment 2020-10-16 20:57:37 -07:00
Keith Smiley
61113197fb Improve messaging 2020-10-16 20:57:37 -07:00
Keith Smiley
3ce7899f92 Add check for Xcode version compatibility
This adds a check validating the current Xcode version is supported for
building the current sha. This makes us fail fast in the case that
you've selected too new or too old of an Xcode version that might
otherwise fail very late in the build process. You can also set
SKIP_XCODE_VERSION_CHECK to anything to skip this.
2020-10-16 20:57:37 -07:00
Xi Ge
e5b6333e66 Merge pull request #34186 from porglezomp-misc/only-install-swift-driver
[build] Support installing swift-driver without swiftpm
2020-10-06 14:30:04 -07:00
Cassie Jones
8ffaf79ec2 [build] Support installing swift-driver without swiftpm
The install-swift-driver phase knows how to build swift-driver using
CMake. Allowing only install-swift-driver without plain swift-driver
allows installing it without requiring swiftpm.
2020-10-05 12:00:41 -04:00
Cassie Jones
6d92486c9a [build-script] Add SWIFT_ prefix to USE_SCCACHE env var 2020-09-30 19:37:25 -04:00
Cassie Jones
e01893cb56 [build-script] Add a flag for sccache
This adds a flag to enable sccache in order to simplify the build-script
invocation, particularly for new contributors.
2020-09-30 16:49:34 -04:00
Dave Lee
7168d18e14 s/true/false/ 2020-09-14 18:43:42 -07:00
Dave Lee
157505196a [build-script] Disable pkg-config for Darwin hosts 2020-09-14 08:14:26 -07:00