-
Notifications
You must be signed in to change notification settings - Fork 4k
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
@bazel_tool//tools/cpp:link_extra_libs
should not propagate to exec config
#22457
Comments
I'm sure this is just a matter of flipping bazel/src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java Lines 125 to 126 in 4d22505
We flipped that in the org-wide .bazelrc in b/292617118 but not by default. I think it's reasonable to flip it here, combined with an announcement to bazel@head users on how to fix potential breakages. How about I put up a PR and we'll see if standard Bazel CI passes as a starting point? |
@gregestren I'm in favor of flipping it, but we should follow the incompatible change procedure. |
Is it a good idea to default |
Ah, I didn't realize that As a user, I personally would like to see this flag flipped, but I haven't looked deeply into the pros and cons. What I do feel strongly about (as a developer of a library that's built in both places) is that we should set the flag to the same default value both internally and in open-source Bazel! |
@gregestren What do you think about:
|
@aranguyen has a proposal for a proper flag propagation model that they intend to implement in June. Which I think would cover 1. I'll see if I can share the proposal next week. That sequence generally sounds fine. |
Description of the feature request:
The C++ compilation rules have a neat feature: they allow you to specify a library that should be a linktime dependency of all
cc_binary
targets. That library is configured through a label flag,@bazel_tool//tools/cpp:link_extra_libs
.Unfortunately, this label flag persists across the transition from the target to the exec configuration. This is very inconvenient: if the
link_extra_libs
you want for the target platform include generated code, you run into circular dependencies when trying to build any binaries used in their generation. This tends to happen with some Pigweed libraries, preventing us from usinglink_extra_libs
in most cases.@gregestren I recall that internally we've done some work to restrict flag propagation to the exec config (b/292617118). What's the status on the open source side?
Which category does this issue belong to?
Configurability
What underlying problem are you trying to solve with this feature?
No response
Which operating system are you running Bazel on?
No response
What is the output of
bazel info release
?release 7.1.2
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: