Skip to content

fix: preserve ordered conditional rustc flags - #258

Open
dzbarsky wants to merge 1 commit into
mainfrom
fix/preserve-conditional-rustc-flags
Open

dzbarsky wants to merge 1 commit into
mainfrom
fix/preserve-conditional-rustc-flags

Conversation

@dzbarsky

Copy link
Copy Markdown
Member

Preserve argument order and duplicates in rustc_flags and rustc_flags_select. The dependency renderer converted these lists to sets, so repeated -C or --cfg arguments lost their option names. It also made a flag unconditional when only one platform was listed. Render these flag selections directly, retaining an empty default branch.

Added two regression tests covering repeated arguments, platform isolation, and legacy platform labels. Both fail before the fix and pass afterward on Bazel 9.

Assisted by OpenAI Codex.

Do not pass rustc arguments through compute_select, which factors dependency sets by deduplicating, sorting, and hoisting common items. Keep repeated option names next to their values, and keep flags from a single platform conditional on that platform.

Render the select directly in repository_utils without changing rust_crate attributes. Both generated-call regression tests fail before the fix and pass afterward on Bazel 9.

Assisted-by: OpenAI Codex
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.

1 participant