Commit Graph

1328 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis
fb7b717951 Merge pull request #2146 from apple/buildscript-extra-cmake-vars
[utils/build-script] Introduce '--extra-cmake-vars' option
2016-04-12 13:30:12 -07: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
Todd Fiala
f5d88ce0bf Merge pull request #2144 from tfiala/master
lldb test suite: use just-built clang by default
2016-04-11 18:38:34 -07:00
swift-ci
c3ef9390eb Merge pull request #2141 from briancroom/relative-symlinks 2016-04-11 17:38:48 -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
Todd Fiala
268d03842a lldb test suite: use just-built clang by default
build-script-impl now takes a --lldb-test-cc flag:

* when not specified, it will default to using the
  just-built clang (i.e. in tree with swift) to
  build the C/C++ test suite test inferior programs.

* when specified and equal to "host-toolchain", the
  test suite test inferiors will be built with
  the same compiler chosen as --host-cc.

* when set to anything else, it is assumed to be the
  full path to a C compiler to use for compiling
  LLDB test suite test inferiors.

Note the LLDB test suite only takes the C compiler and
derives the C++ compiler from the C compiler path.  There
is no need to specify the C++ compiler directly.

Addresses the following issue:
https://bugs.swift.org/browse/SR-1207
2016-04-11 14:45:10 -07:00
Brian Croom
49c7200539 [build-script] Create relative symlinks into the llvm tree. 2016-04-11 16:03:54 -04:00
Brian Croom
1288da298d [build-script] Use the correct build directory when building Darwin XCTest 2016-04-11 08:18:02 -04:00
practicalswift
1ef6ea8c4c [gardening] \t → " " 2016-04-08 21:59:13 +02:00
Argyrios Kyrtzidis
f242326627 [SourceKit] Use DARWIN_TOOLCHAIN_VERSION if provided, as the version to use for the XPC service name.
This is to make service name in the external toolchains unique.
rdar://25612603
2016-04-07 21:34:26 -07:00
Brian Gesiak
32730fac6f [build-script] XCTest CI builds on OS X
Fix the OS X XCTest CI preset:

1. Installation of XCTest isn't supported on OS X. After all, the
   library is meant to be used on Linux, and not intended to be used or
   installed on OS X. Therefore, no longer pass an `INSTALL_PATH` to the
   `xcodebuild` invocation on OS X.
2. `xcodebuild` expects `swift-stdlib-tool` to be present in the same
   directory as the `SWIFT_EXEC` it's given. Re-use some shellscript
   from the toolchain installation script to copy the stdlib-tool
   substitute.

This allows the XCTest CI to work on all platforms.
2016-04-05 21:46:39 -04:00
Nadav Rotem
0b1e8583a1 Make the option of building using the host clang the default
I am committing this as a workaround until we fix the ASAN bot.
2016-04-01 09:24:03 -07:00
Ted Kremenek
2674ae25f4 Revert "Disable ASAN on the LLVM build, keep it on Swift." 2016-03-31 21:20:45 -07:00
swift-ci
c065c08c18 Merge pull request #1998 from nadavrot/fix_asan_build 2016-03-31 20:51:07 -07: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
Nadav Rotem
e8d0c2e17b Disable ASAN on the LLVM build, keep it on Swift.
When enabling ASAN on LLVM it does not build the asan libraries, and this means
that we can't use it to sanitize swift. This change disables ASAN on the
internal clang but keeps it on the Swift project.
2016-03-31 16:50:57 -07:00
Nadav Rotem
6a11924038 Revert "Revert "Build the Swift runtime using the locally built clang compliler."" 2016-03-30 17:26:35 -07:00
Nadav Rotem
0c1a8f308a Revert "Build the Swift runtime using the locally built clang compliler." 2016-03-30 11:08:21 -07:00
Nadav Rotem
412ce77112 Omit the target name from the 'ln' command.
Repetitive invocation of ln try to create nested directories.
2016-03-29 18:02:13 -07:00
Nadav Rotem
0e9fd65a15 Indent the code and add set -x. 2016-03-29 17:07:26 -07:00
Nadav Rotem
56eb498a74 Build the Swift runtime using the locally built clang compliler.
This commit makes the swift build scripts use the clang that we build as part of
the build process in order to build the Swift runtime, and not the host
compiler. This change is necessary for using new clang features immediately after they are introduced.
One example for such feature is new function calling conventions, or new c-level attributes.
2016-03-29 13:34:15 -07:00
Vedant Kumar
708c6409b0 Skip compiler-rt in Xcode-driven builds 2016-03-24 10:36:26 -07:00
Slava Pestov
80eb599e2c build-script: Actually fix --swift-stdlib-sil-serialize-all
Oops, I didn't test with this flag off.
2016-03-22 17:41:09 -07:00
Slava Pestov
34e41f2e81 built-script: Add --swift-stdlib-sil-serialize-all flag
We want to have the option of building the standard library without
-sil-serialize-all.

For now, the build crashes in the SIL verifier due to various issues;
upcoming patches will address these.

This is part of the larger goal of building the stdlib with
-enable-resilience.

Part of https://bugs.swift.org/browse/SR-267.
2016-03-22 17:13:34 -07:00
Brian Gesiak
b75d19bf94 Merge pull request #1748 from modocache/ci-osx-xctest-build-fix
[build-script] Link Objective-C runtime for XCTest
2016-03-21 22:46:39 -04:00
eeckstein
7e79ad1080 Merge pull request #1760 from eeckstein/gsil_option_for_stdlib
Add a build-script-impl option --build-sil-debugging-stdlib to compile with SIL debugging
2016-03-21 13:44:14 -07:00
Vedant Kumar
8d044c33e3 Remove debug statement 2016-03-21 13:00:04 -07:00
Vedant Kumar
5b58591bf9 Set LLVM_TOOL_COMPILER_RT_BUILD to build compiler-rt 2016-03-21 12:58:47 -07:00
Erik Eckstein
c8d61fce9f Add a build-script-impl option --build-sil-debugging-stdlib to compile the stdlib with SIL debug info (-gsil) 2016-03-21 12:57:05 -07:00
Vedant Kumar
a1e180cb24 Base check on the number of deployment targets 2016-03-21 10:53:06 -07:00
Vedant Kumar
79b7c96541 [build-script] Don't build compiler-rt when cross-compiling 2016-03-21 10:30:11 -07:00
Brian Gesiak
92f9456dac [build-script] Link Objective-C runtime for XCTest
The XCTest CI is currently broken for OS X. Invoking `xcodebuild`, even
when setting the correct `SWIFT_EXEC`, was unable to build Foundation.
The problem was that a flag to link the Objective-C runtime was not being set
as it would be when building with a Swift toolchain.

Set the flag to get the builds passing. The XCTest CI presets should
pass on all platforms with this change.
2016-03-19 19:36:10 -04: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
Brian Gesiak
598fea26a7 [build-script] XCTest xcodebuild uses SWIFT_EXEC
Because the `xcodebuild` invocation used to compile swift-corelibs-xctest on OS X uses a toolchain that is usually out of date, it often fails (for example, when building the newly migrated Swift 3 code).

Pass the path to the freshly built `swiftc` to `xcodebuild` in order to use the latest Swift compiler.
2016-03-10 11:49:51 -05:00
Michael Gottesman
71c591b86e [lto] When determining the number of lto threads to use, take the minimum of ${BUILD_JOBS} and a heuristic that scales with the memory size of the machine.
This ensures that even if we have a machine with a huge amount of ram, we
respect ${BUILD_JOBS}.
2016-03-09 13:31:35 -08:00
Jason Molenda
1f31fff611 Allow swift to be built for iphoneos-armv7s, a variation on armv7,
used with the Apple A6 and later 32-bit devices.
2016-03-08 16:49:31 -08: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
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
612d6aca0e [build-script] Remove obsolete PM --build-tests
The `swiftpm/Utilities/bootstrap --build-tests` parameter was deprecated in ae9121960e and is no longer used. Remove it to reduce confusion.
2016-03-04 23:42:32 -08:00
Dmitri Gribenko
80db9fb1f3 Merge pull request #1506 from modocache/build-script-xctest-fixmes
[build-script] Only build XCTest once
2016-03-04 21:51:55 -08:00
Brian Gesiak
73cccadd3e Merge pull request #1396 from modocache/build-script-host-test
[SR-237] Move SKIP_TEST_* arguments to Python
2016-03-03 00:02:36 -08:00
Brian Gesiak
729e54f347 [build-script] Only build XCTest once
Prior to https://github.com/apple/swift-corelibs-xctest/pull/57 and
https://github.com/apple/swift-corelibs-xctest/pull/58, the
swift-corelibs-xctest build script did not provide a way an already
built XCTest.so to be tested or installed. As a result, the Swift
build script would build XCTest several times.

For example, the following invocation would build XCTest three separate
times:

```
$ utils/build-script --xctest --test -- --install-xctest
```

Modifications to the XCTest build script now allow a prebuilt XCTest to
be tested (via the `build_script.py test` subcommmand) and installed
(via the `build_script.py install` subcommand). Use these in the Swift
build script to build XCTest only once, then test and install the built
version.

Also, explicitly disable XCTest installation on OS X. XCTest's
`build_script.py` only supports non-Darwin platforms, so running
`utils/build-script --xctest -- --install-xctest` on OS X used to cause
the build script to fail because of how that script invokes `swiftc`.
It now fails with an explicit error indicating `--install-xctest` is
unsupported.
2016-03-02 03:52:45 -05:00
Michael Gottesman
11c8a7c674 [cmake] Add support for specifying the number of parallel link jobs for swift.
I am going to use the link job for limiting swift lto compile time.

The reason not to use the same variables as LLVM (i.e. LLVM_PARALLEL_LINK_JOBS)
is that Swift since it is compiling more IR may have a larger memory
representation implying less parallel linking jobs than LLVM can be used on
bots.
2016-03-01 16:33:53 -08:00
Michael Gottesman
9d85904c18 [cmake] Work around lto cmake bug in cmake 3.4.0.
http://public.kitware.com/pipermail/cmake-developers/2015-November/026993.html

We check for this in build-script-impl and if you are running such a version,
special flags are passed in to work around the issue. If you do not have this verison of cmake, this change should not affect you in any way.

This will be fixed in cmake 3.4.1.
2016-03-01 15:01:19 -08:00
Michael Gottesman
fc1735ce5d Fix thinko. 2016-02-29 20:14:11 -08:00
Michael Gottesman
d2143730c0 [lto] Add the option llvm-enable-lto that compiles LLVM/Clang with LTO.
If you also set swift-enable-lto to 1, then you get a swiftc that is compiled
fully with LTO.
2016-02-29 19:53:51 -08: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
Michael Gottesman
133f8549fa Make the ubsan build actually work. I made a careless mistake in the previous commit. This should work now. 2016-02-27 00:18:01 -08:00
Michael Gottesman
f1df90423d Add support for compiling the compiler (not the stdlib) with ubsan.
While on OS X, ubsan is not productized, on linux it is, so hopefully we can get
this setup on a bot so we can catch some undefined behavior issues.
2016-02-27 00:04:35 -08:00