-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[build support] Generic prefixed binary lookup function in swift_build_support #1586
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 support] Generic prefixed binary lookup function in swift_build_support #1586
Conversation
951ab5b
to
6980ae9
Compare
6980ae9
to
fec3c65
Compare
@modocache @gribozavr Thoughts? |
fec3c65
to
81b6009
Compare
Actually, this doesn't take the native llvm/clang tools option into account, regardless. That needs to be addressed. |
Any ideas here? The current functions don't take into account Neglecting that, I think this PR is good (and necessary to get coverage working on Linux). |
81b6009
to
af6f844
Compare
@gribozavr How about this? |
|
||
It requires a 'cc' and 'cxx' tool in its keyword args. | ||
""" | ||
def __init__(self, cc=None, cxx=None, **kwargs): |
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.
Sorry if I'm not picking up on something here, but why provide default arguments for arguments the documentation claims are necessary? If you're looking for the ability to use named arguments like Toolchain(cc="foo", cxx="bar")
, you can do that without supplying default arguments in Python.
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 figured it was good to express that these arguments are strictly required, though the same could be expressed with
assert(tools.get('cc') is not None)
The commit message claims these changes will allow searching for arbitrary executables besides Modulo comments this looks like a good direction to me! 👍 |
I can add a test case, but I don't want tests to fail if the tester actually doesn't have the tools installed... |
Can we assume that certain tools will always exist on OS X systems? If so you can run them on OS X only, like these are: https://github.com/apple/swift/blob/master/utils/swift_build_support/tests/test_xcrun.py#L18-L20 |
That's totally doable. IIRC, Xcode includes, at the very least, |
Sure! I also don't think the test has to be for something related to profdata, just something besides Clang that can be found with the new functionality (i.e.: a test that would have failed prior to these changes). |
@modocache Thoughts on the extra test? |
Looks good to me! @gribozavr could you ask @swift-ci to please test? |
@swift-ci Please test |
Tests pass. @gribozavr Good to merge? |
@swift-ci Please python lint |
|
@swift-ci Please python lint |
@harlanhaskins Thanks for fixing the python lint errors. |
@gribozavr @modocache Think this is good to merge after I rebase? |
LGTM. @swift-ci Please test |
That test failure is unrelated. |
This change seems to leave me unable to build swift on Fedora Linux. which: no clang-3.8 in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin) ./build-script: Can't find clang. Please install clang-3.5 or a later version. clang exists in /usr/bin currently version 3.7 |
return host_toolchain(xcrun_toolchain, | ||
suffixes=['38', '37', '36', '35']) | ||
return host_toolchain(xcrun_toolchain, | ||
suffixes=['-3.8', '-3.7', '-3.6', '-3.5']) |
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.
suffixes
should contain '',
as before
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.
Yep, you're right. Thanks for catching that! Fixed in master.
Unfortunately this PR broke Python 3 support.
|
What's in this pull request?
A small modification to
swift_build_support
to allow looking up arbitrary commands likellvm-cov
andllvm-profdata
alongsideclang
andclang++
.Resolved bug number: N/A
Will help with SR-237.
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.