Skip to content
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

[SR-1048] XCTest build_script.py should build debug/release depending on Swift build script params #398

Closed
modocache mannequin opened this issue Mar 24, 2016 · 6 comments

Comments

@modocache
Copy link
Mannequin

modocache mannequin commented Mar 24, 2016

Previous ID SR-1048
Radar None
Original Reporter @modocache
Type Improvement
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s XCTest
Labels Improvement, StarterBug
Assignee jamal (JIRA)
Priority Medium

md5: 27328da1d032e726efe058bc7dc22b33

Issue Description:

swift-corelibs-xctest's build_script.py is able to build the project in either --debug or --release mode:

build_parser.add_argument(
"--release",
help="builds for release",
action="store_const",
dest="build_style",
const="release",
default="debug")
build_parser.add_argument(
"--debug",
help="builds for debug (the default)",
action="store_const",
dest="build_style",
const="debug",
default="debug")

The Swift build script, utils/build-script, also takes parameters to determine the build mode:
https://github.com/apple/swift/blob/e8eba770d58ce512046951b0647941194987525e/utils/build-script#L358-L367

Swift has many build modes: Debug, Release, Release+Assert, etc. This build mode is never reflected in the XCTest build mode, however: https://github.com/apple/swift/blob/e8eba770d58ce512046951b0647941194987525e/utils/build-script-impl#L1937-L1942

It should be! XCTest should be built in release mode (passed the --release flag) when Swift is being built in release mode. It should be built in debug mode when Swift is built in debug mode.

(It might also be worth looking into the other Swift build modes, such as when assertions are turned on, and determine whether we should reflect that in how XCTest is built. But that's outside the scope of this task.)

@swift-ci
Copy link

Comment by Jamal Rogers (JIRA)

@modocache I'd like to take this on. Should I assign this to myself, or is that bad protocol?

@modocache
Copy link
Mannequin Author

modocache mannequin commented May 31, 2016

Not at all, go for it! 🙂

Comment here if you have any questions/updates!

@swift-ci
Copy link

Comment by Jamal Rogers (JIRA)

@modocache: I've got an initial fix here: https://github.com/jamala/swift/tree/xctest-propagate-build-type
https://github.com/jamala/swift-corelibs-xctest/tree/propagate_build_type

Let me know how this looks, and I will create the pull requests.

@modocache
Copy link
Mannequin Author

modocache mannequin commented Jun 27, 2016

jamal (JIRA User), your changes look pretty much perfect – thank you!! Please send pull requests when you can, and assign them to me. I'll test them on CI and merge them.

@modocache
Copy link
Mannequin Author

modocache mannequin commented Jun 28, 2016

Thanks for taking care of this, jamal (JIRA User)!

@modocache
Copy link
Mannequin Author

modocache mannequin commented Jun 28, 2016

Resolved via #128 and apple/swift#3226

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 9, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant