-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[build-script] Only build XCTest once #1506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[build-script] Only build XCTest once #1506
Conversation
8fa7f8c
to
0979b61
Compare
@swift-ci Please test |
echo "--- Installing ${product} ---" | ||
XCTEST_BUILD_DIR=$(build_directory ${deployment_target} xctest) | ||
XCTEST_INSTALL_PREFIX="${INSTALL_DESTDIR}"/"${INSTALL_PREFIX}"/lib/swift/"${LIB_TARGET}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we use just one pair of quotes here, from start to end of the path?
LGTM, let's see what CI says. |
0979b61
to
162812b
Compare
@gribozavr Great! I also addressed your comment. |
Prior to swiftlang/swift-corelibs-xctest#57 and swiftlang/swift-corelibs-xctest#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.
162812b
to
729e54f
Compare
@swift-ci Please test |
The failure on Linux is unrelated, but it prevented the XCTest tests from running. XCTest tests on OS X have not yet been enabled on CI, I think @shahmishal is working on it (as evidenced here). Let's try running them again soon, when master is greener? 😇 |
@swift-ci Please test |
@gribozavr Looks like CI passed, although the OS X tests don't actually test XCTest. Personally I think that's fine--we'll use the preset from #1533 to test XCTest on OS X from now on. Shall I merge? |
[build-script] Only build XCTest once
What's in this pull request?
Prior to swiftlang/swift-corelibs-xctest#57 and swiftlang/swift-corelibs-xctest#58, the swift-corelibs-xctest build script did not provide a way for 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:
Modifications to the XCTest build script now allow a prebuilt XCTest to be tested (via the
build_script.py test
subcommmand) and installed (via thebuild_script.py install
subcommand). Use these in the Swift build script to build XCTest only once, then test and install the built version.This pull request also:
build_script.py
only supports non-Darwin platforms, so runningutils/build-script --xctest -- --install-xctest
on OS X used to cause the build script to fail because of how that script invokesswiftc
. It now fails with an explicit error indicating--install-xctest
is unsupported.--install-destdir
, as--install-swiftpm
does.Resolved bug number: None
Before merging this pull request to apple/swift repository:
Triggering Swift CI
The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:
Smoke Testing
Validation Testing
Note: Only members of the Apple organization can trigger swift-ci.