-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add support for params files for darwin #12265
Add support for params files for darwin #12265
Conversation
@oquenchil I would love this to make the 3.8 cut if possible |
1d1adff
to
97bec0c
Compare
rebased and added a test for the new behavior |
Looks like I actually have to make some more fixes here and add the objc link actions to here: bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java Lines 515 to 540 in a3a00f2
Right off the bat it looks like that breaks when passing |
src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java
Outdated
Show resolved
Hide resolved
There's an issue where currently the params files conflict if you run a build for multiple architectures at once. I would have expected this to have been solved for C++ even. Looking into it |
That's surprising--I would have thought they would have been differentiated by the output configuration dir? |
Same, it's very easy to repro tho: % cat BUILD
apple_binary(
name = "bin",
minimum_os_version = "10.0",
platform_type = "ios",
deps = [":lib"],
)
objc_library(
name = "lib",
srcs = ["main.m"],
)
|
I think it's because the configuration of the params files is the same, since it's the exec configuration not the target configuration? |
So I discovered that in some case a different configuration was being used for the link actions, which fixes this params file issue. I had to make the change for fully linked static libraries and for multi arch executables. The big question now is what other things might this break? |
I'll have to check the windows tests, but everything for darwin passes now. But I would love some assurance from someone who knows this logic better whether or not the configuration changes make any sense. |
src/main/java/com/google/devtools/build/lib/rules/objc/AppleBinary.java
Outdated
Show resolved
Hide resolved
4f6d6d9
to
6819586
Compare
The windows test failures appear to have been a fluke. Fixed after a rebase. So this might be good to go |
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.
LGTM
Thanks for the review! Btw, is this being imported? (I never know if that's implicit with the +1) |
It should be. Generally, it's the "sponsor" of the pull request who does it, who is @oquenchil in this case. |
How do we know who the sponsor is? I will admit that the current process confuses me as well, it's not clear to me when it's being imported. Can we get a label or something? |
Thanks everyone! |
Unfortunately, this had to be rolled back because it broke tests internally. |
Here's the update for rules_go bazel-contrib/rules_go#2699 |
These are dup'd from bazel core and are changing in bazelbuild/bazel#12265
I think once those 2 issues are resolved we should be good to give it another go |
This is required for bazelbuild/bazel#12265
I merged the first one, please ping this thread when the rules_go PR is merged, then I will submit this again. Regarding testing with downstream, the information is here: You have to request access but they will definitely grant it to you. |
The macOS toolchain is gaining support for params files for link commands. As part of this we're removing support for arguments with leading `@`s. This change should be a no-op. bazelbuild/bazel#12265
Ok rules_go is merged, the fix for rules_cc is here bazelbuild/rules_cc#89 because that repo duplicates the wrappers I changed here |
I re-ran a downstream build after the rules_go fix merged https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/1755#_ going to look at tensorflow once more |
Ok I figured it out, tensorflow is building with Xcode 10.3, which doesn't support params files to libtool. AFAIK 10.3 isn't really considered supported at this point (since Apple doesn't allow uploads to the store with it) so I've submitted this change attempting to bump the Xcode version it uses: bazelbuild/continuous-integration#1057 |
@oquenchil this should be ready for you again! Tensorflow passed now that the Xcode version has been bumped https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/1757 So the last thing is this rules_cc change! bazelbuild/rules_cc#89 |
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.
LGTM
0ba1515
to
00002cd
Compare
Rebased to resolve the conflict! |
Clang has supported params files for a while now. This updates the cc toolchain for darwin to use them. The logic for processing response files is mostly copied from rules_swift where similar processing is done.
00002cd
to
7d17c64
Compare
Rebased to resolve my other conflict 😛 |
I started another downstream build because I assume we have some time here https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/1760#7612b6a6-0422-4580-b2a3-e78791c31297 |
Seems like |
Thanks for all the help! |
Clang has supported params files for a while now. This updates the cc toolchain for darwin to use them. The logic for processing response files is mostly copied from rules_swift where similar processing is done. Closes bazelbuild#12265. PiperOrigin-RevId: 342013390
Clang has supported params files for a while now. This updates the cc
toolchain for darwin to use them.
The logic for processing response files is mostly copied from
rules_swift where similar processing is done.