Commit Graph

397 Commits

Author SHA1 Message Date
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
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
practicalswift
79019d5b20 [gardening] Fix PEP 8 regression. 2016-04-13 10:17:25 +02:00
Zhuowei Zhang
7c502b6344 Port to Android
This adds an Android target for the stdlib. It is also the first
example of cross-compiling outside of Darwin.

Mailing list discussions:

1. https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151207/000171.html
2. https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151214/000492.html

The Android variant of Swift may be built using the following `build-script`
invocation:

```
$ utils/build-script \
  -R \                                           # Build in ReleaseAssert mode.
  --android \                                    # Build for Android.
  --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/
```

Android builds have the following dependencies, as can be seen in
the build script invocation:

1. An Android NDK of version 21 or greater, available to download
   here: http://developer.android.com/ndk/downloads/index.html.
2. A libicu compatible with android-armv7.
2016-04-12 19:26:21 -04:00
Argyrios Kyrtzidis
abecb2f6a9 [utils/build-script] Change '--extra-cmake-vars' to '--extra-cmake-options'.
This is more consistent with the rest of build-script for handling CMake options.
2016-04-12 09:53:45 -07:00
Argyrios Kyrtzidis
9ebc8a33f8 [utils/build-script] Introduce '--extra-cmake-vars' to allow setting any CMake veriables when configuring the targets. 2016-04-11 16:30:22 -07:00
Dmitri Gribenko
1af4f60150 Merge pull request #2102 from apple/ignore-deployment-target-variables
build-script: unset *_DEPLOYMENT_TARGET variables
2016-04-08 13:24:38 -07:00
Dmitri Gribenko
c1486f4528 build-script: unset *_DEPLOYMENT_TARGET variables
These variables interfere with cross-compiling of the standard library
and runtime.
2016-04-08 11:37:33 -07: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
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
practicalswift
292bbe9f37 [gardening] Fix PEP 8 regression. 2016-04-01 23:14:17 +02:00
Nadav Rotem
78968ae1af Add a flag to disable building the swift runtime with the just-built compiler. 2016-03-31 17:14:43 -07:00
Harlan Haskins
af6f844ec9 [build_support] Added generic 'toolchain' lookup 2016-03-18 16:38:53 -07:00
Vedant Kumar
53f48f8d8b Hook compiler-rt up to the swift build system 2016-03-17 17:44:05 -07:00
Jordan Rose
c43943d7a8 [build-script] Remove -X option for "edit-only" Xcode projects.
This has caused plenty of confusion and should no longer be necessary anyway.
2016-03-16 09:28:52 -07:00
practicalswift
1edb62dc38 [Python] Make flake8 linting pass without errors/warning (w/ default rules) 2016-03-13 20:19:51 +01:00
practicalswift
d5326bfdc4 [Python] Replace global linting excludes with local line-level excludes ("noqa")
Replace the project global linting rule excludes (as defined in .pep8) with
fine-grained "# noqa" annotations.

By using noqa annotation the excludes are made on a per line basis instead of
globally.

These annotations are used where we make deliberate deviations from the standard
linting rules.

To lint the Python code in the project:

  $ flake8

To install flake8:

  $ pip install flake8

See https://flake8.readthedocs.org/en/latest/ for details.

To enable checking of the PEP-8 naming conventions, install the optional
extension pep8-naming:

  $ pip install pep8-naming

To enable checking of blind "except:" statements, install the optional
extension flake8-blind-except:

  $ pip install flake8-blind-except

To enable checking of import statement order, install the optional
extension flake8-import-order:

  $ pip install flake8-import-order
2016-03-10 16:22:48 +01:00
practicalswift
0796eaad1f [Python] Fix 80-column violations 2016-03-09 23:52:11 +01:00
Brian Gesiak
c9000af795 Merge pull request #1526 from practicalswift/fix-pep8-violations-ii
[Python] Fix five classes of PEP-8 violations (E101/E111/E128/E302/W191)
2016-03-08 23:55:46 -05:00
Brian Gesiak
792560fe5e [gardening][build-script] Fix XCTest comment typo 2016-03-08 13:16:10 -05:00
Brian Gesiak
b7973a99e5 Merge pull request #1556 from modocache/build-script-xctest-on-foundation
[build-script] Build Foundation before XCTest [AsyncXCTest 4/6]
2016-03-08 10:57:52 -05:00
practicalswift
265835fdfc [Python] Use consistent import ordering for Python code
Ordering used:
1.) standard library imports
2.) third party imports
3.) local package imports

Each group is individually alphabetized.
2016-03-07 23:25:16 +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
Brian Gesiak
453f8e6626 [build-script] Build Foundation before XCTest
https://github.com/apple/swift-corelibs-xctest/pull/43 introduces
a dependency between XCTest and Foundation. Modify the build script
in order to properly build all products:

- Build Foundation before XCTest, then link Foundation when building
  XCTest by using new '--foundation-build-dir' option.
- Link Foundation when testing SwiftPM by using new '--foundation'
  option.
- On Linux, ensure Foundation is built when XCTest is.
2016-03-06 01:12:15 -05:00
Brian Gesiak
03fd72f713 [SR-237] Move SKIP_TEST_* arguments to Python
- Migrate `SKIP_TEST_IOS`, `SKIP_TEST_TVOS`, and `SKIP_TEST_WATCHOS` to
  Python.
- In the `build-script-impl` shellscript, only deal with
  `SKIP_TEST_*_HOST` and `SKIP_TEST_*_SIMULATOR` variables.
- Introduce a `--host-test` flag to the Python `build-script` in order
  to allow users to specify whether to run host tests. These flags
  still don't do anything.
- Fix typo: `skip-build-tvos_device` was meant to be `skip-build-tvos-device`.
2016-02-29 19:19:33 -05:00
Mishal Shah
4cfccda0d7 [build-script] Fix missing install-symroot flag 2016-02-24 23:54:43 -08:00
Mishal Shah
839696e026 Revert "[build-script] Fix missing install-symroot flag"
This reverts commit 9e1c6c2d59.
2016-02-24 23:21:05 -08:00
Mishal Shah
9e1c6c2d59 [build-script] Fix missing install-symroot flag 2016-02-24 22:57:09 -08:00
Brian Gesiak
213d81dcbe [build-script] Skip option for non-Darwin stdlib tests
It's possible to cross-compile for iOS while skipping stdlib tests
on OS X:

```
$ utils/build-script --ios -- --skip-test-osx
```

The same is not possible on Linux. Add options to skip builds and
tests on non-Darwin platforms: Linux, FreeBSD, and Cygwin.
2016-02-23 23:48:51 -05:00