Skip to content

[2/2][build_script.py] Add "install" subcommand #58

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

Merged

Conversation

modocache
Copy link
Contributor

This builds upon the subcommand system added in #57, to add an install command. That pull request should be reviewed and merged prior to this one.

As that pull request describes, because there is no way to test or install XCTest without also building the project, the current Swift build script ends up building XCTest three times. This adds an "install" subcommand that allows an already built XCTest to be installed.

@modocache modocache force-pushed the build-script-subcommands-install branch from 2ab127e to f636591 Compare February 28, 2016 18:29
@modocache
Copy link
Contributor Author

@swift-ci please test

This builds upon the subcommand system added in
swiftlang#57, to add
an install command.

As that pull request describes, because there is no way to test
or install XCTest without also building the project, the current
Swift build script ends up building XCTest three times. This adds
an "install" subcommand that allows an already built XCTest to be
installed.
@modocache modocache force-pushed the build-script-subcommands-install branch from f636591 to 9502b80 Compare March 1, 2016 00:01
@modocache
Copy link
Contributor Author

@mike-ferris-apple Could you ask @swift-ci to please test? Once this is merged, I can change the Swift build script to only build XCTest as many times as necessary.

@mike-ferris
Copy link

@swift-ci please test

@briancroom
Copy link
Contributor

It looks like the CI hook here isn't going through, since the last build on this job is from Feb. 29. Perhaps @shahmishal can help debug?

@modocache I quite like the flexibility you're introducing with this series of build script improvements. 👍

@modocache
Copy link
Contributor Author

Thanks, @briancroom! But, yeah, I'm worried the CI must have become sentient, and is disobeying direct orders!! 🚨

Seriously, though, I think there's some work being done to enable the CI for external core members. Maybe it's a bit unresponsive in the interim, even for @mike-ferris-apple...

@@ -26,6 +26,14 @@ def run(command):
subprocess.check_call(command, shell=True)


def _mkdirp(path):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious about this _ and the ones on _build etc. Is this a Python convention I should be familiar with for internal (/non-exported?) functions? If that's the case, how is this function different from e.g. note in its role in the module?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do think preceding with an underscore is typically done for "internal" functions, but I may be wrong. note was tangential to this change so I left it alone. @practicalswift, what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is admittedly kind of silly, since this is just a single script, so really every function is "internal" 😛

@shahmishal
Copy link
Member

@swift-ci Please test

@shahmishal
Copy link
Member

@swift-ci Please test OS X platform

@modocache
Copy link
Contributor Author

Amazing! Thanks for the OS X support, @shahmishal! It looks like the build is failing because xcodebuild isn't using the latest Swift toolchain--it can't handle the new #file and #line identifiers. Is this some sort of configuration issue?

This pull request only affects Linux, and the tests are passing on that platform, so I'll go ahead and merge this.

modocache added a commit that referenced this pull request Mar 2, 2016
[2/2][build_script.py] Add "install" subcommand
@modocache modocache merged commit 824862a into swiftlang:master Mar 2, 2016
@modocache modocache deleted the build-script-subcommands-install branch March 2, 2016 06:43
modocache added a commit to modocache/swift that referenced this pull request Mar 2, 2016
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants