This adds support for running tests for the stdlib built
for Android, both on the host machine and on an Android device.
The Android variant of Swift may be built and tested using
the following `build-script` invocation:
```
$ utils/build-script \
-R \ # Build in ReleaseAssert mode.
-T \ # Run all tests.
--android \ # Build for Android.
--android-deploy-device-path /data/local/tmp \ # Temporary directory on the device where Android tests are run.
--android-ndk ~/android-ndk-r10e \ # Path to an Android NDK.
--android-ndk-version 21 \
--android-icu-uc ~/libicu-android/armeabi-v7a/libicuuc.so \
--android-icu-uc-include ~/libicu-android/armeabi-v7a/icu/source/common \
--android-icu-i18n ~/libicu-android/armeabi-v7a/libicui18n.so \
--android-icu-i18n-include ~/libicu-android/armeabi-v7a/icu/source/i18n/
```
See docs/Testing.rst for more details.
https://github.com/apple/swift/pull/2880 appends a `Target` instance
to an array of strings when building Android. This causes a syntax
error when building Android. Fix the error to repair the Android
build.
- Introduces a new `HostSpecificConfiguration` which holds the computed
information for each host we need to use.
- This relies on the functionality to pass host-specific variables to the
script via environment variables.
- The computation itself has been cleaned up a tiny bit (mostly via using
the factored out platform/target properties), but is otherwise a straight
port of the logic from `build-script-impl`.
- This commit does not yet remove that code from `build-script-impl`; instead
it validates that the two implementations are computing the same result.
This is useful right now for testing the validity of the port.
- This isn't yet used, but we need an easy way for `build-script` to
pass host-specific variables down to `build-script-impl`.
- I don't think it is worth complicating the main argument parsing
logic with a syntax for passing associative arrays on the command
line, so this just passes them via environment variables.
- Part of SR-237.
- This is an object designed to represent a single invocation of the build
script, primarily for use in decomposing the main program flow into its
distinct conceptual pieces.
- This adds a new argument `--only-execute <name>` which can be used by
`build-script` to invoke the `build-script-impl` to perform each different
action, while moving the high-level operation loop into the `build-script`
itself. This should make incremental refactoring of the individual actions
into `build-script` easier.
- This is part of SR-237.
- This uses more Clang/Swift-style diagnostics, and adds a convenient wrapper
`fatal()` which happens to match what almost all clients of the previous
`print_with_argv0` wanted to do (i.e., fail with a fatal error).
- As part of this, I also tried to make the diagnostics more consistent and use
"diagnostic style" casing/punctuation.
- Part of SR-237.
If -n or --dry-run is specified in command line arguments, print the commands
that would be executed to stdout, but do not execute them.
Supported in build-script and build-toolchain.
utils/build-script -n -Rt
utils/build-script -n --preset=buildbot_incremental,tools=RA,stdlib=RA
utils/build-toolchain -n local.swift
- Use consistent terminology for target platforms, disambiguate uses of
'deployment_target' in to 'host' and 'stdlib_targets'
- Changed parameters to build script:
- install-prefix no longer has to include toolchain-prefix on OSX
- swift-sdks has been replaced by stdlib-deployment-targets
- built-stdlib-deployment-targets lets you restrict which of the
stdlib-deployment targets are built
- Calculate stdlib_targets per host, to facilitate future cross-compiling
- Only use executables from LOCAL_HOST
- Only execute testable targets of the LOCAL_HOST
- Remove some cases of switching on 'uname' to facilitate future
cross-compiling
Strictly separate "argument tweak" and "build-script-lmpl args generation"
* tweak `args` - set default, propagate default
* (Do something in `build-script`)
* build `build_script_impl_args`