Commit Graph

235 Commits

Author SHA1 Message Date
Brent Royal-Gordon
72f8249cb2 Print build-script notes to stderr
This makes it easier to ignore them programmatically.
2019-05-18 12:51:49 -07:00
Julian Lettner
4dcb49d8e7 Merge pull request #24330 from apple/preset-for-llvm-tsan-libdispatch-tests
[build][Linux] Create preset to run LLVM's TSan libdispatch tests
2019-05-17 10:32:55 -07:00
Julian Lettner
9631700d9e [build][Linux] Create preset to run LLVM's TSan libdispatch tests
Build a separate compiler-rt instance for running the tests. It is built
and tested against an installed toolchain instead of the llvm-build-dir.

Install everything we need to run tests (CMake modules, FileCheck, etc.)
into the toolchain directory.

Add synthetic target 'all' for llvm-install-components. Also we must set
LLVM_INSTALL_UTILS=ON, so the utilities required by tests (e.g.,
FileCheck) are included in the install target.
2019-05-16 13:17:30 -07:00
Daniel Rodríguez Troitiño
5c0e743fa5 [build-script] Introduce ProductBuilder. Transform Ninja to use it.
ProductBuilder allows us to tackle the different way than the different
products need to be build. The builders follow a very simple interface,
but inside them the details are hidden.

Previously the Ninja product was both a Product and ProductBuilder. The
methods that did the build have moved into ProductBuilder to match the
future ProductBuilders.
2019-05-13 12:36:29 -07:00
swift-ci
cfc03f85b6 Merge pull request #23955 from gottesmm/pr-098e8d08913c6672dcb8933d89afcd7c9f900dbd 2019-04-11 12:13:52 -07:00
Michael Gottesman
4a6154b4c4 [build-script] Rename ToolchainBenchmarks -> Benchmarks.
This is a better name for the internal interface. The outside option is still
--toolchain-benchmarks to distinguish it from the normal --benchmarks which is
part of swift's cmake.
2019-04-11 10:38:27 -07:00
Michael Gottesman
c86c1763c6 [benchmarks] Add support to the build-script swiftpm benchmarks for building the benchmarks in -Osize. 2019-04-11 10:10:38 -07:00
Michael Gottesman
53ff97428a [benchmarks] Change the build_script_helper to use subdirectories for each build and install final binaries in a toplevel ./bin build directory.
This will let me:

1. Add -Osize support easily.
2. Put all of the binaries in the same directory so that Benchmark_Driver can
   work with them via the -tools argument.
2019-04-10 22:18:50 -07:00
Michael Gottesman
115f7a43e0 Move build_script_helper from ./benchmarks/utils => ./benchmarks/scripts. 2019-04-10 22:18:50 -07:00
Daniel Rodríguez Troitiño
a8297b84bd [build-script] Rename all do_* methods to simply *.
As proposed in #23822, the do_* methods should only be using the * parts. Because all building should have the same names, this commit removes the prefix from all the method instances.
2019-04-08 15:51:27 -07:00
Saleem Abdulrasool
bc9c79a080 Revert "[build-script] Move HostSpecificConfiguration out of main script."
This reverts commit b9e17a7656.

Unfortunately, this caused conflicts on the Apple internal CI.
Reverting this for now.  This can be split up into smaller patches to
make it easier to merge.
2019-04-08 10:40:59 -07:00
Saleem Abdulrasool
9fb7fc0d60 Merge pull request #23810 from drodriguez/build-script-move-host-specific-configuration
[build-script] Move HostSpecificConfiguration out of main script.
2019-04-08 08:33:38 -07:00
Michael Gottesman
df539948d5 [benchmarks] Add support for building the benchmarks via build-script against the just created toolchain.
Now one can on Darwin/Linux build the benchmarks via swiftpm from build-script by passing in:

```
build-script $NORMAL_ARGS --install-swift --install-swiftpm --install-llbuild --toolchain-benchmarks --swiftpm --llbuild
```

This is done using the infrastructure that BenL added for sourcekit-lsp.
2019-04-07 13:25:31 -07:00
Daniel Rodríguez Troitiño
0e4f9380e9 [utils] Remove unused method.
The method was not used anywhere, and Workspace provides a better alternative which gives the full path instead of just the directory name.
2019-04-05 17:39:59 -07:00
Daniel Rodríguez Troitiño
b9e17a7656 [build-script] Move HostSpecificConfiguration out of main script.
This will allow using HostSpecificConfiguration from other parts that
are not the main script in the future.

Additionally, a lot of code that was part of BuildScriptInvocation has
been moved into HostSpeficiaConfiguration because nobody else needed it,
and HostSpecificConfiguration was highly coupled with the Invocation
object (through one of its arguments). This should make the
Configuration object a better citizen in other scenarios.
2019-04-04 19:21:42 -07:00
Daniel Rodríguez Troitiño
a92eff843e [build-script] Move call_without_sleeping into the shell module 2019-04-04 15:21:43 -07:00
Daniel Rodríguez Troitiño
9cec482ef3 [android] Allow executing only Android compiler tests.
The manipulation of host-test and skip-android-host was a little
different than the equivalent skip-ios-host and similar variables. These
changes make them closer and allows executing only the compiler tests,
but skip the test that need an Android device to run.

- Disables the upload command of the tests if the subset is the
  non-executable tests. The non-executable test do not need to be
  uploaded, and in the case of Android, a device doesn't need to be
  connected, so trying to connect to one will fail.
- Fix a problem where the swift_interpreter feature was removed without
  first checking if it was really added.
- Only enable the host tests (the compiler tests) in the Android CI
  preset (there's no device attached to that server, but currently only
  the Linux tests were being executed, which doesn't make a lot of
  sense).
- Move the decision about which platform support device/host tests into
  the platform themselves, which allows Android to have device/host
  tests. Also modify a little bit the logic around enabling/disabling
  the test suite to allow running only the host tests of a platform.
- Fix the suffix name for the target of non-executable tests in a couple
  of places.
2019-03-22 14:43:00 -07:00
Michael Gottesman
0dfaa19f9f [ownership] Rename enable-sil-ownership => verify-sil-ownership.
I have been meaning to do this change for a minute, but kept on putting it off.
This describes what is actually happening and is a better name for the option.
2019-03-18 01:31:44 -07:00
Mishal Shah
e296b6bd5c Add cmake-c-launcher and cmake-cxx-launcher flag to build-script 2019-02-26 17:10:54 -08:00
Brent Royal-Gordon
541b17a593 Fix build-script SwiftEvolve support (#22148) 2019-02-12 16:09:58 -08:00
Mishal Shah
2f7e367ed0 Merge branch 'master' into pkg-build-from-tc-combined 2019-02-05 22:15:03 -08:00
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