Commit Graph

285 Commits

Author SHA1 Message Date
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
62adeb6b9d [build-script] Add some sanity to how we trigger benchmarks being built.
Specifically:

1. SKIP_TEST_BENCHMARK => SKIP_TEST_BENCHMARKS

I looked for --skip-test-benchmark (notice no s) and SKIP_TEST_BENCHMARK. It
seems like it is dead, especially since we have --skip-test-benchmarks.

2. Remove the code that works around SKIP_TEST_BENCHMARK typo.
2018-05-30 14:22:23 -07:00
David Zarzycki
dc22a4d54b [build-script] Track underlying CMake/lit changes 2018-03-21 06:47:37 -04:00
Vedant Kumar
9db99a0a24 build-script: Implement support for --(no-)lldb-assertions
* LLDB assertions are on by default, like swift assertions

* LLDB assertions can be enabled/disabled globally with the --assertions
  and --no-assertions options

Partially addresses: rdar://38524846
2018-03-15 20:45:02 -07:00
Ankit Aggarwal
b3b24eb928 [build-script] Add plumbing for llbuild assertions
This adds two flags to the build script to enable/disable assertions in
llbuild: --llbuild-assertions, --no-llbuild-assertions

The default value is taken from the global assertions flag.
2018-03-08 16:22:40 -08:00
Ankit Aggarwal
a9cc5987cf [build-script] Pass llbuild build type arg to build-script-impl
rdar://38034197 (llbuild may not be building in release mode in the Swift toolchain)
2018-03-05 10:42:39 -08:00
Ross Bayer
4edb8d9baa [build-script] Presets Module (#14422)
* Implemented a presets module which includes a more robust and easy to understand parser. Moved the swift-sdks migration code to a new migration module and added testing for both the presets and migration modules. Also converted build-script to use the new presets parser.

* Switched the expansion algorithm to resolve mixins in-place (little known feature) and also changed the parser to skip all non-preset sections. Tests are included for these two behaviors.

* Re-worked the presets error hierarchy to have more descriptive and information packed exception classes. Also re-worked the PresetParser to catch duplicate preset declarations and duplicate options in a single preset. There's some special shim-code to handle the disconnect between the Python 2 ConfigParser module and the Python 3 update which adds DuplicateOptionError.
2018-02-26 11:26:22 -08:00
Ross Bayer
a43604498b [build-script] Respect TOOLCHAINS environment variable (#14202)
* Respect the TOOLCHAINS environment variable if set when deciding the darwin xcrun toolchain.

* Updated test/lit.cfg to respect the TOOLCHAINS environment variable when deciding the xcrun toolchain for Darwin platforms, rather than hardcoding the default.

* Fixed the default darwin xcrun toolchain logic.
2018-01-30 13:20:55 -08:00
Connor Wakamo
806c01d0a9 [build-script] Merged the PlaygroundLogger and PlaygroundSupport products.
These don't make sense to build separately, and indeed it's likely that PlaygroundLogger will soon depend on PlaygroundSupport.
As a result, build them as one product (playgroundsupport) in build-script.
Aside from removing the playgroundlogger product, this otherwise continues to build PlaygroundLogger and PlaygroundSupport the same way.

This is for <rdar://problem/36512531>.
2018-01-23 23:29:20 -08:00
Vedant Kumar
330e47d869 build-script: Build lldb with CMake on Darwin
build-script can already build lldb on Darwin using its Xcode project,
but it's useful to support the CMake build as well.

The CMake build allows incremental rebuilds with build-script. I expect
this to significantly cut down on iteration time.

Taking advantage of CMake also lets lldb piggyback on existing support
for sanitizers -- or exciting new build configurations we don't know
about yet -- without having to update the Xcode project file.

rdar://problem/36751944
2018-01-22 19:00:32 -08:00
Vedant Kumar
f1349088e7 build-script: Pass UBSan options to the lldb xcodebuild invocation
Now, `./build-script --enable-ubsan` will do the right thing if you have
lldb checked out, pending an additional lldb change.

rdar://36630617
2018-01-19 14:29:45 -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
5fbf769b2a [asan] On Linux, when running with ASAN, disable leaks detection.
The reason to do this is that:

1. We already have a separate leaks bot.
2. We are not leaks clean at -O, but are ASAN clean at -O.

It doesn't make sense to limit our ability to verify that on Linux, we stay ASAN
clean at -O since we are not leaks clean at -O. Once we get leaks clean at -O,
we should create a separate bot.

rdar://31276806
2017-10-22 15:22:32 -07:00
Ross Bayer
b62704bc03 Removed duplicate logic for determining the stdlib deployment targets from apply_default_arguments in build-script. (#12428) 2017-10-15 16:56:17 -07:00
Ross Bayer
615355c556 [build-script] Move non-trivial argument default logic (#12408)
* Moved argument-defaults logic that should be determined outside the actual parser back into the build-script. This logic will be relocated again at a later date to a more suitable module with testing.

* Moved test-paths argument default logic into build-script until it can find a better home in the future.

* Removed old default value for stdlib_deployment_targets from the expected options.
2017-10-13 12:25:38 -07:00
Ross Bayer
a14524e4e6 Revert erroneous renaming of test_*_host destinations to test_*_device. (#12127) 2017-09-26 16:20:55 -07:00
Michael Gottesman
c2d8cc7ff0 [benchmark] Add support for building out of tree via build-script against the just built swift.
I recently broke the out of tree build by mistake [its fixed now ; )]. This
inspired me to make it easy to test this behavior by adding support to
build-script/cmake/etc for running an external benchmark build via
AddExternalProjects.

Now I can just call build-script with --build-external-benchmarks and thats it!
It should just work! It already helped me to avoid breaking the external build
twice!

I hope that eventually we get this on a bot to make sure it keeps working [or
even added to the smoke tests ; )].

*NOTE* This is disabled by default so it will not affect normal builds.

*NOTE* This just builds the external benchmarks. There is an rpath issue that
prevents you from running them (the benchmarks have the rpath set as if they are
next to the stdlib, but they are not. This can be fixed in a few different ways,
but I do not have time to finish implementing it = (. But this commit is a good
first step and at least detects build errors.
2017-09-25 12:31:39 -07:00
Pavel Yaskevich
c3ad876c61 [build-script] Add --test-paths option to run subset of tests (#12023)
Sometimes it's useful to be able to run tests located in specific
directories and/or files, let's enable this in `utils/build-script`
using `--test-paths` option which accepts a list of viable test locations.

Resolves: rdar://problem/32004487
2017-09-21 17:35:42 -07: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
Ross Bayer
695ded24d4 Move legacy argparser (#11872)
* Implemented a (mostly) comprehensive test suite for the argument parser (ab)using metaclasses to dynamically generate unit-tests for each valid argument and preset.

* Fixed failing defaults test for build_ninja.

* Added new HelpOption and IgnoreOption classes for generating tests.

* Converted default value test into individual generated tests which should give better output in case the default tests fail.
2017-09-15 01:05:06 -07:00
Ross Bayer
d4d35acbd0 Move build-script apply default arguments into separate module (#11882)
* Moved the default argument application logic to the new driver_arguments module in preparation for the larger argument parsing refactor.

* Re-ordered imports in order to satisfy python linter.
2017-09-13 17:09:49 -07:00
Ross Bayer
a66a27db9f Moved the argument parsing logic from the default main function in build-script into a separate module. (#11880) 2017-09-12 16:38:11 -07:00
Ross Bayer
71cefffefc Merge pull request #11733 from Rostepher/build-script-whitespace
Removed trailing whitespace in build-script and build-script-impl
2017-09-08 18:36:55 -07:00
Mishal Shah
b0d70edf04 Merge pull request #11324 from apple/enable-ios-simulator-32bit-test
[lit] Enable testing for iOS 32-bit simulator by default
2017-09-08 15:39:24 -07:00
Arnold Schwaighofer
5b7654450a build-script: Add test-optimize-for-size (#11778)
* build-script: Add test-optimize-for-size

* Fix python lint error: line too long
2017-09-06 07:36:40 -07:00
Ross bayer
572be6911a Removed trailing whitespace in build-script and build-script-impl, preparing them for upcoming changes. 2017-09-01 13:50:28 -07:00
Michael Gottesman
6a6efd9f4e Merge pull request #11463 from KingOfBrian/documentation/DeveloperOnboarding
Update README.md
2017-08-21 14:00:33 -07:00
Ewa Matejska
fcc515b8f0 Bump default version in buid script 2017-08-18 15:41:06 -07:00
Brian King
a5b85f67db Improve language around presets 2017-08-17 20:41:31 -04:00
Brian King
4a4d7d0a49 Remove comment about arguments after 2017-08-15 08:37:51 -04:00
Brian King
584640edfa Move advanced usage note about into the build script help. 2017-08-14 19:20:22 -04:00
Mishal Shah
f389ce3c2e [lit] Enable testing for iOS 32-bit simulator by default 2017-08-02 20:51:51 -07:00
Sean Callanan
84e76bfb1e [build-script] Build the Mips target, which LLDB supports and tests. 2017-08-02 16:53:35 -07:00
swift-ci
475d8e027f Merge remote-tracking branch 'origin/master' into master-next 2017-06-28 21:49:20 -07:00
Dave Abrahams
9b18c4f1e3 No backtrace when Ctrl-C interrupts build-script 2017-06-28 21:11:21 -07:00
Greg Parker
7b009eccde Merge remote-tracking branch 'origin/master' into master-next 2017-06-28 15:25:17 -07:00
Mishal Shah
4d35bd2ca0 Skip iOS 32bit simulator tests by default 2017-06-28 00:27:22 -07:00
Mishal Shah
6d2487d6d1 Add support to skip 32bit iOS simulator tests 2017-06-28 00:18:09 -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
swift-ci
a7fc8ac913 Merge remote-tracking branch 'origin/master' into master-next 2017-04-28 14:08:31 -07:00
Ted Kremenek
7c664d1835 Bump default version in build script. 2017-04-19 13:02:09 -07:00
swift-ci
bed8336b4e Merge remote-tracking branch 'origin/master' into master-next 2017-04-05 09:48:31 -07:00
Hugh Bellamy
36645a0976 Address FIXMES for cleaning up imports in build-script and friends 2017-04-01 09:54:01 +07:00
swift-ci
b5f58e7763 Merge remote-tracking branch 'origin/master' into master-next 2017-03-30 15:08:31 -07:00
Michael Gottesman
e3858d304c [build-script] Use the build-script-impl from the swift repo that invoked build-script.
In the past if one wanted to be able to develop using multiple swift repos, one
was often stymied by build-script always using build-script-impl from the swift
directory. This includes the case where one invokes the build-script from a
hypothetical directory called swift-2.
2017-03-30 14:32:54 -07:00
swift-ci
bf5fae93d1 Merge remote-tracking branch 'origin/master' into master-next 2017-03-29 18:28:30 -07:00
Bob Wilson
d23be6e3de [build-script] Set the TOOLCHAINS variable in the environment.
On Darwin platforms, the Swift build scripts generally use "xcrun" to
locate various tools, and the build-script's darwin-xcrun-toolchain option
is specified to xcrun. However, with the change to use the just-built clang
to build the runtime (PR #6112), there was an issue with the linker. Clang
normally tries to run the linker from the same directory as the clang
binary, but when there isn't one, it falls back on /usr/bin/ld, which is
just an xcrun-like wrapper. Since there is no way to specify an explicit
toolchain option in that case, set TOOLCHAINS in the environment to
make it use the linker from the specified toolchain.
rdar://problem/30709330
2017-03-29 17:29:16 -07:00
swift-ci
4ed594bf88 Merge remote-tracking branch 'origin/master' into master-next 2017-03-26 20:28:53 -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
swift-ci
101f3448b3 Merge remote-tracking branch 'origin/master' into master-next 2017-03-22 20:28:43 -07:00