Validate variables_extension passed to the linking APIs - #845
Open
fmeum wants to merge 1 commit into
Open
Conversation
fmeum
marked this pull request as ready for review
August 12, 2026 10:41
fmeum
marked this pull request as draft
August 12, 2026 10:49
fmeum
marked this pull request as ready for review
August 12, 2026 10:51
fmeum
force-pushed
the
variables-extension-validation
branch
from
August 12, 2026 12:38
69f7423 to
95519a3
Compare
fmeum
marked this pull request as draft
August 12, 2026 12:39
fmeum
marked this pull request as ready for review
August 13, 2026 09:03
lilygorsheneva
previously approved these changes
Aug 14, 2026
pzembrod
previously approved these changes
Aug 18, 2026
pzembrod
left a comment
Collaborator
There was a problem hiding this comment.
This seems to have a conflict with head - could you rebase?
The compile APIs reject variables_extension values that are not strings, string lists or string depsets, but cc_common.link and cc_common.create_linking_context_from_compilation_outputs merged the dict into the link build variables unchecked. Build variable values are stored as opaque objects and only converted when the toolchain expands them, so an unsupported value is not a Starlark error: it either stays unnoticed, if no flag group references the variable, or fails a ClassCastException deep in the command line construction, far away from the API call that supplied it. Extract the existing compile-side check into validate_variables_extension and call it from create_cc_link_actions, which both public linking entry points funnel through and which also forwards the variables to the LTO indexing action.
fmeum
force-pushed
the
variables-extension-validation
branch
from
August 18, 2026 15:12
95519a3 to
38d8162
Compare
Collaborator
Author
|
@pzembrod Done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The compile APIs reject
variables_extensionvalues that are not strings, string lists or string depsets, butcc_common.linkandcc_common.create_linking_context_from_compilation_outputsmerged the dict into the link build variables unchecked, which could cause a Bazel crash on an unsupported value type.