Skip to content

Move flags passed in rust_flags near the end of the rustc invocation.#4135

Merged
slackito merged 2 commits into
bazelbuild:mainfrom
slackito:reorder-rust-flags
Jul 13, 2026
Merged

Move flags passed in rust_flags near the end of the rustc invocation.#4135
slackito merged 2 commits into
bazelbuild:mainfrom
slackito:reorder-rust-flags

Conversation

@slackito

@slackito slackito commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

This allows callers of rustc_compile_action to override the default flags.

The motivating example for making this change was some path remapping done by Crubit (https://github.com/google/crubit/blob/685a46aabbdf6552803c5bd77da6628008d0d245/rs_bindings_from_cc/bazel_support/compile_rust.bzl#L100). PR #4106 added another --remap-path-prefix flag after the code that adds rust_flags to the rustc invocation, and the new remapping took precedence.

This allows callers of rustc_compile_action to override the default
flags.

The motivating example for making this change was some path
remapping done by Crubit (https://github.com/google/crubit/blob/main/rs_bindings_from_cc/bazel_support/compile_rust.bzl#L100).
PR bazelbuild#4106 added another `--remap-path-prefix` flag after the code that
adds `rust_flags` to the rustc invocation, and the new remapping took
precedence.
@slackito
slackito force-pushed the reorder-rust-flags branch from 3faf3da to 6a5f428 Compare July 8, 2026 13:12
@slackito
slackito requested review from UebelAndre and krasimirgg July 8, 2026 13:30
@slackito
slackito added this pull request to the merge queue Jul 13, 2026
Merged via the queue into bazelbuild:main with commit 6c5cc32 Jul 13, 2026
3 checks passed
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.

2 participants