Commit Graph

285 Commits

Author SHA1 Message Date
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
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
8012b1c4e2 [build-script] Migrate "SKIP_BUILD" to Python
Rather than determining which builds to skip 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
Luke Larson
0356ec8ec3 Add Swift Benchmark Suite 2016-02-08 10:47:58 -08:00
practicalswift
2c38e24e26 Fix minor PEP 8 regression (E261: at least two spaces before inline comment) 2016-02-03 21:53:48 +01:00
Harlan Haskins
96d426165d [coverage] Made some stylistic changes for CMake consistency 2016-02-01 11:51:47 -08:00
Harlan Haskins
0e6f798af5 [coverage] Made sure code coverage doesn't rename the ninja build directory if it's "false" 2016-01-28 16:44:41 -08:00
Harlan Haskins
7608f887a4 [coverage] Removed print in built script 2016-01-28 13:35:37 -08:00
Harlan Haskins
e997fc3ae3 [coverage] Changed 'none' to 'false' for coverage default 2016-01-28 11:23:59 -08:00