Commit Graph

934 Commits

Author SHA1 Message Date
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
Doug Gregor
bf9f0eca1b [build-script] Add support for building, installing, and testing swift-driver
Add build-script command-line options for building, installing, and
testing swift-driver:
* `--swift-driver` will build the Swift driver. If testing is enabled,
  it will be tested as well
* `--install-swift-driver` will install the `swift-driver` and
  `swift-help` executables in the toolchain.
* `--skip-test-swift-driver` will disable testing of the Swift driver
when other tests are being run.

The Swift driver depends on SwiftPM to build; it is recommended that
you use `--infer` to get the appropriate dependencies built.

Note that this option does not yet replace the existing Swift driver
executables (`swiftc`, `swift`) with the new driver, nor does it
install the SwiftDriver library for use elsewhere.
2020-06-19 12:19:47 -07:00
Michael Gottesman
a6cb3aebb9 Merge pull request #32256 from gottesmm/pr-6a889299976ad0e3dfbc1849e1b7edaf177c53ce
[build-script] Add option --infer to infer dependencies.
2020-06-09 14:24:16 -07:00
Michael Gottesman
a313f62522 [build-script] Add option --infer to infer dependencies.
This causes build-script to use the conservative dependency information that I
committed. When one uses this option, it is assumed that one wants to also
install all built products.

Some notes:

1. I included an extra --install-all option so without --infer enabled
   one can enable this sort of install everything that we want to
   build behavior.

2. I added %cmake as a lit variable. I did this so I could specify in
   my build-system unit tests that on Linux they should use the just
   built cmake (if we built cmake due to an old cmake being on the
   system). Otherwise, the build system unit tests took way too
   long. These are meant to be dry-runs, so building this cmake again
   is just wasteful and doesn't make sense.

3. I unified how we handle cmark, llvm, swift with the rest of the
   build products by making them conditional on build_* variables, but
   to preserve current behavior I made it so that they are just
   enabled by default unlike things like
   llbuild/swiftpm/foundation/etc. This was necessary since previously
   we would just pass these flags to build-script-impl and
   build-script didn't know about them. Now I taught build-script
   about them so I can manipulate these skip-build-{cmark,llvm,swift}
   and then just pass them down to build-script-impl if appropriate
   rather than relying on build-script-impl to control if these are
   built.

Once this lands, I think we are at a good enough place with
build-script until we get rid of build-script-impl in terms of high
value QoI that will imnprove productivity. Once build-script-impl is
destroyed, we can start paring back what build-script itself does.
2020-06-09 11:04:43 -07:00
Michael Gottesman
d45047dfb3 Merge pull request #32260 from gottesmm/pr-89123c4fe2e41b356d82591f3e4482b004aacc8f
[build-script] Remove a bunch of conservative dependencies on lldb.
2020-06-08 23:54:42 -07:00
Michael Gottesman
49288f757d [build-script] Remove a bunch of conservative dependencies on lldb.
I only didn't touch playground-support since I don't know if there are deps
there or not. Everything else here though shouldn't need lldb to be built.
2020-06-08 21:26:19 -07:00
Michael Gottesman
450b005c3c [build-script] Add support for specifying that a product is a non-darwin only product.
We have a few of these like foundation, libdispatch, icu, xctest that are built
outside of build-script on Darwin.
2020-06-08 19:30:02 -07:00
Michael Gottesman
28f60a09bf Merge pull request #32247 from gottesmm/pr-bd788ac2872223df1190069035d4106524088523
[build-script] Fix import of dependencies of each product.
2020-06-08 17:17:14 -07:00