Skip to content

Enhance the build script to support building and testing on Darwin #97

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
merged 1 commit into from
Apr 21, 2016

Conversation

briancroom
Copy link
Contributor

As discussed in swiftlang/swift#2137, we are getting the feeling that we should move build script logic for Darwin out of Swift's build-script-impl and into XCTest's own build script to reduce churn and enable better CI feedback. This PR is a first step towards making that happen.

  • Build and test are performed using xcodebuild actions, as the Swift
    build-script-impl script has been doing in the past
  • Installation is not supported on Darwin
  • Uses the strategy pattern to isolate platform branching logic

@parkera
Copy link
Contributor

parkera commented Apr 16, 2016

This seems reasonable to me. I had always intended this script to be a stop gap until swift-pm was read enough to build all the things on all the platforms. Hopefully the script is a step toward unifying build logic and will help when that day comes.

@@ -184,29 +257,34 @@ def main(args=sys.argv[1:]):
delegates building or testing XCTest to a sub-parser and its corresponding
function.
"""
strategy = DarwinStrategy if platform.system() == 'Darwin' else LinuxStrategy
Copy link
Contributor

@modocache modocache Apr 16, 2016

Choose a reason for hiding this comment

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

I've actually never tried building corelibs-xctest on FreeBSD (on my todo list), but I imagine it should succeed using the LinuxStrategy. However, I've been told that it's something of a faux pas to refer to FreeBSD as Linux. Could we rename this to UnixStrategy or GenericUnixStrategy? This would match the naming scheme of Swift's toolchains.

@modocache
Copy link
Contributor

Big +1 from me! This looks fantastic. 💯

I imagine this will continue working with the current Swift utils/build-script, correct? Let's kick off the test to make sure CI isn't going to break!

@briancroom
Copy link
Contributor Author

briancroom commented Apr 18, 2016

Thanks for the feedback, guys! I'll make the suggested adjustments the next time I'm at a dev workstation, which won't be until mid-week I expect. Then once this goes in I'll see about updating the main Swift build script to unconditionally call into this one, with little or no platform branching. Meanwhile, the interface here hasn't changed, so there shouldn't be any build breakage.

* Build and test are performed using `xcodebuild` actions, as the Swift
  build-script-impl script has been doing in the past
* Installation is not supported on Darwin
* Uses the strategy pattern to isolate platform branching logic
@briancroom briancroom force-pushed the darwin-build-script branch from 8f83a1c to 09dbfc1 Compare April 21, 2016 07:05
@briancroom
Copy link
Contributor Author

Alright, I've made the updates now. @parkera @mike-ferris-apple could you request a test run when you have a second?

@ddunbar
Copy link
Contributor

ddunbar commented Apr 21, 2016

@swift-ci please test

@briancroom
Copy link
Contributor Author

Green! Merging now.

@briancroom briancroom merged commit b106a92 into swiftlang:master Apr 21, 2016
@briancroom briancroom deleted the darwin-build-script branch April 21, 2016 13:01
@briancroom
Copy link
Contributor Author

Follow-up: swiftlang/swift#2259

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