Commit Graph

521 Commits

Author SHA1 Message Date
Michael Gottesman
189a0938e7 [build-script] Add a small fixme. NFC.
Rather than having the cmake generator be decided by 3 different options that
can be potentially all set (which makes no sense), this should really just be an
option called cmake_generator that would default to ninja and would have choices
of xcode, eclipse, etc.
2016-08-03 14:17:41 -07:00
Michael Gottesman
7611e12bf5 [build-script] Add support for compiling swift with tsan enabled. 2016-08-01 15:11:09 -07:00
Michael Gottesman
07b463ba3e [gardening] Fix some python lint errors so this change is python lint clean. 2016-08-01 15:11:09 -07:00
David Grove
3663842b33 build-script: build variant support for libdispatch
Communicate build variant selection to libdispatch build process
using the --with-build-variant argument to libdispatch's configure
script added in libdispatch pull request #110.
2016-07-20 15:49:47 -04:00
Dmitri Gribenko
bd80cf920a build-script: remove deprecated options, 'build-swift-stdlib' and 'build-swift-sdk-overlay' 2016-07-16 13:32:58 -07:00
Dmitri Gribenko
6eb40a084b build-script: support 4 version components in Clang versions 2016-07-13 22:08:24 -07:00
Mishal Shah
34867c55ff Add support for swift-xcode-playground-support project 2016-07-06 16:59:17 -07:00
Michael Gottesman
7aaa56519f [build-script] On buildbots, pass in the -v command into lit instead of -sv.
This enables you to know what tests actually ran instead of just the number of
tests that ran. This helps identify:

1. Tests that are not running, but /should/ be running.
2. Tests that are XFAILED or DISABLED but should not be.
2016-07-06 16:27:18 -07:00
Jamal Rogers
f7a838db3d Build-script: propagate the build type to the xctest build script 2016-06-26 12:51:43 -05:00
Brian Gesiak
48e04b4a6f Merge pull request #3027 from modocache/sr-1738-build-only-static
[SR-1738] Allow *only* static libraries to be built
2016-06-24 14:55:50 -04:00
Brian Gesiak
e00642fcf5 Merge pull request #3194 from modocache/android-deploy-path-default
[Android] Specify default device deploy path
2016-06-24 13:33:40 -04:00
Brian Gesiak
f12a1323ce [SR-1738] Allow *only* static libraries to be built
This splits the `--build-swift-stdlib` and `--build-swift-sdk-overlay`
arguments into `dynamic` and `static` variants, which makes the
following build command possible:

```
utils/build-script -- \
  --build-swift-dynamic-stdlib=0 --build-swift-dynamic-sdk-overlay=0 \
  --build-swift-static-stdlib=1 --build-swift-static-sdk-overlay=0
```

This command produces *only* static libraries for the stdlib, and no
SDK overlay libraries at all. Many other finely-grained build options
are now possible.
2016-06-24 09:18:24 -07:00
Brian Gesiak
6c053decd5 [Android] Specify default device deploy path
When the "--android-deploy-device-path" option was first added,
build products would only be deployed to a connected Android device
if the option was specified. Now, we use `command_upload_stdlib`
to upload every time the Android tests are being run.

As a result, running the test suite for Android without specifying
a deploy path leads to a subtle error, in which the
`command_upload_stdlib` CMake command fails. End users may find this
difficult to debug.

Add a default argument to the deployment path, and check for a valid
path before executing the CMake command.
2016-06-24 08:53:07 -07:00
Daniel Dunbar
cc69924839 [build-script] Support concatenated stdlib-deployment-targets.
- This fixes a regression introduced in
   a4537e8a0f, where we used to accept a list of
   concatenated deployment targets as a single argument.

 - <rdar://problem/26928189> build-script fails to split deployment targets
   before iterating over them
2016-06-23 13:59:56 -07:00
Daniel Dunbar
b169cb55e6 Merge pull request #2988 from ddunbar/build-script-isolated-actions
[build-script] Add support for using isolated -impl actions.
2016-06-23 09:00:41 -07:00
Michael Gottesman
bafbbfcc13 [build-script] Add an option --expand-build-script-invocation.
This option dumps the expanded build-script invocation for a preset without
running the preset. Useful for debugging build-script preset invocations.
2016-06-21 18:51:42 -07:00
Braedy
4036c1e07e Change intersect to intersection
Python's builtin set uses intersection not intersect.
2016-06-21 11:42:04 -04:00
Mishal Shah
b98fbf491d Revert optional_bool action from short-name options 2016-06-16 13:25:30 -07:00
Mishal Shah
e4341ab990 [build-script] Add optional_bool action and update build-script to use it 2016-06-15 11:44:21 -07:00
swift-ci
a1f1976465 Merge pull request #1714 from SwiftAndroid/tests 2016-06-13 21:20:28 -07:00
Daniel Dunbar
b1d56ea216 [build-script] Add support for using isolated -impl actions.
- This change moves the top-level invocation driver loop into `build-script`
   and uses the `-impl` script to perform each individual action. Once landed
   and enabled, this will enable us to migrate the individual pieces of the
   `-impl` script into Python code in an incremental fashion.

 - This also introduces stub product definitions for each of the different projects
   we manage.

 - This works, but is disabled by default (`--no-legacy-impl`) because it
   severely impacts the performance of null builds (4x slower, currently) due to
   the `build-script-impl` parsing overhead. If only we had a JITing bash
   implementation...
2016-06-13 12:24:49 -07:00
Dmitri Gribenko
593d8507a2 Merge pull request #2961 from karwa/validation-defaults
[build-script] Perform validation after defaults propagation
2016-06-11 02:35:55 -07:00
Michael Gottesman
95d926abb0 [lto] Only build host libraries using LTO.
At some point in the future, we may consider using LTO on the runtime/standard
library, but right now is not that time. We are just trying to use LTO to
improve the compile time performance of the compiler itself.

rdar://24717107
2016-06-10 13:33:54 -07:00
SpringsUp
02ad66db3c [build-script] Infer --android platform flag by presence of a stdlib-target 2016-06-10 08:35:21 +02:00
SpringsUp
652062a2ec [build-script] Perform validation after defaults propagation 2016-06-10 08:04:54 +02:00
Brian Gesiak
ee51b7a6f6 [Android] Add testing support
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.
2016-06-09 13:03:28 -04:00
Brian Gesiak
344d6e264e [build-script] Fix Python error for Android
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.
2016-06-09 12:48:06 -04:00
Dmitri Gribenko
af9932b732 build-script: don't disable iOS device tests based on the host variable
Running on-device tests is not supported for iOS, tvOS and watchOS.
2016-06-08 21:28:51 -07:00
Daniel Dunbar
d51507879a [build-script] Several PEP8 fixes. 2016-06-08 17:23:27 -07:00
Daniel Dunbar
bb9fc675c7 [build-script] Switch over to computing targets in build-script.
- 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.
2016-06-08 17:23:00 -07:00
Daniel Dunbar
6df6ae707a [build-script] Add a couple more options at the build-script layer. 2016-06-08 17:23:00 -07:00
Daniel Dunbar
bf75c8f50a [build-script] Create explicit Platform and Target types.
- This is so that we can have a place to attach the additional metadata we need
   on platform or target specific behaviors.
2016-06-08 17:23:00 -07:00
Daniel Dunbar
ca2d64a52c [build-script] Add infrastructure for passing host-specific variables.
- 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.
2016-06-08 17:23:00 -07:00
Daniel Dunbar
c03943ca23 [build-script] Lift --cross-compile-hosts to build-script level. 2016-06-08 17:22:24 -07:00
Daniel Dunbar
754521bb9c [build-script] Factor out helper for validating the args. 2016-06-08 08:52:59 -07:00
Daniel Dunbar
893d353eb1 [build-script] Factor out logic for computing the impl arg list. 2016-06-08 08:47:34 -07:00
Daniel Dunbar
6d928dc9b4 [build-script] Factor out logic for applying argument defaults. 2016-06-08 08:37:18 -07:00
Daniel Dunbar
0cdad67e36 [build-script] Factor out an Invocation helper object.
- 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.
2016-06-08 08:37:18 -07:00
Michael Gottesman
2e7d88e5b0 [build-script][lto] Migrate the num_*_parallel_lto_link_jobs code from build-script-impl into build support.
rdar://24717107
2016-06-07 20:59:13 -06:00
Michael Gottesman
a5d817257a [build-script-impl] Rename swift-enable-lto => swift-tools-enable-lto
This makes it clear to the user that they are enabling lto only for swift tools,
not for the swift standard library/runtime.

rdar://24717107
2016-06-07 19:03:03 -07:00
Michael Gottesman
87a0ad1fd6 [build-script] Add an option to build-script called --lto that unifies the triggering of ltoing llvm/swift tools.
Also change the relevant build-presets to use this flag instead of touching
build-script-impl directly.

rdar://24717107
2016-06-07 19:03:03 -07:00
practicalswift
8df3859ce7 [gardening] Fix recently introduced typos. 2016-06-05 11:11:44 +02:00
rintaro ishizaki
0d6e1b1154 [build-script] Introduce "concat" argument action
Get rid of unnecessary list of list argument.
2016-06-05 00:53:05 +09:00
Daniel Dunbar
1a694dc86c [build-script-impl] Add support for performing isolated actions.
- 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.
2016-06-03 08:42:21 -07:00
Daniel Dunbar
bb81448152 [utils] Rename print_command argument.
- Based on review feedback in PR#2836.
2016-06-02 08:53:48 -07:00
Daniel Dunbar
76a39000b4 Merge pull request #2836 from ddunbar/eliminate-SwiftBuildSupport-subprocess-functions
[build-script] Eliminate swift build support subprocess functions
2016-06-02 08:35:37 -07:00
rintaro ishizaki
5959dd2aa1 [build-script] Reject user-supplied '--common-cmake-options' argument
build-script doesn't support manually supplied `--common-cmake-options`.

Introduced argparse action 'arguments.action.unavailable'
2016-06-02 16:17:44 +09:00
Daniel Dunbar
3d06deefe4 [utils] Inline caffeinate logic into sole client.
- This eliminates the last client of `SwiftBuildSupport.check_call`, which is
   now replaced by `swift_build_support.shell.call`.

 - Part of SR-237.
2016-06-01 22:43:37 -07:00
Daniel Dunbar
ad9f12d8ff [utils] Introduce swift_build_support.diagnostics.
- 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.
2016-06-01 16:28:42 -07:00
Daniel Dunbar
95e35130db [utils] Move quote_shell_command into swift_build_support. 2016-06-01 15:55:25 -07:00