Commit Graph

1328 Commits

Author SHA1 Message Date
Michael Gottesman
2b2b5b8f08 [benchmarks] Remove cmake based external perf testsuite build.
If we do an external benchmark build, we will do it via the toolchain benchmark
build-script job. This will be simpler by allowing us to build against a just
built toolchain and separate us from the rest of swift's main CMakeLists.txt.
2020-05-10 14:16:14 -07:00
Michael Gottesman
edfbf57de2 [build-script] On non-Darwin build lld by default.
This will let us use lld to link the stdlib. This will allow us to
avoid problems due to old compilers being used on certain older distributions
that we support.

If anyone wants to not build lld, they can just pass to build-script-impl
--skip-build-lld
2020-05-07 17:42:58 -07:00
Max Desiatov
70e86c3633 [NFC] Fix comment typo in build-script-impl 2020-04-30 19:24:39 +01:00
Eric Miotto
b309c62a75 [build] set CMAKE_OSX_ARCHITECTURES in swift_cmake_options (#31414)
This augments #31023 to make sure CMake invokes the compiler checks
correctly -- this is needed to avoid errors in certain
configurations.

Addresses rdar://62339814
2020-04-30 09:34:36 -07:00
Butta
16d599ecfa [build-script-impl] Allow cross-compiling the host toolchain for Android 2020-04-21 15:53:32 +05:30
Davide Italiano
6e6761e4c4 Merge pull request #31023 from apple/also-swift-needs-that
[build-script] Pass CMAKE_OSX_SYSROOT to swift_cmake_options too.
2020-04-15 12:00:59 -07:00
Mishal Shah
050123283b Merge pull request #31012 from apple/shahmishal/drop-swift-api-digester-dsym
Disable creating swift-api-digester dSYM to reduce toolchain size
2020-04-14 17:44:01 -07:00
Davide Italiano
e60fe92f61 [build-script] Pass CMAKE_OSX_SYSROOT to swift_cmake_options too. 2020-04-14 13:27:40 -07:00
Mishal Shah
0f5bdb4949 Add a comment for removing debug symbols for swift-api-digester from the toolchain 2020-04-14 10:51:44 -07:00
Mishal Shah
9ae46a3473 Disable creating swift-api-digester dSYM to reduce toolchain size 2020-04-14 09:30:50 -07:00
Saleem Abdulrasool
fa6bedeccd build: explicitly pass the path to python2,python3
Explicitly pass the path to the python interpreter on macOS by using
`xcrun` to find the tools.
2020-04-13 20:29:29 -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
Doug Gregor
044613a13b [build-script] Add -simulator to simulator target triples. 2020-04-06 16:52:56 -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
Fred Riss
a4c5671a5f [build-script-impl] Pass host tools to LLDB's Cmake when cross-compiling 2020-03-27 13:41:26 -07:00
Adrian Prantl
7d699120b4 build-script: Avoid re-runnning the entire LLDB test suite twice. 2020-03-13 16:32:46 -07:00
Adrian Prantl
e676286c97 build-script: Rerun all lldb Swift tests with DWARFImporter.
rdar://problem/57880844
2020-03-12 19:34:23 -07:00
Kuba (Brecka) Mracek
ab6533a40f Merge branch 'master' into mracek/arm64e 2020-03-06 15:07:01 -08:00
Davide Italiano
af29f5dd3a [build-script] Allow primary-variant-arch and primary-variant-sdk to be set independently.
It's unclear why they're grouped, and it's also confusing.
2020-03-04 12:31:43 -08:00
Kuba Mracek
45ba5cec05 [arm64e] Add arm64e support into Swift's build system 2020-02-27 16:08:15 -08:00
Daniel Rodríguez Troitiño
073e44d6e8 Merge pull request #29296 from buttaface/droid
[android] Get build scripts working natively, fix tests and install
2020-02-24 21:05:47 -08:00
Saleem Abdulrasool
dd02e2ae8a build: add more paths for LLDB tests
Alter the test paths for LLDB to enable restructuring the Foundation
sources to be easier for new developers.
2020-02-12 19:45: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
Michael Gottesman
f352660a09 [build-script-impl] By default use the just built dsymutil to ensure that when we use the newer LLVM, the dsymutil supports newer debug info.
This can be disabled via the build-script-impl flag:

darwin-install-extract-symbols-use-just-built-dsymutil
2020-02-08 16:26:06 -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
Butta
3f4109b3a2 [android] Get build scripts working natively, fix tests and install
The build scripts assume Android cross-compilation using the NDK, so avoid
that configuration if building on an Android host. Fix or disable some tests,
and don't install a glibc.modulemap without a native sysroot prefix.
2020-02-05 11:36:33 +05:30
swift-ci
f4be6e803f Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-31 21:43:05 -08:00
Saleem Abdulrasool
6b9c570b38 build: correct the handling for the static variants
The static variants should use the same flags as the dynamic variants.
We missed the name conversion in the variable computation causing the
static and dynamic builds to diverge.
2020-01-31 15:54:37 -08:00
swift-ci
ffb289cc19 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-28 17:24:11 -08:00
Andrew Trick
4a123f102e Fix the build-script --skip-build option.
This option configures the build directories without building any
targets. Splitting configuration from build allows for the decoupling
of build products. This decoupling is essential for the enlightened
way of developing Swift where the build-script is never actually used
to build anything, and build products can be independently
configured. When fully supported, this avoids many unnecessary
full/clean rebuilds and enables debugging by mixing-and-matching
configurations and rebuilding only select products after a change.

Sadly, the option has degraded, and a recent commit rendered it fully broken:

  commit 34848e6026
  Author: Alex Langford <apl@fb.com>
  Date:   Wed Jan 22 19:27:44 2020

    [build] Unify logic to skip building projects in build-script-impl

The breaking commit was itself a reasonable cleanup. The underlying
problem was the original --skip-build was implemented using hacks that
conflated configuration with build.

This fix reinstates a reasonable situation:

--skip-build has no effect on configuration, as documented. It merely
  skips building the targets. This is how it must behave to work as
  intended.

--skip-build-{product} and its inverse --build-{product} controls
  which products will be configured. These options are in heavy use
  throughout the scripts, so changing the name (e.g. to --skip-config)
  would be disruptive and of questionable benefit.

None of this changes the fact that any required build logic that
people have dumped into build-script-impl still effectively breaks the
enlightened way of building Swift, particularly when building
toolchain components.
2020-01-28 13:09:08 -08:00
swift-ci
b0d3f3a13c Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-23 14:24:57 -08:00
Saleem Abdulrasool
35e3371ae1 Merge pull request #28960 from compnerd/static-dispatch
build: simplify handling for static variants (NFC)
2020-01-23 14:07:27 -08:00
swift-ci
85409a3fa6 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-23 12:43:48 -08:00
Saleem Abdulrasool
0c5f1ee829 Merge pull request #29373 from xiaobai/the-other-half
[build] Unify logic to skip building projects in build-script-impl
2020-01-23 12:43:12 -08:00
swift-ci
f8d0c67d28 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-23 08:24:33 -08:00
Saleem Abdulrasool
ca1bb6ff2e build: simplify handling for static variants (NFC)
There is no need to special case the products for the static build.
This handles `libdispatch_static` and `foundation_static` more
generically.
2020-01-23 08:17:59 -08:00
Saleem Abdulrasool
4356e95c3b Merge pull request #29371 from compnerd/bs-dead-variables
build: cleanup unreferenced CMake variables
2020-01-23 08:14:29 -08:00
Alex Langford
34848e6026 [build] Unify logic to skip building projects in build-script-impl 2020-01-22 19:27:44 -08:00
Saleem Abdulrasool
a3a88dd16e build: cleanup unreferenced CMake variables
`SWIFT_CMARK_LIBRARY_DIR` is not referenced in the build, remove the
variable.
2020-01-22 17:03:24 -08:00
swift-ci
4f70459a19 Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-22 16:03:39 -08:00
Saleem Abdulrasool
f1ef08af7c Merge pull request #29363 from compnerd/bs-check
build-script: reduce duplication of check
2020-01-22 15:45:14 -08:00
swift-ci
b068ea573f Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-22 14:24:40 -08:00
Saleem Abdulrasool
53c7bb0fbc build-script: reduce duplication of check
This hoists the shared check to the beginning of the product
installation phase.  This can be done as a shared phase option.  In
theory it should be possible to hoist this further to a single check at
the beginning of the phase.
2020-01-22 13:40:58 -08:00
swift-ci
ab775d127f Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-22 08:24:34 -08:00
Saleem Abdulrasool
45af79d1a3 build-script: generate options (NFC)
Rather than individually list the options, generate the options which
ensures that options are more uniform and makes it easier to alter them
globally.
2020-01-22 08:23:41 -08:00
Saleem Abdulrasool
4e59d397ca Merge pull request #29340 from compnerd/bs-check
build-script: use more terse checks
2020-01-22 08:19:38 -08:00
Erik Eckstein
bbfaccda4b Merge remote-tracking branch 'origin/master' into master-rebranch 2020-01-22 08:25:23 +01:00
Jonas Devlieghere
774dd07c0e [build-script] Disable LZMA for swift-lldb 2020-01-21 20:22:49 -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