Commit Graph

592 Commits

Author SHA1 Message Date
Jamal Rogers
f7a838db3d Build-script: propagate the build type to the xctest build script 2016-06-26 12:51:43 -05:00
Brian Gesiak
7ff641a61a Merge pull request #3191 from seabaylea/dispatch-testing
[build-script] Make libdispatch available to TestFoundation and XCTest tests if built
2016-06-24 16:17:47 -04:00
swift-ci
06abbb4c8c Merge pull request #3192 from rintaro/build-script-libdispatch-typo 2016-06-24 13:05:38 -07:00
Brian Gesiak
f12a1323ce [SR-1738] Allow *only* static libraries to be built
This splits the `--build-swift-stdlib` and `--build-swift-sdk-overlay`
arguments into `dynamic` and `static` variants, which makes the
following build command possible:

```
utils/build-script -- \
  --build-swift-dynamic-stdlib=0 --build-swift-dynamic-sdk-overlay=0 \
  --build-swift-static-stdlib=1 --build-swift-static-sdk-overlay=0
```

This command produces *only* static libraries for the stdlib, and no
SDK overlay libraries at all. Many other finely-grained build options
are now possible.
2016-06-24 09:18:24 -07:00
Rintaro Ishizaki
e88b7f09cf [build-script] Fix typo in libdispatch configuration
Also adjust indent.
2016-06-24 23:02:11 +09:00
seabaylea
ae9bb2b577 Make libdispatch available to TestFoundation and XCTest tests if built 2016-06-24 10:13:19 +01:00
Michael Gottesman
be112f18d1 [cmake] Use LLVM_TOOLS_BINARY_DIR from LLVMConfig.cmake and remove any invocation of llvm-config.
There are a couple of things going on in this patch. Lets consider first the
crosscompiling case.

In the cross compiling case, we were already setting LLVM_TOOLS_BINARY_DIR to
the binary dir of the just compiled LLVM (not the native LLVM/clang). This is
exactly what using LLVMConfig.cmake from that just compiled LLVM will set
LLVM_TOOLS_BINARY_DIR.

In the non-cross compiling case, we originally grabbed LLVM_TOOLS_BINARY_DIR
from llvm-config and then used that value to set the NATIVE llvm/clang paths.

rdar://26154980
2016-06-23 18:51:09 -07:00
Michael Gottesman
e24e1f7dee [cmake] Use LLVMConfig.cmake instead of llvm-config to set some variables.
Previously in order to support cross-compiling, we were setting these variables
in build-script. Now that we are using LLVMConfig.cmake, passing in these values
are no longer necessary. As an added benefit, Swift when not cross compiling,
does not need to set these variables anyways.

rdar://26154980
2016-06-22 19:58:20 -07:00
Michael Gottesman
7c92789021 [build-script-impl] Fix obvious typo, where we were using LLVM_BUILD_TYPE instead of CMARK_BUILD_TYPE to set cmark's CMAKE_BUILD_TYPE. 2016-06-21 18:55:07 -07:00
Tony Parker
c62ed91931 Merge pull request #2951 from dgrove-oss/specify-clang-when-building-libdispatch
use the toolchain's clang when building libdispatch
2016-06-21 11:10:50 -07:00
Mishal Shah
4fb3a697d2 [Toolchain] Add CompatibilityVersionDisplayString key to Info.plist
rdar://26486492
2016-06-16 13:54:46 -07:00
Mishal Shah
87b7bcfd3e Update master to build with Xcode 8 beta 1, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs. 2016-06-14 14:53:55 -07:00
Dmitri Gribenko
f8a23da648 Merge pull request #3003 from CodaFi/spelling-c
[Gardening] Xcode
2016-06-13 22:34:42 -07:00
swift-ci
a1f1976465 Merge pull request #1714 from SwiftAndroid/tests 2016-06-13 21:20:28 -07:00
Todd Fiala
921ad9d3d3 enable LLDB xpass/xfail to show up in xUnit test output 2016-06-13 09:53:31 -07:00
Robert Widmann
c2f7c49bc4 Spellcheck 2016-06-13 09:07:12 -07:00
practicalswift
2edcdf35ee [gardening] Minor bash cleanups. 2016-06-12 19:24:43 +02:00
Michael Gottesman
95d926abb0 [lto] Only build host libraries using LTO.
At some point in the future, we may consider using LTO on the runtime/standard
library, but right now is not that time. We are just trying to use LTO to
improve the compile time performance of the compiler itself.

rdar://24717107
2016-06-10 13:33:54 -07:00
Michael Gottesman
bd9d59578b [lto] Do not pass in the LLVM_ENABLE_LTO flag to Swift's cmake invocation.
*NOTE* We are still passing this variable into LLVM. Just not into Swift anymore.

I originally passed in the variable -DLLVM_ENABLE_LTO=YES to Swift's cmake to
ensure that the Swift unittests were compiled with lto. That was the wrong
fix.

The reason why is that if -DLLVM_ENABLE_LTO is set to YES then HandleLLVMOptions
in llvm will append -flto to both CMAKE_C_FLAGS and CMAKE_CXX_FLAGS implying
that -flto can not be disabled selectively. This ability to disable flto
selectively is something that we need in order to lto host libraries, but not
lto target libraries.

Thus in this commit, we no longer pass in -DLLVM_ENABLE_LTO=YES to swift's cmake
invocation. Instead we apply the lto flag to the unittest target ourselves in
add_swift_unittest.

rdar://24717107
2016-06-10 01:48:36 -07:00
Brian Gesiak
ee51b7a6f6 [Android] Add testing support
This adds support for running tests for the stdlib built
for Android, both on the host machine and on an Android device.

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

```
$ utils/build-script \
  -R \                                           # Build in ReleaseAssert mode.
  -T \                                           # Run all tests.
  --android \                                    # Build for Android.
  --android-deploy-device-path /data/local/tmp \ # Temporary directory on the device where Android tests are run.
  --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/
```

See docs/Testing.rst for more details.
2016-06-09 13:03:28 -04:00
Daniel Dunbar
bb9fc675c7 [build-script] Switch over to computing targets in build-script.
- Introduces a new `HostSpecificConfiguration` which holds the computed
   information for each host we need to use.

 - This relies on the functionality to pass host-specific variables to the
   script via environment variables.

 - The computation itself has been cleaned up a tiny bit (mostly via using
   the factored out platform/target properties), but is otherwise a straight
   port of the logic from `build-script-impl`.

 - This commit does not yet remove that code from `build-script-impl`; instead
   it validates that the two implementations are computing the same result.
   This is useful right now for testing the validity of the port.
2016-06-08 17:23:00 -07:00
Daniel Dunbar
ca2d64a52c [build-script] Add infrastructure for passing host-specific variables.
- This isn't yet used, but we need an easy way for `build-script` to
   pass host-specific variables down to `build-script-impl`.

 - I don't think it is worth complicating the main argument parsing
   logic with a syntax for passing associative arrays on the command
   line, so this just passes them via environment variables.

 - Part of SR-237.
2016-06-08 17:23:00 -07:00
David Grove
d1ba8e043e use the toolchain's clang when building libdispatch
Use the clang that is part of the toolchain being built
when building libdispatch to ensure getting the appropriate
version of clang.

Also pass through SWIFTC_BIN to the configure command to
prepare for a cleanup of the libdispatch side of the build process.
2016-06-08 13:33:28 -04:00
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
Michael Gottesman
a5d817257a [build-script-impl] Rename swift-enable-lto => swift-tools-enable-lto
This makes it clear to the user that they are enabling lto only for swift tools,
not for the swift standard library/runtime.

rdar://24717107
2016-06-07 19:03:03 -07:00
Michael Gottesman
c7c50031df [build-script-impl][lto] When compiling swift/llvm with lto, pass LLVM_PARALLEL_LINK_JOBS to swift as well as llvm.
The reason to do this is the same reason that we already pass in
-DLLVM_ENABLE_LTO=YES to swift, to ensure that parts of our codebase that use
the llvm build machinery (e.g. the unittests) do not use too many linker jobs
given the memory constraints of a given machine.

rdar://24717107
2016-06-07 19:03:03 -07:00
swift-ci
f693c2540b Merge pull request #2470 from seabaylea/dispatch-xctest 2016-06-05 23:42:57 -07:00
swift-ci
24f2b3fb73 Merge pull request #2693 from seabaylea/dispatch-swiftpm 2016-06-05 20:53:04 -07:00
seabaylea
7e74200bc1 Configure XCTest for Dispatch if included in Foundation on Linux 2016-06-05 18:06:28 +01:00
seabaylea
8788abe260 Pass libdispatch source and build directories to Swift PM 2016-06-05 17:29:47 +01:00
practicalswift
8df3859ce7 [gardening] Fix recently introduced typos. 2016-06-05 11:11:44 +02:00
practicalswift
d34114fec5 [gardening] Normalize formatting. Use "OS X" instead of "OSX". 2016-06-04 23:38:42 +02:00
practicalswift
57bccc8b06 [gardening] Fix inconsistent formatting. 2016-06-04 00:37:15 +02:00
Daniel Dunbar
1a694dc86c [build-script-impl] Add support for performing isolated actions.
- This adds a new argument `--only-execute <name>` which can be used by
   `build-script` to invoke the `build-script-impl` to perform each different
   action, while moving the high-level operation loop into the `build-script`
   itself. This should make incremental refactoring of the individual actions
   into `build-script` easier.

 - This is part of SR-237.
2016-06-03 08:42:21 -07:00
Daniel Dunbar
66f1285270 [build-script-impl] Inline get_setting_varname().
- It turns out that just this function by itself has a significant impact on
   the runtime of the `build-script-impl` when it is being invoked many times by
   the `build-script` (as I intend to do as part of SR-237).
2016-06-02 21:11:17 -07:00
Daniel Dunbar
909d2ce47d [build-script-impl] Optimize setting -> variable name lookups.
- The current behavior of mapping via `tr` was very slow when called over and
   over for each option. This matters for SR-237 where I would like
   `build-script` to take over the top-level build process control loop, which
   involves executing `build-script-impl` multiple times.

 - This patch optimizes the lookup in two ways:

   1. It does the setting to variable conversion in a single pass, for all
      options at once.

   2. It builds a cache of the setting to variable name conversion (as an
      exploded associate array), and uses that when doing variable assignment.

 - This patch speeds up `build-script-impl --dry-run` by 2x on one test case.
2016-06-02 09:21:48 -07:00
SpringsUp
d9dccfa387 [build-script] Use a clean set of COMMON_CMAKE_OPTIONS for every host 2016-06-02 03:08:48 +02:00
SpringsUp
d9c766c7e6 Correct deployment-target regex for watchos/watchsimulator 2016-06-01 09:06:42 +02:00
swift-ci
c32c79b0a8 Merge pull request #2795 from karwa/install-prefix 2016-05-31 22:50:27 -07:00
Dmitri Gribenko
01ad8408f9 Merge pull request #2241 from rintaro/build-script-dryrun
[build-script] Introduce --dry-run mode
2016-05-31 16:52:05 -07:00
SpringsUp
c8a196ad96 [build-script] never expand install prefix as relative path 2016-05-31 23:06:12 +02:00
Rintaro Ishizaki
552590eee6 [build-script] Introduce -n, --dry-run feature
If -n or --dry-run is specified in command line arguments, print the commands
that would be executed to stdout, but do not execute them.

Supported in build-script and build-toolchain.

utils/build-script -n -Rt
utils/build-script -n --preset=buildbot_incremental,tools=RA,stdlib=RA
utils/build-toolchain -n local.swift
2016-05-31 12:45:05 +09:00
rintaro ishizaki
5ea4efb147 [build-script] Provide centralized interface for command execution in build-script-impl
Abstract `set -x; ... { set +x; }` block.
As a side effect, prevent displaying confusing trace like:
```
++ cmake_config_opt cmark
++ product=cmark
++ [[ Ninja == \X\c\o\d\e ]]
```
2016-05-31 12:45:05 +09:00
Dmitri Gribenko
2ad7954299 build-script: don't duplicate product-invariant build settings in COMMON_CMAKE_OPTIONS 2016-05-30 19:42:08 -07:00
SpringsUp
9d822cda8a Refactored built-script-impl:
- Use consistent terminology for target platforms, disambiguate uses of
  'deployment_target' in to 'host' and 'stdlib_targets'
- Changed parameters to build script:
  - install-prefix no longer has to include toolchain-prefix on OSX
  - swift-sdks has been replaced by stdlib-deployment-targets
  - built-stdlib-deployment-targets lets you restrict which of the
    stdlib-deployment targets are built
- Calculate stdlib_targets per host, to facilitate future cross-compiling
- Only use executables from LOCAL_HOST
- Only execute testable targets of the LOCAL_HOST
- Remove some cases of switching on 'uname' to facilitate future
  cross-compiling
2016-05-30 08:58:16 +02:00
Dmitri Gribenko
2cb2a6c51a Merge pull request #2739 from ddunbar/SR-1628
[SR-1628] Run swift-integration-tests in a sandboxed directory.
2016-05-27 16:23:52 -07:00
Daniel Dunbar
6fd7336835 [SR-1628] Run swift-integration-tests in a sandboxed directory.
- This should fix possible issues with the test outputs being in a shared
   directory on CI machines running concurrent builds.

 - https://bugs.swift.org/browse/SR-1628
2016-05-26 21:58:23 -07: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
Michael Gottesman
3661a0e237 Merge pull request #2690 from gottesmm/specify_compiler_rt_uses_llvm_external_project_mechanism
[build-script] When building compiler-rt, follow LLVM's lead by speci…
2016-05-25 17:19:06 -07:00
Dmitri Gribenko
2daa1400cf Merge pull request #2541 from linux-on-ibm-z/master-s390x
Support Linux on z as a Swift platform
2016-05-25 16:06:10 -07:00