Skip to content

Teach cc_args to interop with BuildSettingInfo#599

Open
dzbarsky wants to merge 2 commits intobazelbuild:mainfrom
dzbarsky:zbarsky/new-arg
Open

Teach cc_args to interop with BuildSettingInfo#599
dzbarsky wants to merge 2 commits intobazelbuild:mainfrom
dzbarsky:zbarsky/new-arg

Conversation

@dzbarsky
Copy link
Contributor

@dzbarsky dzbarsky commented Feb 8, 2026

No description provided.

@dzbarsky dzbarsky force-pushed the zbarsky/new-arg branch 3 times, most recently from 18b2481 to 483be8b Compare February 8, 2026 13:39
if VariableInfo in target:
return "%%{%s}" % target[VariableInfo].name
elif BuildSettingInfo in target:
return _format_build_setting(target, fail = fail)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: consistency-wise it seems odd that we pass in target[Provider].field above and below (in escape), but just pass in target here. Maybe for consistency sake pass in target[BuildSettingInfo].value here and then omit the first line of the function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

)
c_compile.files().contains_at_least(_SIMPLE_FILES)

def _build_setting_format_test(env, targets):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a test that sets the flag to a new value and validates that the new value is used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

@armandomontanez armandomontanez added type: feature request Request for new, generally useful functionality that is missing P2 We'll consider working on this in future. (Assignee optional) category: toolchains labels Feb 9, 2026
@dzbarsky
Copy link
Contributor Author

dzbarsky commented Feb 9, 2026

@trybka feedback addressed, PTAL!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: toolchains P2 We'll consider working on this in future. (Assignee optional) type: feature request Request for new, generally useful functionality that is missing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants