Commit Graph

864 Commits

Author SHA1 Message Date
Ben Langmuir
da5e2e6f87 Merge pull request #22375 from apple/revert-22359-revert-22346-libcxx
Reapply "[build-script] Add Product for libc++"
2019-02-05 15:20:57 -08:00
Michael Gottesman
f13b8eb10b [cmake] Rather than using CMAKE_{C,CXX}_COMPILER and CMAKE_{C,CXX}_COMPILER_ARG1 for distcc, use CMAKE_{C,CXX}_COMPILER_LAUNCHER.
This is a cleaner, more principled way of adding "compiler launcher" support and
ensures that cmake understands that distcc is not the "actual" compiler.

This ensures that when we compile SwiftRemoteMirrors for the host, we do not try
to compile using distcc without needing to reset CMAKE_{C,CXX}_COMPILER_ARG1
(which is unset when compiling things in the stdlib).
2019-02-05 13:22:53 -08:00
Ben Langmuir
1b2677fc72 Revert "Revert "[build-script] Add Product for libc++"" 2019-02-05 08:57:44 -08:00
Ben Langmuir
4587ba30b9 Revert "[build-script] Add Product for libc++" 2019-02-04 14:58:03 -08:00
Ben Langmuir
9bbd28725a [build-script] Fix pylint warnings from indexstoredb/sourcekitlsp 2019-02-04 14:44:42 -08:00
Ben Langmuir
6cc14afec9 [build-script] build and test indexstore-db and sourcekit-lsp
Add support to build-script to build and test the indexstore-db and
sourcekit-lsp projects. A future change will add support for installing
these products and putting them in the toolchain.  To build the new
products, add the `--sourcekit-lsp` or `--indexstore-db` options to a
`build-script` invocation.

We add the notion of a Product that is not part of build-script-impl and
build these products after the install phase of build-script-impl. These
products are built using the installed toolchain - either using the
default location within the build subdirectory, or the user-specified
`--install-dest`. This is somewhat rigid setup, since it requires the
toolchain used to build to be the same as the final installed toolchain
(if any), but it makes for a simpler change to the existing builds while
still making progress towards a toolchain-based build model.

*Note*: currently, if you are not using a preset you will need to
manually specify all of the dependencies (on macOS this is
swiftpm and llbuild, on other platforms you additionally need
libdispatch, icu, foundation, and xctest), and the install flags for the
same projects (`--install-llbuild --install-swiftpm ...`). This is not
particularly user-friendly, but it matches the current behaviour of the
other targets, and there is not yet any infrastructure in build-script
to describe these dependencies.
2019-02-04 14:44:22 -08:00
Ben Langmuir
5cdc15bd84 Fix pylint error 2019-02-04 12:02:58 -08:00
Ben Langmuir
a20050ab30 [build-script] Add Product for libc++
In a non-legacy-impl world, this is needed to trigger
building/installing libc++.

https://bugs.swift.org/browse/SR-9861
2019-02-04 10:26:36 -08:00
Michael Gottesman
cc68e6a0d5 Remove some remaining dead code from the +0 argument convention bring up.
I already removed the option from SILOptions, so all of this stuff is dead.
2019-01-27 13:18:06 -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
swift-ci
ac8b89abb5 Merge pull request #20082 from drodriguez/android-aarch64-build-script 2018-11-26 19:34:24 -08:00
Graydon Hoare
4aa01e908a Fix flake8 warning E741 ambiguous variable name 'l'. 2018-11-05 21:01:33 -08: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
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
Ross Bayer
5323ae1374 Revert "Removed SDKROOT from the environment variables that are purged before building Swift and then prefer SDKROOT when determining -isysroot when building Ninja. (#13829)" (#18115)
This reverts commit eae413dc56.
2018-07-23 13:51:33 -07:00
Michael Gottesman
ad3e05d82e [build-script] Add support for building the compiler with sanitizer coverage so we can make libFuzzer based fuzzers for swift compiler tools. 2018-05-02 17:39:18 -07:00
Michael Gottesman
e071e46068 Add build-script flag --enable-exclusivity-checking to enable exclusivity checking always when we compile stdlibCore.
It is off by default.

rdar://39335800
2018-04-11 09:23:06 -07:00
Michael Gottesman
e567bc9028 [+0-all-args] Enable +0 normal arguments.
rdar://34222540
2018-03-19 20:25:31 -07:00
Jacob Mizraji
68f9659775 Start passing libtool to CMake
This will align the libtool passed to CMake with the clang and clang++
2018-02-05 11:23:37 -08:00
Ross Bayer
eae413dc56 Removed SDKROOT from the environment variables that are purged before building Swift and then prefer SDKROOT when determining -isysroot when building Ninja. (#13829) 2018-01-16 18:33:52 -08:00
Michael Gottesman
8c0908aac5 [cmake][build-script] Add support for building the runtime with +0 normal args.
I am upstreaming some changes to the runtime to support +0 normal arguments.

rdar://34222540
2017-12-30 21:58:25 -05:00
Ross Bayer
5a8a25e59e [build-script] Argument Builder DSL Conversion: Episode 3 (#13231)
* Updated the PathType and StorePathAction classes to allow for asserting if a path contains an executable.

* Converted the top-level argument group to use the new builder DSL.

* Updated tests for StorePathType to not actually test the functionality of the PathType class.

* Implemented a CompilerVersion type to mimic the existing wrapper in swift_build_support and return a more detailed object from ClangVersionType and SwiftVersionType.

* Updated action tests.

* Fixed a filter() mistake.

* Code review.
2017-12-06 12:36:48 -08:00
Ross Bayer
d1620f509e Updated argument parsing code to use a new OnOffAction with Enable and Disable variants, properly handling optional boolean arguments and inverting the state for disabled options. Previously when an option such as '--skip-build-benchmarks' was passed with a boolean the destination would take on the value without inverting the state, which was causing some build configuration errors. (#12005) 2017-09-29 12:06:51 -07:00
Calvin Hill
aee81d272f Add Initial platform support for Haiku. (#11583) 2017-09-22 21:06:56 -04:00
Ross Bayer
ef7c951949 Affirmative names for argument parsing namespace destinations. (#11952)
* Added new OptionalTrueAction and OptionalFalseAction classes to the arguments module.

* Fixed missing return statement in help-test generator.

* Renamed all the `skip_build_*` names to the more simple and affirmative `build_*`.

* Renamed all the `skip_test_*` names to the more simple and affirmative `test_*`.

* Added documentation to the OptionalTrueAction and OptionalFalseAction classes.
2017-09-15 16:21:38 -07:00
Mishal Shah
6d2487d6d1 Add support to skip 32bit iOS simulator tests 2017-06-28 00:18:09 -07:00
Hugh Bellamy
ae402c7584 Merge pull request #10490 from hughbe/master
Update update-checkout on Windows
2017-06-24 11:16:31 +07:00
swift-ci
1a6ed0ac8a Merge pull request #10504 from gottesmm/lsan_linux_bot 2017-06-22 13:24:18 -07:00
Michael Gottesman
aa4e2dac2c [build-script] Add support for compiling swift with leaks sanitizer.
This only enables the swift compiler (not its output) to be used with leaks
sanitizer on linux.

Some important notes: On Linux, right now we are not completely leak clean. I
was only able to get a -Onone build of the stdlib without triggering lsan (I was
unable to run the optimizer and the tests successfully). Additionally even at
-Onone, I had to suppress some leaks in the driver. The point of this though is
to prevent any further -Onone leaks from being committed to the tree since
-Onone leaks that are not bounded (unlike the driver bugs) could cause SourceKit
to leak memory. Since SourceKit is a long running process... such a type of leak
would be bad.

rdar://32876901
2017-06-22 12:52:12 -07:00
Hugh Bellamy
35a778ef2c Fix Windows python errors in SwiftBuildSupport 2017-06-22 15:11:23 +07:00
Mishal Shah
c5ff1f2cac Update master to build with Xcode 9 beta 1, OS X 10.13, iOS 11, tvOS 11, and watchOS 4 SDKs. 2017-06-14 16:20:35 -07:00
Doug Coleman
053f71c7f1 utils: Fix python import path round two. 2017-04-07 11:56:21 -07:00
Mishal Shah
f1c3629246 Revert "python: Fix nosetests tests." 2017-04-06 18:51:50 -07:00
Doug Coleman
c0b7918099 python: Fix nosetests tests.
Why are the python reasons for having our code nested in a directory
called ``swift_build_support.swift_build_support/`` instead of simply
``swift_build_support/``? Is that what we really want here?
2017-04-06 17:47:09 -07:00
Hugh Bellamy
36645a0976 Address FIXMES for cleaning up imports in build-script and friends 2017-04-01 09:54:01 +07:00
Hugh Bellamy
aa70ea8fdd Remove a 9 from overly high timeouts 2017-03-31 09:58:39 +07:00
Doug Coleman
3d08b49dae utils: python lint fixes. 2017-03-30 16:32:13 -07:00
Jacob Mizraji
2647ca2f84 Pass CLANG_VERSION_* cmake flags to the LLVM build.
In a normal swiftless clang build, if it doesnt know CLANG_VERSION_*,
clang's cmake falls back on LLVM_VERSION_*. We pass a CLANG_COMPILER_VERSION
to swift, but it is not necessarily what clang wants to know.

The intention of this CLANG_VERSION_* flag in Clang is to know
what Swift calls clang_user_visible_version. This is the non-specific
version of Clang. For example, clang-900 - this is 9.0.0, while Swift
would like clang_compiler_version to be the specific version that the
driver will print out.

Flag naming!

Fix tests
2017-03-29 15:57:06 -07:00
Hugh Bellamy
ad4b338062 Fix python lint failures now not excluded as we provide custom exclusions
Looks like flake8 enables other rules when you add something to the
exclusion list. We added W291
2017-03-27 12:31:56 +07:00
Michael Gottesman
912a162e57 [build-script] Give ubsan, tsan the same treatment I gave asan in 824ffa6857. 2017-03-26 20:07:14 -07:00
Hugh Bellamy
8671854674 Properly python lint remaining files 2017-03-23 14:06:46 +07:00
Doug Coleman
e7390d1770 Revert "utils: Add swiftenvs, which allow the overriding of compiler tools."
This reverts commit 2b923f3846.
2017-03-22 20:09:34 -07:00
Doug Coleman
e480227d82 Revert "swiftenv-script: Fix some issues with swiftenvs." 2017-03-22 17:00:21 -07:00
Doug Coleman
351a515f6c swiftenv-script: Bug fixes for swiftenv.
Fix the mocked output files of swiftc. Change the lookup of
clang from build-script to build-script-impl like all the other
commands. Pass more args to LLVM. Fix swiftenv creation. Fix unit tests.

The reason this patch works is that build-script-impl gets
all the arguments that are not handled by build-script.
2017-03-22 12:47:33 -07:00
Doug Coleman
2b923f3846 utils: Add swiftenvs, which allow the overriding of compiler tools. 2017-03-21 14:59:12 -07:00
Mishal Shah
dd9c81c965 Revert "Integrate python-lint into validation tests" 2017-03-21 12:24:46 -07:00
Hugh Bellamy
639c0beec7 Get python-lint build clean 2017-03-21 20:21:43 +07:00
Michael Gottesman
824ffa6857 [build-script] When building with asan, mangle asan into the build subdirectory name.
Today, when you enable ASAN, build-script just reconfigures your normal build
directory to use ASAN. This forces you to recompile LLVM and Swift with ASAN
enabled and then (once you have finished using ASAN) to recompile LLVm/Swift
without ASAN.

By using a different build-directory, one still has to (potentially) recompile
LLVM/Swift, but one's original directory has not become invalidated. Thus when
you switch back to a normal build, one does not have to recompile LLVM and
(potentially) Swift!
2017-03-17 18:44:48 -07:00
Ben Langmuir
da4d084458 Revert "[build-script-impl] Add support for building benchmarks on linux but disable it in all currently defined presets for linux." 2017-03-06 08:50:04 -08:00
swift-ci
031ecc2b57 Merge pull request #7860 from gottesmm/build_script_impl_linux_benchmarks 2017-03-05 13:30:59 -08:00