Skip to content

bootstrap: Builder::cargo treats rustc_args in ways that don't make sense #123228

Closed
@RalfJung

Description

@RalfJung

This was added in #113948:

// set rustc args passed from command line
let rustc_args =
self.config.cmd.rustc_args().iter().map(|s| s.to_string()).collect::<Vec<_>>();
if !rustc_args.is_empty() {
cargo.env("RUSTFLAGS", &rustc_args.join(" "));
}

The issue is, this is a Cargo instance, that has a separate rustflags field. So the RUSTFLAGS env var will be overwritten when this is turned into a Command. (Unfortunately that conversion does not have a sanity check that would notice a RUSTFLAGS value getting lost.)

Cc @rust-lang/bootstrap

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions