Commit Graph

28 Commits

Author SHA1 Message Date
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
David Zarzycki
dc22a4d54b [build-script] Track underlying CMake/lit changes 2018-03-21 06:47:37 -04:00
Michael Gottesman
e567bc9028 [+0-all-args] Enable +0 normal arguments.
rdar://34222540
2018-03-19 20:25:31 -07: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
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
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
6d2c465071 Fixed overzealous path expansion for the --build-subdir argument which caused all build directories to generate relative to the directory build-script was invoked from. (#13319) 2017-12-07 13:18:17 -08: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
0f1b6163f2 [build-script] Argument Builder DSL Conversion: Episode 2 (#13164)
* Converted the host and cross-compilation targets argument group to use the new builder DSL.

* Converted the projects argument group to use the new builder DSL.

* Converted the extra actions argument group to use the new builder DSL.

* Converted the build variant argument group to use the new builder DSL.

* Converted the build variant override argument group to use the new builder DSL.

* Converted the run tests argument group to use the new builder DSL.

* Converted the run build argument group to use the new builder DSL.

* Converted the skip test argument group to use the new builder DSL.

* Export missing ShellSplitType from the argparse.types module.
2017-12-05 13:34:57 -08:00
Ross Bayer
4274233420 [build-script] Argument Builder DSL Conversion: Episode 1 (#13117)
* Imported the new argparse overlay module and added the setup code for the DSL.

* Converted the CMake generator flags to use the new builder DSL.

* Converted the assertions argument group to use the new builder DSL.

* Converted the LLVM-specific settings argument group to use the new builder DSL.

* Converted the Android build settings argument group to use the new builder DSL.

* Removed unused action aliases from the builder DSL setup section to appease the flake8 gods.

* Fixed small typo in help message for --eclipse option.
2017-11-30 17:46:57 -08:00
Ross Bayer
de7a517f0d Reformat driver arguments (#12954)
* Moved top-level arguments into a single clump, rather than interlacing them with other argument groups.

* Re-formatted string literals to use single quotes rather than double in order to remain consistent in style throughout the build_swift module.

* Moved all argument help messages to the last kwarg position to remain consistent and more readable.

* Re-ordered arguments when adding a new option to always have the option strings first and then the action (if applicable).

* Re-arranged kwarg order when creating new parser options to remain consistent.

* Fixed the --enable-tsan-runtime option, which was modified recently.
2017-11-28 12:56:50 -08:00
Ross Bayer
85abdcd62d Argparse "Overlay" Module (#12873)
* Implemented a wrapper module around the standard argparse package, exposing the same interface with some extras on top, including a new builder type with expressive DSL for constructing complex argument parsers.

* Fixed imports in build_swift/argparse/__init__.py to make flake8 happy.

* More re-formmating to meet the exacting standards of the python_lint script.

* Added doc-strings to all the modules in the build_swift argparse overlay.

* Implemented a new BoolType for the argparse module which handles boolean-like values and replaces the hard-coded boolean values in the _ToggleAction class.

* Fixed the mess of imports in the tests sub-package to favor relative imports, so now the unit-tests will actually run as expected. The README has also been updated with a better command for executing the unit-test suite.

* Updated the add_positional method on the ArgumentParser builder class to only take a single action or default to the store action.

* Cleaned up the set_defaults method.

* Added validation test to run the build_swift unit-tests.

* Updated validation-test for the build_swift unit-test suite to use %utils.

* Fixed hard-coded default values in the expected_options module used for generating argument parser tests.

* Updated the comment in the Python validation test to run the build_swift unit-tests.
2017-11-27 21:49:44 -08:00
Ross Bayer
a6796e06a6 Changed the --enable-tsan-runtime option to use the enable action like the surrounding tsan options. (#13088) 2017-11-27 15:42:44 -08: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
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
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
9847f6a589 New defaults module for build_swift argument parser (#11911)
* Added a new defaults module for configurable constant values used by the argument parser to configure the default build behavior.

* Re-ordered imports in order to satisfy python linter.
2017-09-14 12:01:10 -07:00
Ross Bayer
6d1604496c Removed the offending duplicate ninja_build code that was masking the real logic for decided when to use the system ninja or to build it from source. (#11919) 2017-09-14 10:45:11 -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