Skip to content

Fix extra_exec_rustc_flags fallback in rust.toolchain - #4317

Open
thirtyseven wants to merge 1 commit into
bazelbuild:mainfrom
thirtyseven:fix-extra-exec-rustc-flags-fallback
Open

thirtyseven wants to merge 1 commit into
bazelbuild:mainfrom
thirtyseven:fix-extra-exec-rustc-flags-fallback

Conversation

@thirtyseven

Copy link
Copy Markdown

#3911 added extra_exec_rustc_flags_triples to rust.toolchain, but the line choosing between it and the flat extra_exec_rustc_flags tests the wrong attribute:

extra_exec_rustc_flags = toolchain.extra_exec_rustc_flags if toolchain.extra_rustc_flags else toolchain.extra_exec_rustc_flags_triples

As a result:

  • A flat extra_exec_rustc_flags with no flat extra_rustc_flags is silently dropped. The empty extra_exec_rustc_flags_triples dict is passed instead, and _get_flags_for_triple returns None for every triple. This includes configs that use extra_rustc_flags_triples, so it is a regression since 0.71.0 for anyone who already used the flat attribute.
  • extra_exec_rustc_flags_triples together with a flat extra_rustc_flags is ignored, because the empty flat list is passed instead.

This change tests extra_exec_rustc_flags, matching the extra_rustc_flags line above it.

🤖 Generated with Claude Code

@google-cla

google-cla Bot commented Oct 5, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

The choice between the flat extra_exec_rustc_flags and
extra_exec_rustc_flags_triples tested extra_rustc_flags instead of
extra_exec_rustc_flags, so a flat extra_exec_rustc_flags was silently
dropped unless a flat extra_rustc_flags was also set.
@thirtyseven
thirtyseven force-pushed the fix-extra-exec-rustc-flags-fallback branch from 70785c6 to f0b2a85 Compare October 5, 2026 23:44

@MarcusSorealheis MarcusSorealheis left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not a maintainer here but this one is correct.

@Ahajha

Ahajha commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Thanks for catching this!

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants