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.
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.
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.
We need to decide if we want to support these configurations, and in the
meantime it's better for us to disable them while we stabilize on the
other platforms. Fixes the currently broken build on 14.04.
Now we build libcxx if and only if --libcxx is passed, like with other
optional products. This loses the intended "build if sources are
checked out" behaviour, but behaves more predictably.
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.
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.
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.
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).
* 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
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.
* 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.
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>.
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
* 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.
* 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.
* Updated the argument-parsing test suite to use a more declarative set of Option classes and included a new test for exhaustiveness which should assure that we are always testing every possible option available in the parser.
* Added a new test to check that all the expected options have default values.
* Converted default values to use the defaults module where appropriate to make the test suite more portable since the original hard-coded values were gathered from my development machine.
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
* 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.
* 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.