Commit Graph

941 Commits

Author SHA1 Message Date
Artem Chikin
5ba154e2d1 [Build Script] Pass down cross compilation host targets to swift-driver build 2021-05-14 16:41:03 -07:00
Michael Gottesman
c6e87eb359 [build-script] Remove old name swift-dt from source for swift-inspect.
We did this rename everywhere else, just missed this one.
2021-05-11 16:37:03 -07: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
Robert Widmann
0149ccd0ca Add arm64_32 support for Swift
Commit the platform definition and build script work necessary to
cross-compile for arm64_32.

arm64_32 is a variant of AARCH64 that supports an ILP32 architecture.
2021-04-20 14:59:04 -07:00
Cassie Jones
cb58d25c1d [build-script] Pass --lit-test-dir while testing swift-driver 2021-03-01 20:56:08 -05:00
Eric Miotto
1c126eb09b Allow cross host compilation without stdlib build (#35858)
This is to support certain build configuration which will provide the
stdlib/runtime for the cross target by a different means.

Addresses rdar://74188174, rdar://74154062
2021-02-10 11:33:38 -08: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
Robert Widmann
b436825948 Trade Usages of -m${platform}-version-min For -target
There's no reason to use -m${platform}-version-min as of clang-11/Xcode 11. Clang is now smart enough to parse -target and provide Apple's ld with the appropriate -platform_version argument string.
2021-01-13 11:00:39 -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
f3666d0954 [NFC] Move Migrated SDK Target List into StdlibDeploymentTarget
Centralize management of this mapping.
2020-12-01 10:16:59 -08:00
Saleem Abdulrasool
dca9f7bbf4 build: handle spaces better when boostrapping Ninja
IF Xcode is installed into a location with spaces, we would fail to
compile due to improper quoting.  Quote the paths to ensure that ninja
can bootstrap properly.
2020-11-24 10:43:12 -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
Artem Chikin
939f547d51 [Build Script] Pass Foundation and Dispatch build directories to the swift-driver build
This is required in order to build swift-driver using CMake on Linux
2020-10-08 09:32:17 -07:00
Cassie Jones
b5247d2c8f Fix formatting issue 2020-10-02 12:43:42 -04:00
Cassie Jones
7ef9b3287a [build-script] Fix CMake sccache test 2020-10-01 14:17:53 -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
Artem Chikin
d913fc609f [Build Script] Pass down a CMake path to swift-driver's build script 2020-09-25 08:26:47 -07:00
Mishal Shah
bf7c03b1f6 Support cross compile Xcode toolchain for Apple Silicon
Support cross compile Xcode toolchain for Apple Silicon

* Add CMake flag DCMAKE_OSX_ARCHITECTURES to LLVM

* Add CMake flag DCMAKE_OSX_ARCHITECTURES to cmark

* Add CMake flag DCMAKE_OSX_ARCHITECTURES to lldb

* Add CMake flag DCMAKE_OSX_ARCHITECTURES to llbuild

* Add llbuild CMake options array to provide DCMAKE_OSX_ARCHITECTURES

* [Build System] Use one install package for cross compile hosts

* Remove Lipo before non-build-script-impl products

* Add support to only lipo without running installable package tests

* [Build System] Support cross compile install prefix for SwiftPM product in Swift Build Support

* Use cross compile toolchain path for indexstoredb and swift-driver

* Use cross compile toolchain path for swiftpm, swiftsyntax, swiftformat, and skstresstester

* Add cross compile toolchain support to Benchmarks, and fix the python lint issue in skstresstester.py

* [SwiftPM] Add support for cross-compile-hosts flag to build swiftpm using bootstrap script
2020-09-02 10:14:51 -07:00
Robert Widmann
0869b519cd Revert "Fallback to building Cmake from source on all platforms, not just Linux (#33543)"
This reverts commit 539b241bf2.
2020-08-29 17:19:49 -07:00
tbkka
539b241bf2 Fallback to building Cmake from source on all platforms, not just Linux (#33543)
* Fallback to building Cmake from source on all platforms, not just Linux

* Remove no-longer-used import
2020-08-28 13:26:29 -07:00
Artem Chikin
fc4ef192ae [build-script] Add a default-enabled "clean" step for swift-driver and swiftpm
Along with options to disable the mandatory clean using: `--skip-clean-swift-driver` and `--skip-clean-swiftpm`.

This will ensure that every invocation of build-script will, by default, clean up all build artifacts of these projects and re-build them from scratch.
This is needed for all builds because today arbitrary changes to the compiler can lead to us being unable to incrementally build components that are themselves written in Swift. This causes now-frequent failures in incremental build bots, and is a scenario that is encountered by developers. (For example see: rdar://65006593)

The proper long-term solution is to enable library evolution for these projects. Until this is done, the only safe thing to do is to always rebuild them.

Resolves rdar://65006593
2020-08-20 11:27:27 -07:00
Kuba (Brecka) Mracek
7378afd1bf Pass -isysroot to both CFLAGS and LDFLAGS when building ninja (#33414)
* Pass -isysroot to both CFLAGS and LDFLAGS when building ninja

* Update test expectations too
2020-08-13 15:25:20 -07:00
Kuba (Brecka) Mracek
ef89b0dc51 Add a 'standalone_minimal' preset to build a minimal, static, OS independent, self-contained binaries of stdlib. (#33286) 2020-08-12 07:28:34 -07:00
Doug Gregor
e2cdc5e04b Merge pull request #33196 from DougGregor/concurrency-lib
[Concurrency] Stub out an experimental concurrency support library.
2020-07-30 11:51:27 -07:00
Doug Gregor
3339f18e5c Appease pointless Python lint error 2020-07-30 09:07:41 -07:00
Doug Gregor
9b0266cf6a [Concurrency] Stub out an experimental concurrency support library.
The experimental concurrency model will require a supporting runtime
and possibly end-user-visible library constructs. Introduce a stub of
such a library, enabled by a new `build-script` option
`--enable-experimental-concurrency`, so we have a place to put this
work.
2020-07-29 16:32:27 -07:00
Saleem Abdulrasool
2bf0ee413f build: remove tensorflow-swift-apis from the master branch
Remove the ability to build this dependency.
2020-07-28 08:27:24 -07:00
Mishal Shah
e38a8bf4aa Merge pull request #33076 from apple/shahmishal/support-correct-simulator-arch
Only execute test for supported simulator plaforms
2020-07-24 14:48:02 -07:00
Saleem Abdulrasool
9f0e0a6e2e build: remove PythonKit integration 2020-07-23 13:38:54 -07:00
Mishal Shah
a43626639f Only execute test for supported simulator plaforms 2020-07-23 11:07:10 -07:00
Saleem Abdulrasool
4586a6ae3b validation: make test_shell Python3 friendly
The custom `shell` module would coerce the byte-string representation
from `subprocess` into a text string representation in the happy path.
However, the same handling was not applied to the error case.  This
would result in a byte-string representation being returned in Python 3
rather than the text string.  Perform the conversion in both cases to
ensure that we can handle the strings without having to do the
conversion.
2020-07-14 21:54:48 +00:00
Mishal Shah
a930b51494 [Apple Silicon] Simulator support for arm64 2020-07-02 19:17:29 -07:00
Mishal Shah
83c57f3e58 [Apple Silicon] [Build] Filter out any architectures that are unsupported by the SDKs 2020-07-02 19:05:45 -07:00
Mishal Shah
2aef2c5fe3 [Apple Silicon] Fix cross-compilation in Xcode trains where we're not building stdlib at all 2020-07-02 18:25:44 -07:00
Mishal Shah
960f6ced74 [Apple Silicon] [build-script] Support stdlib macOS arm64/arm64e 2020-07-02 18:13:16 -07:00
Mishal Shah
ee1ea6e514 [Apple Silicon] Support building for macOS arm64/arm64e 2020-07-02 18:03:39 -07:00
Mishal Shah
919da26d15 [Apple Silicon] [Build] Generalize macOS architecture check 2020-07-02 16:40:16 -07:00
Ben Langmuir
c03ea7ad44 Merge pull request #32546 from dylansturg/add_swift_format_product
Add a build product and presets for swift-format.
2020-07-01 14:40:01 -07:00
Dylan Sturgeon
3b168d87fd Changes for review:
- Fix extra space in build-script arg to build swift-format.
- Fix python lint errors in `swiftformat.py`.
- Remove swiftsyntax from swiftformat build preset.
2020-06-26 13:38:54 -07:00
Dylan Sturgeon
e56ce8a88c Minor review tweaks.
- Remove unused `package_name` method.
- Disable swift-syntax tests in swift-format builder preset.
2020-06-25 14:39:28 -07:00
Dylan Sturgeon
e225bfb332 Add a build prodct for swift-format.
This product supports building and testing swift-format, forwarding the commands to a build script inside of swift-format's repo to handle actually invoking Swift PM. There are new command line options to support the swift-format product:

`--swiftformat`: Enables building swift-format.
`--skip-test-swiftformat': Disables running tests for swift-format after building.

Installing is intentionally not implemented because swift-format isn't ready to be installed as part of the Swift toolchain.
2020-06-25 10:35:07 -07:00
Doug Gregor
26bb4ec140 Appease the Python linter 2020-06-19 18:17:59 -07:00