Commit Graph

285 Commits

Author SHA1 Message Date
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
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