Open keith opened 3 months ago
cc @pzembrod for triage cc @oquenchil for potential insights
Not sure what's going on, I'd set a breakpoint (or print) here: https://cs.opensource.google/bazel/bazel/+/master:src/main/starlark/builtins_bzl/common/cc/cc_shared_library.bzl;drc=2abc982ca5a8d1e829613629c8e3b44cf61b58c5;l=295
to see whether the wrapped linker_input has the flag -blah
. A different question which I won't go into is whether it makes sense to do this at all. Headers do not actually contribute anything here since cc_shared_library
only does linking, no compilation and therefore the flag could be added to the cc_shared_library
. The rule doesn't provide CcInfo
either so that flag won't be propagated downstream.
In any case, if you want this to throw an error I'd look first around that code I linked.
Description of the bug:
With this example:
The cc_binary target fails to build, but the cc_shared_library doesn't, it ignores the invalid
-blah
linkopt. If you add an empty cpp file tobaz
it works correctly.Which category does this issue belong to?
No response
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
No response
Which operating system are you running Bazel on?
macOS
What is the output of
bazel info release
?7.1.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
Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
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