Commit Graph

320 Commits

Author SHA1 Message Date
Ben Langmuir
43bb415668 Merge pull request #30963 from benlangmuir/isdb-san
[build-script] Add sanitizer support to indexstore-db product
2020-04-14 09:28:55 -07:00
Ben Langmuir
1d7ce7efe5 [build-script] Add sanitizer support to indexstore-db product
Support the usual `--enable-*san options`, but also add a
`--test-indexstore-db-santitize-all` that runs the tests once for each
sanitizer. Sanitizing just indexstore-db with a regular toolchain should
be much faster than using sanitized compilers.
2020-04-13 15:39:36 -07:00
Robert Widmann
22b0526917 Merge pull request #30082 from 3405691582/OpenBSD_Port_Build
Build system recognizes OpenBSD.
2020-04-12 09:30:17 -07:00
3405691582
f8d0174b85 Build system recognizes OpenBSD.
Commit for CMake and build scripts to recognize OpenBSD. To keep this
commit relatively short, this just deals with the rather simple and
uncontroversial changes to the build system.

Note that OpenBSD calls "x86_64" as "amd64", Since the Swift stdlib will
be put in a subdirectory named after ARCH, to ensure the standard
library is properly found later, we use the native architecture name for
OpenBSD in the build system rather than trying to deal with the
difference the other way around.
2020-04-03 13:34:17 -04:00
Dario Rexin
964de289a7 Update cmake version to 3.16.5
3.15.1 contains a bug that causes libraries that use the CMake Swift module to be built with -Onone, even in release mode.
2020-03-31 18:42:53 -07:00
Kuba (Brecka) Mracek
5d918e5ee1 Merge branch 'master' into mracek/arm64e 2020-03-03 08:28:01 -08:00
Saleem Abdulrasool
d8a40a1662 build: use the correct install location
Use the correct installation location path computation
`toolchain_install_path` rather than trying to compute it ourselves.
This ensures that the files are installed into the right location.
2020-02-27 16:12:17 -08:00
Kuba Mracek
45ba5cec05 [arm64e] Add arm64e support into Swift's build system 2020-02-27 16:08:15 -08:00
Mishal Shah
5a4d290deb [Test] Fix build system test by adding only_non_executable_test flag 2020-02-21 19:56:53 +05:30
Mishal Shah
2f7ff37329 [Build System] Add support to execute non-executable tests 2020-02-21 18:03:16 +05:30
Saleem Abdulrasool
ac6e34ce7c build: make tensorflow-swift-apis build with older CMake
Support CMake 3.15 for the build which required changing into the build
tree before configuring/building.

Use the just-built `swiftc` to build the product.
2020-02-20 15:35:41 -08:00
Saleem Abdulrasool
5d87e43ffb build: improve the PythonKit build
This improves the PythonKit build for CMake <3.16 and for Python 2.7 or
Python 3.x.
2020-02-20 08:22:58 -08:00
Saleem Abdulrasool
ef32ead97f build: correct executable name for swift compiler
The swift compiler is `swiftc` not `swift`.  Correct the spelling.
2020-02-19 11:09:06 -08:00
Saleem Abdulrasool
01f9321496 build: build PythonKit with just built toolchain
Use the toolchain we just built to build the PythonKit module.
2020-02-18 16:34:05 -08:00
Saleem Abdulrasool
9b332a3a35 build: add an option to optionally build tensorflow-swift-apis
Now that the autodifferentiation support is being upstreamed, add an
option to enable building the TensorFlow swift-apis package optionally.
This enables easier development cycles for the engineers working on it.
2020-02-13 13:21:30 -08:00
Saleem Abdulrasool
8d32ee36fc Merge pull request #29443 from compnerd/unsupported-playground-support
build: migrate playground support to post-build artifact
2020-02-12 11:28:03 -08:00
Ross Bayer
e793fcf052 [Build System: build-script] Moved SWIFT_SOURCE_ROOT, SWIFT_BUILD_ROOT and SWIFT_REPO_NAME along with other project path constants into a new build_swift.constants module. 2020-02-11 12:46:03 -08:00
Saleem Abdulrasool
f4086d8428 build: migrate playground support to post-build artifact
This migrates the playground support out of the build-script-impl and
into the python based build system.  This makes it build more similarly
to the Swift Package Manager and SourceKit-LSP.  More importantly, it
reduces the dependency on build-script-impl.
2020-02-08 14:00:02 -08:00
Ross Bayer
e8f2119e0a Merge pull request #29603 from Rostepher/remove-diagnostics-module
[Build System: build-script] Remove the diagnostics module from swift_build_support.
2020-02-02 16:58:30 -08:00
Ross Bayer
4450ce365a [Build System: build-script] Remove the diagnostics module from swift_build_support. 2020-02-02 14:30:51 -08:00
Ross Bayer
52428ff971 [Build System: build-script] Remove the host module from swift_build_support.
The functions used to calculate default LTO link jobs for LLVM and Swift have been moved to the build_swift.defaults module.
2020-02-02 14:01:19 -08:00
Ross Bayer
a7d6cd8126 [Build System: build-script] Adds a new cache_utils module to build_swift which replaces the existing module from swift_build_support. 2020-01-30 23:06:14 -08:00
Ross Bayer
ca4fc19a50 [Build System: build-script] Remove the tar module from swift_build_support.
The single function it provided to archive a source diretory has been moved to build-script which was the only caller.
2020-01-26 23:32:34 -08:00
Ross Bayer
3bc3f795a3 [Build System: build-script] Remove the debug module from swift_build_support.
The single function it provided to print the xcodebuild version and SDK versions has been moved to build-script which was the only caller.
2020-01-26 14:31:06 -08:00
Saleem Abdulrasool
e26b21675d Merge pull request #29366 from compnerd/optional-pythonkit-support
build: add support for optionally building PythonKit
2020-01-25 09:15:44 -08:00
Saleem Abdulrasool
cad0c7ae21 build: add support for optionally building PythonKit
This adds support for building PythonKit as a package as part of the
toolchain build.
2020-01-24 11:17:41 -08:00
Ross Bayer
1d0f8d7602 [Build System: build-script] Update the DarwinPlatform.is_embedded method to account for macCatalyst. 2020-01-24 03:11:04 -08:00
Devin Coughlin
9b4a890262 [Utils] Attempt to appease python_lint 2020-01-21 20:27:14 -08:00
Devin Coughlin
89e381ca66 [CMake/Tests] CMake and lit.cfg support for running macCatalyst tests
Add support for testing with macCatalyst to lit.cfg and the test CMake.

This adds lit test features for whether the standard library and runtime was
built with macCatalyst support:

  REQUIRES: maccatalyst_support

The test suite can also be run in two modes: one where the macOS tests
are run as usual (against a zippered standard library, runtime, and overlays)
and another where iOS tests are compiled with the macCatalyst target
triple and executed as macCatalyst processes.

The iOS tests for macCatalyst can be run by passing `--maccatalyst-ios-tests`
to build-script. There are new lit test features to enable a test to specify
whether it supports that environment:

  REQUIRES: OS=maccatalyst
  UNSUPPORTED: OS=macCatalyst
2020-01-21 18:28:17 -08:00
Devin Coughlin
63ce243437 [CMake] Add initial build system support for macCatalyst
This commit adds initial build system support for macCatalyst,
an Apple technology that enables code targeting iOS
to be recompiled so that it can be executed on macOS while still using
iOS APIs. This is the first in a series of commits building out support for
macCatalyst in the compiler, runtime, standard library, and overlays. Swift
for macCatalyst represents the work of multiple people, including
Devin Coughlin, Ross Bayer, and Brent Royal-Gordon.

Under macCatalyst, compiler-provided shared libraries (including overlays)
are built as one of four kinds (or "flavors") of libraries,
each with different install names and Mach-O load commands. This commit
adds the build system infrastructure to produce these different
library flavors.

**macOS-like Libraries**

A "macOS-like" library (such as the GLKit overlay) is a plain-old macOS library
that can only be loaded into regular macOS processes. It has a macOS slice with
a single load command allowing it to be loaded into normal macOS processes.

**iOS-like Libraries**

An "iOS-like" library, such as the UIKit overlay, is a library with a
macOS slice but with a load command that only allows it be loaded into
macCatalyst processes. iOS-like libraries are produced by passing a new
target tuple to the compiler:

  swiftc ... -target x86_64-apple-ios13.0-macabi ...

Here 'ios' (and an iOS version number) is used for OS portion
of the triple, but the 'macabi' environment tells the compiler
that the library is intended for macCatalyst.

**Zippered Libraries**

A "zippered" library can be loaded into either a macCatalyst process or
a standard macOS process. Since macCatalyst does not introduce a new Mach-O
slice, the same code is shared between both processes. Zippered libraries
are usually relatively low level and with an API surface that is similar
between macOS and iOS (for example, both the Foundation overlay and the Swift
Standard Library/Runtime itself are zippered).

Zippered libraries are created by passing both the usual `-target`
flag to the compiler and an additional `-target-variant` flag:

   swiftc ... -target x86_64-apple-macos10.15 \
              -target-variant x86_64-apple-ios13.0-macabi

Just like the -target flag, -target-variant takes a target tuple.
This tells the compiler to compile the library for the -target tuple but
to add an extra load command, allowing the library to be loaded into processes
of the -target-variant flavor as well.

While a single zippered library and slice is shared between macOS and
macCatalyst, zippered libraries require two separate .swiftinterface/.swiftmodule
files, one for macOS and one for macCatalyst. When a macOS or macCatalyst client
imports the library, it will use module file for its flavor to determine what
symbols are present. This enables a zippered library to expose a subset of its
target APIs to its target-variant.

**Unzippered-Twin Libraries**

"Unzippered Twins" are pairs of libraries with the same name but different
contents and install locations, one for use from macOS processes and one for
use from macCatalyst processes. Unzippered twins are usually libraries that
depend on AppKit on macOS and UIKit on iOS (for example, the MapKit overlay)
and so do not share a common implementation between macOS and macCatalyst.

The macCatalyst version of an unzippered twin is installed in a parallel
directory hierarchy rooted at /System/iOSSupport/. So, for example, while macOS
and zippered Swift overlays are installed in /usr/lib/swift/, iOS-like and
the macCatalyst side of unzippered twins are installed in
/System/iOSSupport/usr/lib/swift. When building for macCatalyst, the build system
passes additional search paths so that the macCatalyst version of libraries is
found before macOS versions.

The add_swift_target_library() funciton now take an
optional  MACCATALYST_BUILD_FLAVOR, which enables swift libraries to indicate
which flavor of library they are.
2020-01-21 18:26:13 -08:00
Ross Bayer
a6dab52f31 [Build System: build-script] Adds a new xcrun module to build_swift which replaces the existing module from swift_build_support.
This new module uses the build_swift.shell.ExecutableWrapper API to create a wrapper class around 'xcrun'. The wrapper class is instantiated and exposed under the name build_swift.wrappers.xcrun.
2020-01-19 17:19:38 -08:00
Ross Bayer
2d1930f583 Merge pull request #29310 from Rostepher/remove-old-which-module
[NFC][Build System: build-script] Remove the old which module in swift_build_support.
2020-01-19 17:09:58 -08:00
Ross Bayer
ac431fa3e1 [Build System: build-script] Remove the old which module in swift_build_support and replace uses with the which function provided in the build_swift shell module. 2020-01-19 03:49:13 -08:00
Ross Bayer
de1759c84f [Build System: build-script] Added a new run_test.py script to utils/swift_build_support which is used to run the unit test suite. 2020-01-19 01:31:21 -08:00
Ross Bayer
67d6b10dd0 [Build System: build-script] Add a new versions module to build_swift which provides the Version class.
Version acts very similarly to distutils.version.LooseVersion, but with some more flexibility around character group boundries.
2020-01-18 12:04:53 -08:00
Ross Bayer
516ad28c50 Merge pull request #29244 from Rostepher/adopt-six-in-build-swift
[Build System: build-script] Adopt the six compatibility library in the build_swift module.
2020-01-18 11:56:21 -08:00
Andrew Trick
90c478f6fc Add the target list to build-script --help.
Teach build-script to print the list of valid targets for the
--stdlib-deployment-targets option. Unfortunately, passing all
supported targets to this option is the only way to force
configuration of those targets. Simply using --ios is no longer
sufficient--none of the iOS targets are actually configured unless you
ask them to be built.

(The reasonable way to use a build config script is to first configure
for all supported platforms, but only build the platforms/targets one
by one when you actually need them).

This currently prints:

  --stdlib-deployment-targets STDLIB_DEPLOYMENT_TARGETS
                        The targets to compile or cross-compile the Swift
                        standard library for. None by default. Comma separated
                        list: android-aarch64 android-armv7 appletvos-arm64
                        appletvsimulator-x86_64 cygwin-x86_64 freebsd-x86_64
                        haiku-x86_64 iphoneos-arm64 iphoneos-armv7 iphoneos-
                        armv7s iphonesimulator-i386 iphonesimulator-x86_64
                        linux-aarch64 linux-armv6 linux-armv7 linux-i686
                        linux-powerpc64 linux-powerpc64le linux-s390x linux-
                        x86_64 macosx-x86_64 watchos-armv7k
                        watchsimulator-i386 windows-x86_64
2020-01-17 18:06:00 -08:00
Ross Bayer
0fdef59633 [Build System: build-script] Adopt the six compatibility library in the build_swift module. 2020-01-17 15:43:54 -08:00
Ross Bayer
2e73fd7d11 Merge pull request #29266 from Rostepher/remove-old-arguments-module
[NFC][Build System: build-script] Remove swift_build_support arguments module.
2020-01-17 02:15:04 -08:00
Ross Bayer
513c926e18 Merge pull request #29264 from Rostepher/remove-old-presets-parser
[NFC][Build System: build-script] Remove the old and unused preset parser.
2020-01-17 02:14:38 -08:00
Ross Bayer
31f063b8b8 [Build System: build-script] Remove the old arguments module hiding in swift_build_support in favor of the more featureful one living in build_swift. 2020-01-17 00:30:17 -08:00
Ross Bayer
7b8401c3f7 [Build System: build-script] Remove the old implementation of the preset parser hidden away in swift_build_support. 2020-01-17 00:25:35 -08:00
Ross Bayer
1d088fc231 [Build System: update-checkout] Move the run_parallel and check_parallel_results functions from swift_build_support into update_checkout which is the only caller. 2020-01-17 00:20:18 -08:00
Ross Bayer
bb22690af0 [Build System: build-script] Moves the rest of the build-script-impl migration code from swift_build_support into build_swift. 2020-01-16 21:00:11 -08:00
Saleem Abdulrasool
d8cc616602 Merge pull request #28663 from ahoppen/install-swiftsyntax-usr-lib
[build-script] Install SwiftSyntax to usr/lib instead of usr/lib/swift
2020-01-13 14:43:32 -08:00
Ankit Aggarwal
8ea2b26eb1 [SwiftPM] Pass --reconfigure when building swiftpm
This should help in avoiding incremental build issues on the CI

<rdar://problem/58287933> PR test failure to build swiftpm
2020-01-03 08:56:13 -08:00
Ankit Aggarwal
a7e757bc1a [SwiftPM] Replace new-bootstrap with bootstrap 2019-12-13 12:38:41 -08:00
David Hart
288edfd6d0 Migration to SwiftpM’s new boostrap script 2019-12-11 10:23:41 -08:00
Alex Hoppen
91ca8ca093 [build-script] Install SwiftSyntax to usr/lib instead of usr/lib/swift
SwiftSyntax is not part of the standard library and thus should not be
installed in usr/lib/swift.

This also removes the code to install SwiftSyntax's .swiftmodule file
since that code path was never exercised.
2019-12-09 18:27:55 -08:00
Varun Gandhi
d9aa72b2fa [NFC] Please linter by reducing width to < 80 columns. 2019-12-09 18:17:33 -08:00