Commit Graph

525 Commits

Author SHA1 Message Date
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
Harlan Haskins
bb8160a092 [coverage] Declared SWIFT_ANALYZE_CODE_COVERAGE in CMakeLists and documented options for build-script flag. 2016-01-28 10:35:39 -08:00
Harlan Haskins
9fccf5058a [coverage] Fixed conflicts with master 2016-01-28 10:05:38 -08:00
Harlan Haskins
1b30a49406 [coverage] Added license header to profdata_merge_worker and added explicit choices to --swift-analyze-code-coverage 2016-01-27 10:14:16 -08:00
Sergey Zolotarev
54d438ed84 Fix small typos in build-script help 2016-01-26 12:24:42 +06:00
Harlan Haskins
a41ec1a6f7 [coverage] Cleaned up argument parsing for swift coverage, and hooked into build-script to propagate the different values 2016-01-25 19:49:03 -08:00
Harlan Haskins
eb27ca1e2e [coverage] Initial commit of profdata merging worker 2016-01-25 19:49:03 -08: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
4fbc28c704 PEP8: Fix all violations of type "continuation line with same indent as next logical line" (E125) 2016-01-24 09:30:48 +01:00
practicalswift
1cd4d4e9c9 [gardening] Fix violations of non-controversial PEP8 rules
Fixes:
* multiple statements on one line (colon) (E701)
* missing whitespace around arithmetic operator (E226)
* missing whitespace around operator (E225)
* closing bracket does not match visual indentation (E124)
* blank line contains whitespace (W293)
* continuation line missing indentation or outdented (E122)
* continuation line over-indented for hanging indent (E126)
* missing expected blank line (E301)
* trailing whitespace (W291)
* unexpected spaces around keyword / parameter equals (E251)
* whitespace after '(', '[' or '{' (E201)
* whitespace before ')', ']' or '}' (E202)
* whitespace before ',' or ':' (E203)
2016-01-23 09:23:33 +01:00
David Grove
06860a4d01 Initial integration of libdispatch into build-script
Extend build-script, build-script-impl, and update-checkout
to include libdispatch.  For now, libdispatch is not
built by default (user must enable via command line
argument).

Integration of testing is functional, but should be improved
in a later pull request.  The basic autotools based test
harness does not give the nice high-level progress output
as the rest of the test suite.

A related pull request to libdispatch (#34) has some fixes
to the autotools build that are needed to enable the test
target to succeed when run in an external directory.
2016-01-21 19:22:45 +00:00