-
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
--per_file_copt=external/.*
no longer working in Bazel 7.4
#24528
Comments
What happens if you also specify |
It is working for Bazel itself: Lines 53 to 58 in f5abf15
@mering Does Fabian's suggestion work? Can you provide a minimal repo? |
@meteorcloudy thanks for confirming that the syntax didn't change. @fmeum Indeed, this reduces the number of failures significantly. From a brief look over the remaining issues, it seems that most (or all?) remaining issues are related to |
It seems to error out already for compiling the
So this seems to pass the normal CFLAGS='-U_FORTIFY_SOURCE --target=x86_64-unknown-linux-gnu -U_FORTIFY_SOURCE -fstack-protector -fno-omit-frame-pointer -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign -g0 -O2 -D_FORTIFY_SOURCE=1 -DNDEBUG -ffunction-sections -fdata-sections -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__=redacted -D__TIMESTAMP__=redacted -D__TIME__=redacted -fdebug-prefix-map=/b/f/w/external/toolchains_llvm~~llvm~llvm_toolchain_llvm/=__bazel_toolchain_llvm_repo__/ -Werror' Is there a way to pass a |
I guess not? But it's better to check with the rules_foreign_cc maintainer. |
What would be the best way for |
I don't think it's possible because the values of per_file_copt are not exposed to starlark. I workaround this by duplicating the options onto any rules_foreign_cc targets (which then applies to all files not just a single file) unfortunately. |
@keith Thanks for sharing your insights. Unfortunately, some of the rules_foreign_cc targets come in as transitive dependencies where we don't have control over in the root module. Do you have any recommendations on how one could set the options in this case? |
practically speaking you'd have to use patches somehow. long term i agree that bazel should expose this, but unfortunately that would likely also depend on starlark having a regex API 🙃 |
@keith Do you know if there is a way to pass |
im going to dedup with #14764 and comment on those upstream issues |
Description of the bug:
We use the following to disable warnings on external dependencies and build our own code with
-Werror
:Unfortunately, this does no longer work in Bazel 7.4 (it worked before) and the
external/.*
regex doesn't seem to catch external paths any more (even though the paths in the warnings/errors start withexternal/
).How can I match all external repos with
--per_file_copt
in Bazel 7.4?Which category does this issue belong to?
Core
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
This might be limited to non-module dependencies.
Which operating system are you running Bazel on?
Linux
What is the output of
bazel info release
?7.4.1
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
If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.
It worked in Bazel 7.0.2 but our repo doesn't build with the old version any more.
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: