Commit Graph

525 Commits

Author SHA1 Message Date
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
Rintaro Ishizaki
552590eee6 [build-script] Introduce -n, --dry-run feature
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
2016-05-31 12:45:05 +09:00
Dmitri Gribenko
d54bb62e94 Merge pull request #2497 from karwa/refactored-build-script
Refactored build-script-impl for cross-compiling support
2016-05-30 14:22:55 -07:00
Dmitri Gribenko
de26657ca7 Merge pull request #2773 from rintaro/build-script-args-type
[build-script] Modularize argparse types
2016-05-30 13:42:34 -07:00
SpringsUp
0b6790ced2 SDK Autodetection now happens in build script
The old 'swift-sdks' option is migrated for presets
2016-05-30 09:04:10 +02:00
SpringsUp
9d822cda8a Refactored built-script-impl:
- 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
2016-05-30 08:58:16 +02:00
Dmitri Gribenko
34aae893ef Merge pull request #2771 from rintaro/build-script-usage
[build-script] Simplify usage message of build-script
2016-05-29 22:29:43 -07:00
Rintaro Ishizaki
4ebfc085d3 [build-script] Modularize argparse types 2016-05-30 13:42:09 +09:00
Rintaro Ishizaki
4ae3d34e13 [build-script] Simplify usage message of build-script
usage:
  build-script [-h | --help] [OPTION ...]
  build-script --preset=NAME [SUBSTITUTION ...]
2016-05-26 22:31:43 +09:00
Rintaro Ishizaki
fe0dd085bf [build-script] Set umask
As build-script-impl.
2016-05-26 22:15:17 +09:00
Rintaro Ishizaki
36898fc933 [build-script][SR-237] Migrate Ninja build to Python
Migrated impl args:
--build-ninja
--darwin-deployment-version-{osx,ios,tvos,watchos}

Removed impl args:
--build-ninja

Added impl args:
--ninja-bin
2016-05-26 10:29:53 +09:00
rintaro ishizaki
b1109c6344 [build-script] Provide centralized command line and file system interface for build-script. 2016-05-26 10:29:53 +09:00
Dmitri Gribenko
690d98a078 Merge pull request #2635 from practicalswift/typo-fixes-20160521
[gardening] Fix recently introduced typos.
2016-05-21 21:56:00 -07:00
Dmitri Gribenko
439811b022 build-script: re-enable tvOS builds that were accidentally disabled by a build-script refactoring 2016-05-21 20:52:40 -07:00
Dmitri Gribenko
559829fadd Merge pull request #2562 from rintaro/build-script-tweak-args
[SR-237][build-script] Migrate --skip-{variant} --skip-build-{variant} arguments
2016-05-21 19:48:59 -07:00
practicalswift
ef4f925977 [gardening] Fix recently introduced typos. 2016-05-21 13:02:00 +02:00
rintaro ishizaki
00617f92dd [build-script] Factor out calculation of args.build_subdir
To make it testable.

Also, introduced Workspace object as a ground work for merging
build-script-impl into build-script.
2016-05-19 14:59:31 +09:00
Rintaro Ishizaki
8d7a150ba1 [build-script][SR-237] Migrate --skip-{variant} --skip-build-{variant}
Eliminate some arguments tweaks from build-script-impl

Migreated:
  --skip-ios
  --skip-tvos
  --skip-watchos
  --skip-build-ios
  --skip-build-ios-device
  --skip-build-ios-simulator
  --skip-build-tvos
  --skip-build-tvos-device
  --skip-build-tvos-simulator
  --skip-build-watchos
  --skip-build-watchos-device
  --skip-build-watchos-simulator
  --skip-build-android

Removed from impl:
  // These args were merely shorthands for:
  //   --skip-build-{variant}-{device,simulator}
  //   --skip-test-{variant}-{host,simulator}
  --skip-ios
  --skip-tvos
  --skip-watchos
  --skip-build-ios
  --skip-build-tvos
  --skip-build-watchos
2016-05-16 10:22:22 +09:00
Rintaro Ishizaki
2988223805 [build-script] Canonicalize argument processing
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`
2016-05-16 10:22:22 +09:00
swift-ci
354f6ea842 Merge pull request #2352 from rintaro/build-script-refactor-toolchain 2016-05-15 18:15:57 -07:00
rintaro ishizaki
966bbcce0d [build-script] Simpified code 2016-05-16 01:07:38 +09:00
Jordan Rose
5043bb6516 build-script: Make it easier to one-off modify a preset invocation.
...by putting the command it "expands to" on its own line, with empty
lines before and after, for easier copy/pasting.

No behavioral change.
2016-05-12 14:13:15 -07:00
Dmitri Gribenko
01f5c118ba Merge pull request #2365 from rintaro/build-script-long-test-swiftonly
[build-script] Don't run other products tests in "only_long" mode.
2016-05-08 22:06:36 -07:00
practicalswift
343cf6e876 [gardening] Fix recently introduced PEP-8 violation. (#2439) 2016-05-06 23:32:28 -07:00
Bouke Haarsma
269bd1dc2c [SwiftPM] Build with foundation 2016-05-05 22:28:05 +02:00
Mishal Shah
9722b4da3a [build-script] Fix --verbose-build argument to use bool type 2016-05-02 17:22:40 -07:00
Rintaro Ishizaki
b3dc7b74e2 [build-script] Refactor toolchain
`host_toolchain()` initializes Toolchain object corresponding to the platform.

Renamed functions:

* toolchain.host_clang -> toolchain.cc, toolchain.cxx
* cmake.host_cmake -> toolchain.cmake
* ninja.is_ninja_installed -> toolchain.ninja (is not None)
2016-05-03 01:47:12 +09:00
Rintaro Ishizaki
6fd6675296 [build-script] Don't run other products tests in "only_long" mode.
`build-script --long-test` (without -t or -T) should not run tests
other than long tests. Currently, only "swift" has long tests.
2016-05-02 15:06:31 +09:00
practicalswift
6cf5f9d255 [gardening] PEP-8 fixes. 2016-05-01 13:18:30 +02:00
Rintaro Ishizaki
d0cbe06b71 [build-script] Validate and parse '--clang-compiler-version' in argparse 2016-04-29 14:54:13 +09:00
Rintaro Ishizaki
4926ed55f1 [build-script][SR-237] Migrated calculation of BUILD_ARGS to Python.
Calculate `BUILD_ARGS` in `build-script`, then pass them to
`build-script-impl` using existing `--build-args` argument.
2016-04-25 16:20:40 +09:00
Rintaro Ishizaki
c025590c88 [build-script][SR-237] Migrated calculation of COMMON_CMAKE_OPTIONS to Python.
Calculate `COMMON_CMAKE_OPTIONS` in `build-script`, then pass them to
`build-script-impl` using newly introduced `--common-cmake-option` argument.
2016-04-25 14:27:29 +09:00
Rintaro Ishizaki
fda99d16ef [build-script] Fixed --extra-cmake-options
- Get it to work as `build-script` arguments.
- Fixed quoting problem
- Replaced --user-config-args: Error for --user-config-args.
- Moved to the position where it can override any options
2016-04-24 22:14:25 +09:00
swift-ci
00a5e1feca Merge pull request #2257 from rintaro/build-script-migration-simple 2016-04-24 05:34:53 -07:00
Dmitri Gribenko
d2c4a4dbd6 build-script: improve '--help' output
Before:
  [--long-test [LONG_TEST]]

After:
  [--long-test [BOOL]]
2016-04-22 18:09:50 -07:00
Dmitri Gribenko
3e15ccf260 Merge pull request #2258 from rintaro/build-script-argparse_bool
[build-script] Allow combining '-o' with other options.
2016-04-21 09:03:02 -07:00
rintaro ishizaki
3dac5e6f42 [build-script] Simplify arguments migration process.
Before, we have to explicitly specify migrated args:

  migrate_impl_args(argv, [... migrated arg list ...])

This change makes all *unknown* arguments to be automatically forwarded to
'build-script-impl'.
2016-04-21 22:46:05 +09:00
rintaro ishizaki
a8ee8c33ec [build-script] Check build-script-impl arguments before processing in 'build-script'. 2016-04-21 22:45:43 +09:00
rintaro ishizaki
e331bb1c28 [build-script] Applied a22d8569 fix to -o, --test-optimized
Also, moved to run_tests_group group.
2016-04-21 13:29:14 +09:00
Brian Gesiak
a7e2329444 [android] Support latest Android NDK r11c
- Update the documentation to reflect that Swift supports (only)
  the latest NDK version. Based on what I've heard from Android
  developers that use the NDK, this is a reasonable requirement.
- The most recent version of the Android NDK no longer includes a
  "4.8" toolchain version. Change the default to "4.9", and update
  the paths in the documentation to match.
- The build script option "--android-ndk-version" was misleading.
  This parameter actually refers to the Android API level. Swift
  currently supports 21 (Android 5.0) and above (although supporting
  lower API levels would be desirable).
2016-04-20 11:20:29 -04:00
practicalswift
092007bf12 [gardening] Fix recently introduced typos. 2016-04-19 21:48:05 +02:00
practicalswift
2c25cbb0fd [gardening] Fix PEP 8 violation. 2016-04-19 21:48:03 +02:00
Dmitri Gribenko
a22d8569d4 build-script: allow combining '-t' and '-T' with other options again
This fixes a regression from PR #2213.

We needed a way to disable testing in a preset, even though previous
flags already requested tests.  So I added an argument to the '--test'
and '--validation-test' flags.  The argparse module treats '-T' and
'--validation-test' the same, so it thinks that in -RTi the 'i' is an
argument to '-T'.
2016-04-19 09:36:33 -07:00
Dmitri Gribenko
457f2b901c CMake & build-script: add a new tier of testing, "long tests"
* The behavior of `build-script -t` is unchanged.

* `build-script -T` continues to run primary and validation test suite,
  but without the long tests.

* `build-script --long-test` runs just the long tests.

* `build-script -T --long-test` runs all tests.
2016-04-16 14:03:54 -07:00
Rintaro Ishizaki
54f4104951 [build-script] Use String literal concatenation instead of longstring literal.
Omit importing textwrap  that isn't used anymore.
2016-04-16 10:28:35 +09:00
Jordan Rose
a178d0faa2 [build-script] Prevent sleeping while building.
I've only implemented this for OS X, which comes with the
'caffeinate' command. If anyone would like to implement
something similar for Linux, feel free. (Although please
make sure that it's signal-safe, i.e. if the build is
interrupted the computer's sleep settings return to normal.)
2016-04-15 18:06:24 -07:00
Brian Gesiak
97a04a0023 [build-script] Fix redundant Android args
The same set of Android build-script-impl args are set twice,
most likely due to a bad rebase.
2016-04-14 22:42:54 -04:00