Commit Graph

968 Commits

Author SHA1 Message Date
Xi Ge
ff0d764ec9 Merge pull request #22073 from nkcsgexi/PGO-swift
cmake: allow building the Swift compiler with Clang's Profile Guided Optimization (PGO)
2019-01-23 20:02:41 -08:00
Jordan Rose
77689f5945 Revert "Set a reasonable default for SWIFT_INSTALL_COMPONENTS" (#22079) 2019-01-23 19:35:09 -08:00
Xi Ge
018799cd6c cmake: allow building the Swift compiler with Clang's Profile Guided Optimization (PGO)
Previously, Build script flag --clang-profile-instr-use is only used for building
clang and llvm. This patch extends PGO to the building of the Swift compiler.
2019-01-23 18:02:43 -08:00
Xi Ge
43e7801606 build-script: install libParser header files to destination. 2019-01-22 15:48:08 -08:00
Ben Langmuir
5dbe28bf13 Update for feedback 2019-01-22 15:37:50 -08:00
Ben Langmuir
5619138a10 [build-script] Turn on --no-legacy-impl by default
Turns on the `--no-legacy-impl` option to build-script by default; the
old behaviour is temporarily still available as `--legacy-impl`.

This causes build-script to invoke build-script-impl for every
individual build/test/install/etc. action rather than a single global
invocation. For example, a single invocation might be for
`macosx-swift-install`. This will enable the python code in build-script
to drive the overall process and add additional steps in between actions
without the involvement of build-script-impl. It also provides a path to
refactoring the existing actions out of build-script-impl individually.

Discussed as part of https://forums.swift.org/t/rfc-building-swift-packages-in-build-script/18920

The --no-legacy-impl flag was originally disabled by default because of
concerns about the performance of null builds due to the increased
number of script invocations. There is a small optimization in this
commit to use `tr` when processing command-line options instead of
bash's builtin substitution, which eliminates most of the overhead.
After this change, a null build of llvm+swift changes from 1.6 s to
2.1 s on Linux, and from 5 s to 6 s on macOS.  Non-null builds and
builds that involve more build products than just llvm+swift (e.g.
corelibs) are basically unaffected since they are not correctly
incremental to begin with.

The changes to build-script-impl in this commit are to fix the behaviour
of --no-legacy-impl, which had bitrotted since it was introduced. These
changes are to make various parts of the script not rely on variables
defined in "earlier" parts of the script, which is good hygiene in
general.
2019-01-22 15:37:50 -08:00
Xi Ge
ced5044991 build-script: add a flag to separately install SwiftSyntax artifacts.
This flag '--swiftsyntax-install-prefix' could be used in the preset mode
to specify an installation dir. If we are building SwiftSyntax without building
the rest of the compiler, we'll install the SwiftSyntax modules and dylibs
with lib_InternalSwiftSyntaxParser.dylib to the given directory directly, ignoring
the conventional toolchain locations.
2019-01-22 11:59:39 -08:00
Xi Ge
eefa0b1595 build-script: add a flag to build libSwiftSyntaxParser only. 2019-01-17 16:05:46 -08:00
Ben Langmuir
d685728d4a Merge pull request #21886 from benlangmuir/install-components-default
Set a reasonable default for SWIFT_INSTALL_COMPONENTS
2019-01-17 10:12:44 -08:00
adrian-prantl
6914e6e411 Merge pull request #21935 from adrian-prantl/speedup-compat
Add a lit regex filter for the compatibility tests
2019-01-16 16:05:44 -08:00
Ben Langmuir
aac60468a2 Set a reasonable default for SWIFT_INSTALL_COMPONENTS
Previously, build-script-impl would set this to "" by default, resulting
in nothing being installed with --install-swift unless you explicitly
set --swift-install-components as well.  Now we defer to cmake by
default.

On the cmake side, change the default value to exclude
* dev - uses a lot of disk space and usually not something you want to
  install into a toolchain
* clang-resource-dir-symlink & clang-builtin-headers-in-clang-resource-dir -
  these are mutually exclusive with clang-builtin-headers
* sourcekit inproc/xpc - these are currently mutually exclusive, so pick
  the best one for the current platform.
2019-01-16 14:48:02 -08:00
Adrian Prantl
7967ec19b6 Add a lit regex filter for the compatibility tests
This speeds up the invocation since only a single test matches the
category and otherwise non-dotest.py tests would be run twice.
2019-01-16 14:40:53 -08:00
Argyrios Kyrtzidis
7a383f4b1d [build-script-impl] Pass search paths for the syntax parser library to the stress-tester build
Fixes rdar://47265256
2019-01-14 16:52:33 -08:00
Adrian Prantl
622753daa4 Fix more shell syntax errors in the LLDB asan configuration 2019-01-14 09:48:50 -08:00
swift-ci
41ac9ca002 Merge pull request #21806 from adrian-prantl/LLVM_LIT_ARGS 2019-01-11 18:34:57 -08:00
Adrian Prantl
94c2e467fb Simplify build-script: LLVM_LIT_ARGS is already being added to cmake_options. 2019-01-11 15:06:11 -08:00
adrian-prantl
908646f9ca Merge pull request #21801 from adrian-prantl/lit
[build-script] Pass LLVM_LIT_ARGS to llvm-lit
2019-01-11 12:59:50 -08:00
Adrian Prantl
a7f2f1b497 [build-script] Pass LLVM_LIT_ARGS to llvm-lit 2019-01-11 12:07:51 -08:00
Argyrios Kyrtzidis
9c0403761d Merge pull request #21762 from akyrtzi/syntax-parser-clib
Introduce C parser library
2019-01-11 11:19:50 -08:00
Adrian Prantl
59ddf34cee Fix a syntax error in build script 2019-01-11 08:20:31 -08:00
Argyrios Kyrtzidis
70c954e1ea [utils/build-script-impl] Pass header/lib paths to the syntax parser library for the build-script invocation of SwiftSyntax 2019-01-10 18:52:37 -08:00
Adrian Prantl
1db8e37f0d Limit the number of concurrent LLDB tests running in the asan configuration. 2019-01-10 12:38:50 -08:00
Brent Royal-Gordon
9dd5d1293c Rework swift-stress-tester repo building (#21523)
This change makes build-script-impl use a new, shared version of swift-stress-tester’s build-script-helper.py which also supports building swift-evolve. It also adds the necessary flags and variables to build swift-evolve from build-script.
2019-01-09 14:03:35 -08:00
Mishal Shah
ba2233d248 Update the toolchain plist by moving SWIFT_USE_DEVELOPMENT_TOOLCHAIN_RUNTIME into OverrideBuildSettings 2018-12-18 18:14:52 -08:00
Saleem Abdulrasool
69e2018806 build-script: build static version of Foundation
Build and install Foundation static.  We now build Foundation using
CMake, which does not easily generate static and shared versions of
libraries.  Create two builds to populate the toolchain
distribution.
2018-11-28 10:12:19 -08:00
Saleem Abdulrasool
81321b57a4 build-script: build static version of libdispatch
build and install libdispatch static.  We now build libdispatch using
CMake, which does not easily generate static and shared versions of
libraries.  Create two builds to populate the toolchain distribution.
2018-11-27 11:51:26 -08:00
swift-ci
ac8b89abb5 Merge pull request #20082 from drodriguez/android-aarch64-build-script 2018-11-26 19:34:24 -08:00
Mishal Shah
e7481cc0cd Update the plist to use DefaultBuildSettings not OverrideBuildSettings for SWIFT_USE_DEVELOPMENT_TOOLCHAIN_RUNTIME 2018-11-14 13:44:46 -08:00
Mishal Shah
cfd3c52b6f Update the plist information for swift toolchains
rdar://45197621
2018-11-14 12:43:48 -08:00
Mishal Shah
bae265e308 Revert "Revert "[build-script] Update build-script to support building and installing the SourceKit stress tester"" 2018-11-12 11:08:36 -08:00
Mishal Shah
e7d501c2bd Revert "[build-script] Update build-script to support building and installing the SourceKit stress tester" 2018-11-11 17:49:35 -08:00
Nathan Hawes
506307c626 [build-script] Update build-script with a new --skstresstester flag to support building and installing the SourceKit stress tester
This makes use of a helper script in the stress tester repo to do the actual
build and install: https://github.com/apple/swift-stress-tester/blob/master/SourceKitStressTester/Utilities/build-script-helper.py
2018-11-07 09:14:39 -08:00
Saleem Abdulrasool
14dbc9ae14 Merge pull request #20329 from compnerd/frameworks
build: pass the framework path to the importer
2018-11-06 00:11:20 -08:00
swift-ci
2c9616f9c0 Merge pull request #20330 from nkcsgexi/install-swiftsyntax 2018-11-05 21:56:42 -08:00
Saleem Abdulrasool
a94f317857 build: adjust rpath, don't pass -F to the link
Pass the framework only to the importer as `-F` on ELF is used for the
`DT_FILTER`.  Adjust the `DT_RUNPATH` so that the dependent libraries are found.
2018-11-05 14:25:12 -08:00
Xi Ge
d471a5905a build-script: teach the script to optionally install swiftsyntax. 2018-11-05 12:32:02 -08:00
Simon Evans
8609c1e41a cmake: Enable CTEST_OUTPUT_ON_FAILURE to show corelibs-foundation test failure 2018-11-04 17:12:54 +00:00
Simon Evans
6188980324 SR-8876: Update for CMake build for Foundation
- Copy ICU licence into final install.
2018-11-02 17:37:12 +00:00
Simon Evans
3b2ebeecf4 SR-8876: Always build libicu on Linux
- Uses version 61.1 from ICU Github unicode-org/icu repository.

- Updates mixin_linux_installation to add libicu option.

- Use -j when building libicu.

- When buiding ICU, use --with-library-suffix=swift
  This suffixes the ICU symbols with _swift.

  The libaries are now named libicuucswift, libicui18nswift
  and libicudataswift.

- Add the contents of uconfig.h.prepend into uconfig.h. This avoids
  passing the renaming CFLAGS to swift and swift-corelibs-foundation.

Also resolves:

SR-5618: libicu compilation should happen in parallel respecting -j.
2018-11-02 17:37:12 +00:00
Saleem Abdulrasool
679fc7d792 Merge pull request #20032 from compnerd/cmake-foundation
build: switch swift-corelibs-foundation to CMake
2018-11-01 20:10:27 -07:00
Xi Ge
f5dca09a66 build-script: infer swiftpm executables if swiftpm isn't built. 2018-11-01 15:26:26 -07:00
Saleem Abdulrasool
58a4f0deaf build: switch swift-corelibs-foundation to CMake
swift-corelibs-foundation has had a CMake based build system for a while
now.  Switch the official builds over to it.
2018-10-31 13:58:08 -07:00
Adrian Prantl
023ac85383 Enable verbose logging for LLDB tests when building with Xcode 2018-10-26 16:48:55 -07:00
Daniel Rodríguez Troitiño
555e085d78 [build-script] Support for Android aarch64
Support for Android aarch64 in many parts of the build-script. Most of
the changes are reuse variables/parameters that already existed for
Android ARMv7. There is also a new parameter to specify the ICU
data library, which is used by #19503.

With this one can build either armv7 or aarch64, since building both
at the same time requires more changes like #19432 (and probably
more work to support two set of paths).
2018-10-26 12:24:40 -07:00
Ross Bayer
c3a9498f03 Removed the use of bash subshells to execute the test commands per project in build-script-impl. The original reasoning seems to have been to disable Ninja's output buffering which was causing the lit progress bar to behave oddly, however local (parallel) testing does not show any peculiarities now. (#20025) 2018-10-25 15:00:36 -07:00
Saleem Abdulrasool
9c92317ce6 build: do not consult the legacy location for libraries
Update the commands to use the CMake based output directory locations instead of
the legacy staging location.  This will allow us to stop copying the files for
compatibility.
2018-10-23 14:12:34 -07:00
mishal_shah
b44feabefc Codesign dylibs after stripping the debug symbols 2018-10-18 16:28:13 -07:00
Saleem Abdulrasool
b99a0f4af5 build: use the exported config for libdispatch
Pass along the configuration through the exported target for the standard
library.  Still pass the compiler by hand to allow building libdispatch against
just a build of the standard library.
2018-10-11 12:37:26 -07:00
Adam Thayer
965f6190f3 [i686 Linux] Bootstrap the build
Prior to this, the swift build didn’t understand what i686 is, or what to do about building it. This unblocks building, but will still run into build breaks.
2018-09-28 10:14:44 -07:00
Saleem Abdulrasool
ab56873dd5 build-script: always rebuild XCTest on non-Darwin
This should resolve SR-8826!  Ideally, we would be using CMake to tie together
all the dependent packages and get proper dependency tracking.  Currently,
change to the swift runtime do not get tracked properly, and can result in
undefined references to symbols.
2018-09-24 15:03:43 -07:00