-
Notifications
You must be signed in to change notification settings - Fork 258
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
[README] Encourage using the Swift build script #77
Conversation
@swift-ci Please test |
@swift-ci Please test |
@modocache Looks like we have a new failure, so the changes you made might have helped resolve swiftc issues.
|
Yeah, I took a look at that this morning but can't tell what's wrong. The same build failure doesn't reproduce for me locally, either... @parkera, any ideas? I could probably figure this out eventually, but help would be greatly appreciated! |
Hm, I'm not sure. @shahmishal is the Foundation build passing without this change? |
@parkera Just to be clear, this pull request doesn't really change anything besides documentation. The XCTest CI job for OS X has been failing since its introduction. 😅 I've been submitting pull requests to apple/swift to attempt to fix it, then running tests on this pull request to check whether it's been fixed. I believe Foundation is built and tested via its own mechanism--it doesn't use |
Yah I think we should probably merge this; the failure seems unrelated. |
@parkera It's true that the failure is unrelated to this change. But the documentation changes in this pull request are to encourage people to use Instead, I'd like to get to the bottom of the failure first. Once we have a single command all contributors can use to build and test the project, I'll update this pull request to recommend using that. |
9346a64
to
3dde03e
Compare
@briancroom @mike-ferris-apple The changes to the Swift build script have landed, and this can now be merged. I think these README instructions are much simpler for newcomers--what do you think? |
build_parser.set_defaults(func=_build) | ||
build_parser.add_argument( | ||
"--swiftc", | ||
help="Path to the 'swiftc' compiler that will be used to build " | ||
"XCTest.so, XCTest.swiftmodule, and XCTest.swiftdoc. This will " | ||
"also be used to build the tests for those built products if the " | ||
"--test option is specified.", | ||
metavar="PATH", |
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.
I'm curious why you chose to remove the metavar
values here?
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.
I didn't think they added any value, and I figured I'd just include them in this pull request.
This is the help text diff:
diff --git a/build_script_help_text.txt b/build_script_help_text.txt
index 194df0d..e28cd3b 100755
--- a/build_script_help_text.txt
+++ b/build_script_help_text.txt
$ build_script.py build -h
# ...
optional arguments:
-h, --help show this help message and exit
- --swiftc PATH Path to the 'swiftc' compiler that will be used to
+ --swiftc SWIFTC Path to the 'swiftc' compiler that will be used to
build XCTest.so, XCTest.swiftmodule, and
XCTest.swiftdoc. This will also be used to build the
tests for those built products if the --test option is
specified.
- --build-dir PATH
+ --build-dir BUILD_DIR
Path to the output build directory. If not specified,
a temporary directory is used
- --foundation-build-dir PATH
+ --foundation-build-dir FOUNDATION_BUILD_DIR
Path to swift-corelibs-foundation build products,
which the built XCTest.so will be linked against.
- --swift-build-dir PATH
+ --swift-build-dir SWIFT_BUILD_DIR
deprecated, do not use
--arch ARCH deprecated, do not use
- --module-install-path PATH
+ --module-install-path MODULE_PATH
Location at which to install XCTest.swiftmodule and
XCTest.swiftdoc. This directory will be created if it
doesn't already exist.
- --library-install-path PATH
+ --library-install-path LIB_PATH
Location at which to install XCTest.so. This directory
will be created if it doesn't already exist.
--release builds for release
--debug builds for debug (the default)
--test Whether to run tests after building. Note that you
must have cloned https://github.com/apple/swift-llvm
at /Users/bgesiak/GitHub/apple/llvm in order to run
this command.
Personally I think it's less code without them, and removing them provides clearer help text. What do you think?
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.
Thanks for the explanation! Looks great.
I'm pretty sure I'd trust your judgement over mine on things Python 😆 Always looking to learn.
New contributors to swift-corelibs-xctest are having some difficulty knowing where to start: - https://bugs.swift.org/browse/SR-981 - https://bugs.swift.org/browse/SR-907 - https://bugs.swift.org/browse/SR-906 The problem is that over time this project has begun to take on more dependencies: - To build the project, one must use a modern Swift 3 compiler (often one more recent than the latest https://swift.org snapshot). - To build the project, one must have swift-corelibs-foundation checked out at a particular path. - To run the test suite, one must have the LLVM `lit` test runner installed at a particular path. In addition, the build steps differ based on whether the contributor is using an OS X or Linux development environment. This commit revamps the README and the Linux `build_script.py` to require fewer steps for new contributors to get started. Specifically, it encourages contributors to use the Swift `utils/build-script`. There are many reasons to do so: - The XCTest CI uses that script, so contributors will need to make sure it passes to get their contributions merged. - That script ensures that the correct build of `swiftc` and swift-corelibs-foundation are used. - That script works across all platforms, and is invoked in the same way on each platform. In addition, more detailed information on the project has been moved to a Documentation directory. This resembles other projects in the Swift family of repositories.
3dde03e
to
db60942
Compare
Hey @modocache, overall, I think this is a good direction for the project as we attempt to lower the barrier to entry for contributors. The writeup itself in the README is very well done 💯 The only thing that makes me hesitate is that I've personally had some rather unpleasant experiences with running the build script on my dev machine, ranging from "whelp, better find something to do for the next 2 hours" to "wait why is clang failing to build. Hmm maybe if I symlink these headers here... 😕" etc. Having said that, I realize that these issues are probably mostly tied to some quirk on my particular system, and I know that the script has a fully-supported incremental build mode which, especially in conjunction with the new build preset that you got merged (yay!), should make it reasonable to use for development. Assuming that other folks are seeing successful builds by following these instructions, I would consider this good to merge! (I'm hoping to get a chance to wipe my Swift dev environment sometime soon and start afresh which should theoretically straighten out my issues, and also help me understand the experience of new contributors.) |
Yeah, that does sound strange... I think one benefit here is that there's a wider body of people running the Swift build script. I consider that important; personally I had a lot of trouble building LLVM from source a few years ago, but kept at it because I knew it couldn't possibly be broken for everyone--"it must be a problem on my end", I thought, and I tried to figure out what was wrong. I also consider the Swift build script much more user-friendly. So all-in-all, I don't think building Swift is an unreasonable prerequisite. I think if we can get a passing OS X and Linux CI build on this pull request, we should go ahead and merge it. The script works for me locally. @mike-ferris-apple? |
@swift-ci please test |
Looks like more strange Foundation build issues on the OS X CI box:
|
Looks like the failure is a build config race condition. It is expecting a product directory to exist but it has not been created yet (and the command is not recursive) I have not seen this specific failure before but I have seen similar ones in other projects. |
Now that apple/swift#2137 is in, could someone fire off CI again on this and apple/swift#2137? I have high hopes of clean builds at last! @mike-ferris-apple @shahmishal |
@swift-ci please test |
Bingo! I think we've achieved our goal. Thanks for pushing us onwards @modocache. Despite recent discussion about a minor strategy change and bringing Darwin into the build script after all, this PR is still unquestionably a step forward. |
I... I can't believe the day has finally come that we have a passing OS X and Linux CI!! Thanks, @briancroom! Couldn't have done it without apple/swift#2137! |
New contributors to swift-corelibs-xctest are having some difficulty knowing where to start:
The problem is that over time this project has begun to take on more dependencies:
lit
test runner installed at a particular path.In addition, the build steps differ based on whether the contributor is using an OS X or Linux development environment.
This commit revamps the README and the Linux
build_script.py
to require fewer steps for new contributors to get started. Specifically, it encourages contributors to use the Swiftutils/build-script
. There are many reasons to do so:swiftc
and swift-corelibs-foundation are used.In addition, more detailed information on the project has been moved to a Documentation directory. This resembles other projects in the Swift family of repositories.
This should probably be merged after apple/swift#1748. That pull request puts the final touches on building XCTest via the Swift build script on OS X.