Commit Graph

193 Commits

Author SHA1 Message Date
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
practicalswift
17115d07ec [gardening] Fix recent PEP-8 violations. 2016-04-24 21:52:31 +02: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
Brian Gesiak
a4537e8a0f [SR-237] Move stdlib deployment targets to Python
Migrate the logic that determines which platforms to build the stdlib
for to Python. This is applies both as an effort to migrate more of the
build script to Python (https://bugs.swift.org/browse/SR-237), but also
as a means of splitting up the work necessary to cross-compile the Swift
stdlib from OS X to Linux.
2016-04-14 16:49:51 -04:00
Harlan
75de4fe083 [build_support] Fixed lingering python3 issue
Another use of iteritems -> explicit key/value
2016-04-11 11:04:07 -07:00
Harlan Haskins
94f6ffc807 [build_support] Fixed python 3 errors 2016-04-08 21:09:26 -07:00
practicalswift
a7f942f207 [Python] Remove unused code. 2016-04-08 22:16:15 +02:00
practicalswift
be78603272 Merge pull request #2100 from practicalswift/gardening-20160408
[gardening] Fix typos. Remove double spaces. Remove tabs in C++ code.
2016-04-08 21:26:37 +02:00
practicalswift
212aba51c6 [gardening] Fix recently introduced typos: "’" → "'", "represention" → "representation", "arcitectures" → "architectures", "refernce" → "reference", "incovation" → "invocation" 2016-04-08 21:22:25 +02:00
David Farler
945c2fb979 swift_build_support: Don't explicitly expect a set of SDKs
Not all machines may have all platforms' SDKs installed.

xcodebuild already has a command to print the versions of all
SDKs installed. For convenience, also provide a function that
returns the identifiers for all installed SDKs.

rdar://problem/25618455
2016-04-08 11:36:27 -07:00
Harlan
de4868a72f [buildsupport] Add empty suffix back to host_clang 2016-04-08 08:21:20 -07:00
Harlan
55f1bb1897 Merge pull request #1586 from harlanhaskins/generic-command-lookup
[build support] Generic prefixed binary lookup function in swift_build_support
2016-04-07 22:18:27 -07:00
Harlan Haskins
f4ba4d3c93 [build support] Fixed python lint warnings 2016-03-28 14:40:05 -07:00
Harlan Haskins
0aad53cf62 [build_support] Added some comments 2016-03-21 13:38:50 -07:00
Harlan Haskins
83535dd90d [build_support] Added test to ensure llvm_cov properly exists 2016-03-21 13:10:28 -07:00
Harlan Haskins
6804328f29 [build_support] Added test to find llvm-cov 2016-03-21 13:08:00 -07:00
Brian Gesiak
2e6e7d8ec0 [gardening][build-script] Fix typo XCRun -> xcrun 2016-03-19 17:29:03 -04:00
Harlan Haskins
af6f844ec9 [build_support] Added generic 'toolchain' lookup 2016-03-18 16:38:53 -07:00
practicalswift
0796eaad1f [Python] Fix 80-column violations 2016-03-09 23:52:11 +01:00
practicalswift
183da818df [Python] Fix five classes of PEP-8 violations (E101/E111/E128/E302/W191)
* E101: indentation contains mixed spaces and tabs
* E111: indentation is not a multiple of four
* E128: continuation line under-indented for visual indent
* E302: expected 2 blank lines, found 1
* W191: indentation contains tabs
2016-03-07 22:36:23 +01:00
Han Sangjin
e06c7136cb Porting to Cygwin. rebased and squashed 2016-02-22 13:20:21 +09:00
practicalswift
e395ea0f0e [Python] Follow standard Python docstrings conventions (PEP-0257).
https://www.python.org/dev/peps/pep-0257/
2016-02-20 17:11:57 +01:00
Brian Gesiak
120ec99be5 [build-script] Archive symbols in Python
Rather than archiving symbols at the very end of the build-script-impl
shellscript, do so at the end of the Python build-script. A small step towards
achieving SR-237.
2016-02-15 12:58:09 -05:00
Brian Gesiak
3821e6ef76 [build-script] Set TOOLCHAIN_PREFIX in Python
Rather than setting the path to the .xctoolchain in the build-script-impl
shellscript, do so in the Python build-script. A small step towards
achieving SR-237.
2016-02-15 10:48:46 -05:00
Brian Gesiak
d717f8f9d7 [build-script] Set INSTALL_PREFIX in Python
Rather than setting a default value for the INSTALL_PREFIX in the
build-script-impl shellscript, do so in the Python build-script. A small step
towards achieving SR-237.
2016-02-15 10:48:45 -05:00
Brian Gesiak
3b61ad3086 [build-script] Migrate "SHOW_SDKS" to Python
Rather than printing `xcodebuild` version information in the
build-script-impl shellscript, do so in the Python build-script. A small step
towards achieving SR-237.
2016-02-15 10:48:45 -05:00
Brian Gesiak
64b93aa582 [build-script] Determine BUILD_NINJA in Python
Rather than determining whether to build Ninja in the build-script-impl
shellscript, do so in the Python build-script. A small step towards achieving
SR-237.
2016-02-15 10:48:41 -05:00
Umberto Raimondi
c73b8d3ee7 Adding ARMv6 in swift_build_support
The ARMv6 platform is now recognised correctly by build-script without using --host-target.
2016-01-31 17:25:46 +01:00
Brian Gesiak
c1a746bc92 [build-script] There can only be one host target
`build-script-impl` currently maintains a list of
`NATIVE_TOOLS_DEPLOYMENT_TARGETS` -- host machine targets, for which
the resulting binaries can be run on the current machine.

However, there is only ever *one* host machine. This commit:

- Changes the `NATIVE_TOOLS_DEPLOYMENT_TARGETS` list parameter into a
  single string parameter, `HOST_TARGET`.
- Promotes the logic to detect the host target to Python, and places it
  in the `swift_build_support` module.
- Removes the hard-coded "macosx_x86_64" path to the LLVM and Clang
  TableGen -- thereby unblocking future work to make cross-compilation
  possible on platforms other than OS X.
- Also promotes cross-compilation target validation to Python, placing
  it in the `swift_build_support` module.
2016-01-24 11:48:09 -05:00
practicalswift
3aa2598254 [gardening] Remove unused enumerate(…) call 2016-01-22 23:38:55 +01:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Brian Gesiak
c65c91d61f [SR-237][build-script] Determine CMake in Python
SR-237 calls for `build-script` and `build-script-impl` to be merged. This
commit takes another step towards that goal by moving the logic that finds
the path to the CMake executable up into `build-script`.

Users of `build-script` were previously able to specify which CMake
they wished to use via `build-script-impl` args, like so:

```
$ utils/build-script -- --cmake=/foo/bar/cmake
```

This commit preserves that behavior, while also allowing users to
specify that path via `build-script` args:

```
$ utils/build-script --cmake=/baz/cmake -- --other --flags
```
2015-12-28 12:37:26 -05:00
Brian Gesiak
ca3e11b2d6 [build-script] Determine HOST_CC in build-script
https://bugs.swift.org/browse/SR-237 calls for `build-script` and
`build-script-impl` to be merged. This commit takes another step towards
that goal by moving the logic that finds the path to the `clang` and
`clang++` executables up into Python-land.

Rather than simply moving all of the logic into `utils/build-script`,
this commit moves relevant functions into a new Python module, named
`swift_build_support`. This has several benefits:

- The logic can be tested. Whereas `build-script-impl` needed to be run
  in order to verify its behavior, the logic extracted out of it into
  `swift_build_support` can be tested in isolation.
- The logic can be split up into several files without polluting the
  `utils` directory, which now contains many different files that are
  unrelated to `build-script`.
2015-12-27 02:35:32 -05:00