Commit Graph

183 Commits

Author SHA1 Message Date
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
practicalswift
8df3859ce7 [gardening] Fix recently introduced typos. 2016-06-05 11:11:44 +02:00
Dmitri Gribenko
4577de4bed Merge pull request #2884 from rintaro/build-script-args-concat
[build-script] Introduce "concat" argument action
2016-06-04 18:02:08 -07:00
practicalswift
ab807c682f [gardening] PEP-8 fixes. 2016-06-04 22:39:30 +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
practicalswift
ccdea7c7c7 [gardening] Fix "a" vs. "an" issues. 2016-06-04 09:21:08 +02:00
Dmitri Gribenko
07d0a62faf Merge pull request #2877 from apple/build-script-allow-non-zero-xcodebuild-sdk-version
build-script: allow non-zero exit codes from 'xcodebuild -version -sdk'
2016-06-03 18:02:59 -07:00
Dmitri Gribenko
c55e89f55a build-script: allow non-zero exit codes from 'xcodebuild -version -sdk'
Under certain obscure circumstances (incomplete SDKs), xcodebuild can
successfully work with the SDK and print its version number, but will
still exit with a non-zero code.  This change works around the issue by
ignoring the exit code.
2016-06-03 15:50:06 -07:00
practicalswift
57bccc8b06 [gardening] Fix inconsistent formatting. 2016-06-04 00:37:15 +02:00
rintaro ishizaki
3384d2d933 [build-script] Make --show-sdks fail if calling xcodebuild failed 2016-06-03 16:14:14 +09:00
rintaro ishizaki
308160a4d4 [build-script] Consistent use of shell.capture in swift_build_support
Eliminate direct `import subprocess`.
2016-06-03 12:09:54 +09: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
e8b121b6a6 [util] Add swift_build_support.shell.capture.
- This is an analog to `call`, which returns the captured output of the
   command.
2016-06-01 22:57:42 -07:00
Daniel Dunbar
87a17001cc [utils] Switch some random scripts to shell.call. 2016-06-01 22:35:16 -07:00
Daniel Dunbar
0c74a9d14b [utils] Add swift_build_support.shell option to control command printing.
- This also uses the option in update-checkout to restores the previous, less
   verbose, output.
2016-06-01 22:21:23 -07:00
Daniel Dunbar
01a1559895 [utils] Improve swift_build_support.shell failure messages.
- This improves the error messages when commands fail (or don't exist) to show
   a one-line summary of the issue instead of the Python backtrace, and matches
   what was being done by the matching function in `SwiftBuildSupport`.
2016-06-01 20:03:30 -07:00
Dmitri Gribenko
24885e461c Merge pull request #2830 from ddunbar/introduce-swift_build_support-diagnostics-module
[utils] Introduce swift_build_support.diagnostics.
2016-06-01 18:30:37 -07:00
Daniel Dunbar
daba6275ae [utils/swift_build_suport] Tidy up import order. 2016-06-01 16:40:27 -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
e74ebd5839 [build-script] Flush immediately after print() in Python 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
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
Rintaro Ishizaki
76951281ba [build-script] Use more strict regex for --clang-compiler-version argument 2016-05-30 13:51:28 +09:00
Rintaro Ishizaki
90ed14d53c [build-script] Ensure executable is file, not directory 2016-05-30 13:42:13 +09:00
Rintaro Ishizaki
4ebfc085d3 [build-script] Modularize argparse types 2016-05-30 13:42:09 +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
Bryan Chan
85fde8b1fb Add support for Linux s390x. LLVM's Swift calling convention support is used to ensure correct operations of C++ code in the runtime. This patch also includes some (incomplete) changes to enum handling to make enums work in most common cases. 2016-05-24 20:03:28 -04:00
practicalswift
ef4f925977 [gardening] Fix recently introduced typos. 2016-05-21 13:02:00 +02:00
practicalswift
ac15a59d7d Fix various PEP-8 violations. 2016-05-21 10:43:36 +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
swift-ci
354f6ea842 Merge pull request #2352 from rintaro/build-script-refactor-toolchain 2016-05-15 18:15:57 -07:00
rintaro ishizaki
bcbdc56fe9 [build-script][gardening] whitespace fix 2016-05-16 08:18:38 +09:00
rintaro ishizaki
966bbcce0d [build-script] Simpified code 2016-05-16 01:07:38 +09:00
Anton Blanchard
0b8371d937 Fix stdlib deployment targets for powerpc64 and powerpc64le
We use powerpc64 and powerpc64le for the target names, not ppc64 and
ppc64le.
2016-05-10 04:29:54 +00:00
Rintaro Ishizaki
4dfeabc553 [gardening] Fix a flake8 warning (#2383)
F401 'which' imported but unused
2016-05-04 23:25:28 -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
d41fa7b992 [build-script] Introduced cached method/function decorator
cache_util.cached: cached function/method result associated with arguments.
cache_util.reifry: replace attribute with the result of the method.
2016-05-03 01:19:18 +09:00
Dave Abrahams
10bddb428a [build-script] Fix uses of build_support.which
This might not be the most principled way to do it (not too familiar
with this idiom of nested python modules named the same as their only
components), but it seems to have worked.
2016-05-01 14:00:23 -07:00
practicalswift
4613b1712b Merge pull request #2359 from practicalswift/typo-fixes-20160501
[gardening] Fix recently introduced typos: "adavances" → "advances", etc. (10 typos)
2016-05-01 20:11:45 +02:00
practicalswift
540cb751ac [gardening] Fix recently introduced typo: "adavances" → "advances"
[gardening] Fix recently introduced typo: "compie" → "compile"

[gardening] Fix recently introduced typo: "consise" → "concise"

[gardening] Fix recently introduced typo: "dengerate" → "degenerate"

[gardening] Fix recently introduced typo: "encodeded" → "encoded"

[gardening] Fix recently introduced typo: "equvalent" → "equivalent"

[gardening] Fix recently introduced typo: "guaranted" → "guaranteed"

[gardening] Fix recently introduced typo: "overridde" → "override"

[gardening] Fix recently introduced typo: "subsquence" → "subsequence"

[gardening] Fix recently introduced typo: "substraction" → "subtraction"

[gardening] Fix recently introduced typo: "whiltespace" → "whitespace"
2016-05-01 20:07:18 +02:00
practicalswift
6cf5f9d255 [gardening] PEP-8 fixes. 2016-05-01 13:18:30 +02:00
swift-ci
912017e4fc Merge pull request #2295 from rintaro/build-script-common-cmake-options 2016-04-29 05:03:07 -07:00
Rintaro Ishizaki
d0cbe06b71 [build-script] Validate and parse '--clang-compiler-version' in argparse 2016-04-29 14:54:13 +09:00
Drew Crawford
1300289283 [build-script-migrator] fix TypeError
When running build-script, I get the output below:

    utils/build-script --preset=drew --preset-file=../presets.ini  --preset-file=utils/build-presets.ini installable_package="`pwd`/../osx-caffeinated-$tag.tar.gz" install_destdir="`pwd`/../install" install_symroot="`pwd`/../install_symroot" symbols_package="`pwd`/../osx-caffeinated-symbols-$tag.tar.gz" darwin_toolchain_bundle_identifier="net.caffei.swift.$tag"  darwin_toolchain_display_name="caffeinated-$tag" install_toolchain_dir="/Library/Developer/Toolchains/caffeinated-$tag.xctoolchain"  darwin_toolchain_xctoolchain_name="caffeinated-$tag.xctoolchain" darwin_toolchain_version="caffeinated-$tag" darwin_toolchain_alias="caffeinated-$tag" darwin_toolchain_display_name_short="caffeinated-$tag"
    utils/build-script: using preset 'drew', which expands to utils/build-script --ios --tvos --watchos --lldb --llbuild --swiftpm --release-debuginfo --build-subdir=buildbot_osx --ios --tvos --watchos --test --validation-test --long-test --assertions --no-swift-stdlib-assertions -- --lldb-no-debugserver --lldb-use-system-debugserver --lldb-build-type=Release --verbose-build --build-ninja --build-swift-static-stdlib --build-swift-stdlib-unittest-extra --compiler-vendor=apple '--swift-sdks=OSX;IOS;IOS_SIMULATOR;TVOS;TVOS_SIMULATOR;WATCHOS;WATCHOS_SIMULATOR' --install-swift --install-lldb --install-llbuild --install-swiftpm --install-destdir=/Users/drew/Code/swift-osx/swift/../install --darwin-install-extract-symbols --install-symroot=/Users/drew/Code/swift-osx/swift/../install_symroot --install-prefix=/Library/Developer/Toolchains/caffeinated-swift-DEVELOPMENT-SNAPSHOT-2016-04-25-a.xctoolchain/usr --test-installable-package --reconfigure --installable-package=/Users/drew/Code/swift-osx/swift/../osx-caffeinated-swift-DEVELOPMENT-SNAPSHOT-2016-04-25-a.tar.gz --swift-enable-ast-verifier=0 '--swift-install-components=compiler;clang-builtin-headers;stdlib;sdk-overlay;license;sourcekit-xpc-service' '--llvm-install-components=libclang;libclang-headers' --installable-package=/Users/drew/Code/swift-osx/swift/../osx-caffeinated-swift-DEVELOPMENT-SNAPSHOT-2016-04-25-a.tar.gz --symbols-package=/Users/drew/Code/swift-osx/swift/../osx-caffeinated-symbols-swift-DEVELOPMENT-SNAPSHOT-2016-04-25-a.tar.gz --darwin-toolchain-bundle-identifier=net.caffei.swift.swift-DEVELOPMENT-SNAPSHOT-2016-04-25-a --darwin-toolchain-display-name=caffeinated-swift-DEVELOPMENT-SNAPSHOT-2016-04-25-a --darwin-toolchain-display-name-short=caffeinated-swift-DEVELOPMENT-SNAPSHOT-2016-04-25-a --darwin-toolchain-name=caffeinated-swift-DEVELOPMENT-SNAPSHOT-2016-04-25-a.xctoolchain --darwin-toolchain-version=caffeinated-swift-DEVELOPMENT-SNAPSHOT-2016-04-25-a --darwin-toolchain-alias=caffeinated-swift-DEVELOPMENT-SNAPSHOT-2016-04-25-a --skip-test-ios --skip-test-tvos --skip-test-watchos
    Traceback (most recent call last):
      File "utils/build-script", line 1339, in <module>
        sys.exit(main())
      File "utils/build-script", line 1335, in main
        return main_normal()
      File "utils/build-script", line 824, in main_normal
        args = migration.parse_args(parser, sys.argv[1:])
      File "utils/swift_build_support/swift_build_support/migration.py", line 34, in parse_args
        arg for arg in argv if arg != '--')
      File "/Library/Python/2.7/site-packages/argparse.py", line 1735, in parse_known_args
        namespace, args = self._parse_known_args(args, namespace)
      File "/Library/Python/2.7/site-packages/argparse.py", line 1941, in _parse_known_args
        start_index = consume_optional(start_index)
      File "/Library/Python/2.7/site-packages/argparse.py", line 1873, in consume_optional
        args = arg_strings[start:stop]
    TypeError: 'generator' object has no attribute '__getitem__'
    utils/build-script: command terminated with a non-zero exit status 1, aborting

This seems to be because the migrator script passes a generator where one was not expected.

Construct a list instead.
2016-04-26 02:02:03 -05: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