-
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
"compiler_files" within "CcToolchainInfo" is always empty when accessed in Starlark #22454
Comments
I don't see any evidence or trace in the code base that would make Please provide a reproducer for one of the unmodified Bazel releases. |
@comius Please check out my reproduction repo here. This is written to use The output of:
is:
What's also interesting is that the compiler files field that I'm trying to access doesn't seem to be documented here. Is there not a sanctioned way to access only compiler files for custom actions? |
A mistake I made here,
We have custom aspects that run C/C++ lint actions on our large codebase. The linters only require access to |
Since it seems you have a modified version of bazel, I can suggest that you remove the protection of the field. In both cases, there's a warning that we will change the contents of that field in the future, from list of files to FilesToRun to better support runfiles. That's the risk, but I'm guessing it should be easy to fix the code. |
@comius I'll give it a shot, glad to hear it's exposed at head now. Thanks! |
Description of the bug:
When creating a hermetic toolchain with
cc_toolchain()
, we provide an exact list of files required for compilation throughcompiler_files
. This list of files is sandboxed as expected when using native C/C++ rules, or when performing compilation throughcc_common.compile
.I would expect that after resolving the toolchain in Starlark and calling
CcToolchainInfo.compiler_files
, I would receive that same list of files, but this is not the case. The returned list of files is always empty,[]
. As a result, we have to useCcToolchainInfo.all_files
, which is a significantly larger set of files than we require.The impact of this is that all actions registered through
ctx.actions.run
which would otherwise require onlycompile_files
, have to use the entirety ofall_files
, causing significant bloat to the inputs of these actions.Which category does this issue belong to?
Starlark Integration
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?
Linux
What is the output of
bazel info release
?$ bazel info release INFO: Invocation ID: d38d4c0b-c82e-47b0-b085-3da34eba379d release 6.4.0- (@non-git)
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.Our organization has made minor tweaks to facilitate coverage generation in our repository. I would not expect these changes to influence this issue. https://github.com/SibrosTech/bazel
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
The text was updated successfully, but these errors were encountered: