Commit Graph

1328 Commits

Author SHA1 Message Date
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
Michael Gottesman
3350551778 [build-script] When building compiler-rt, follow LLVM's lead by specifying that we are using LLVM's external project mechanism.
This matches the LLVM build more closely preventing potential build issues
coming up.

rdar://26284108
2016-05-25 14:21:48 -07:00
Michael Gottesman
4b039d3ea8 [cmake] Link in the toolchain c++ headers after running LLVM cmake but before the LLVM build.
When we are building LLVM create symlinks to the c++ headers. We need to do this
before building LLVM since compiler-rt depends on being built with the just
built clang compiler. These are normally put into place during the cmake step of
LLVM's build when libcxx is in tree... but we are not building llvm with libcxx
in tree when we build swift. So we need to do cmake's work here.

rdar://26284108
2016-05-25 14:20:56 -07:00
Dmitri Gribenko
29fa5e413d build-script-impl: fix the build when distcc is not enabled 2016-05-25 13:57:28 -07:00
Michael Gottesman
f8d3b495f0 [distcc] When distcc is enabled force cmake to use localhost for configure testing.
It seems that distcc --randomize is causing cmake to invoke configuration
commands on remote machines. This is slow. Instead, just use the localhost host
when running cmake.

The rest of the build is distributed as normal.
2016-05-25 13:30:40 -07:00
Bryan Chan
85fde8b1fb Add support for Linux s390x. LLVM's Swift calling convention support is used to ensure correct operations of C++ code in the runtime. This patch also includes some (incomplete) changes to enum handling to make enums work in most common cases. 2016-05-24 20:03:28 -04:00
Brian Gesiak
7218c41e60 Merge pull request #2609 from compnerd/linux-is-gold
utils: require gold on Linux targets
2016-05-24 16:29:53 -04:00
Dmitri Gribenko
545042d824 build-script: reduce the amount of debug output 2016-05-21 23:36:44 -07:00
David Farler
1e70c5153e Merge pull request #2629 from bitjammer/enable-reflection-metadata-default
SwiftRemoteMirror: Turn on reflection metadata by default
2016-05-21 23:28:02 -07:00
Dmitri Gribenko
559829fadd Merge pull request #2562 from rintaro/build-script-tweak-args
[SR-237][build-script] Migrate --skip-{variant} --skip-build-{variant} arguments
2016-05-21 19:48:59 -07:00
David Farler
a38a4ce596 SwiftRemoteMirror: Turn on reflection metadata by default
Flip the enable flags to disable and make these IRGen options
true by default.

rdar://problem/26206547
2016-05-21 17:40:37 -07:00
Saleem Abdulrasool
3b7b0d8091 utils: require gold on Linux targets
Given the discussion on swift-dev, and no opposition, swift the linux targets to
using gold by default.
2016-05-20 20:13:56 -07:00
Erik Eckstein
62597ea58f build_script: Add an option to build the swift libraries multiple times to check if incremental compilation works.
A script checks if the output object file is written only once even if the compiler is invoked multiple times.
The main purpose of this check is to ensure that the compiler is deterministic (until IRGen).
2016-05-18 10:01:14 -07:00
Rintaro Ishizaki
8d7a150ba1 [build-script][SR-237] Migrate --skip-{variant} --skip-build-{variant}
Eliminate some arguments tweaks from build-script-impl

Migreated:
  --skip-ios
  --skip-tvos
  --skip-watchos
  --skip-build-ios
  --skip-build-ios-device
  --skip-build-ios-simulator
  --skip-build-tvos
  --skip-build-tvos-device
  --skip-build-tvos-simulator
  --skip-build-watchos
  --skip-build-watchos-device
  --skip-build-watchos-simulator
  --skip-build-android

Removed from impl:
  // These args were merely shorthands for:
  //   --skip-build-{variant}-{device,simulator}
  //   --skip-test-{variant}-{host,simulator}
  --skip-ios
  --skip-tvos
  --skip-watchos
  --skip-build-ios
  --skip-build-tvos
  --skip-build-watchos
2016-05-16 10:22:22 +09:00
Michael Gottesman
3b7639defd Make sure that the sanitizers use the same minimum OS X deployment target as llvm/clang/swift.
Otherwise, we run into an issue with certain clangs and linking in libc++. libc++
in certain clangs require a minimum deployment target of at least 10.7.

I have not investigated further since I am trying to make progress on the
branching scheme.

rdar://26081474
(cherry picked from commit 2a27443f3ee63cc55e952e4cfb43c24661c4b7ca)
2016-05-13 22:05:01 -07:00