Skip to content

Cargo should provide --remap-path-prefix or not hash it from RUSTFLAGS. #6914

Closed
@eddyb

Description

@eddyb

After #6503, reproducible build setups that were setting RUSTFLAGS="--remap-path-prefix=..." in order to normalize paths in rustc, stopped being reproducible, as Cargo is now hashing the whole RUSTFLAGS value, resulting in different -C metadata values.

This was originally reported in rust-lang/rust#59542, and one of the solutions suggested there was that Cargo should provide its own --remap-path-prefix, which would not be hashed, and that becomes the supported way set this flag.

Another possibility could be Cargo parsing --remap-path-prefix out of RUSTFLAGS, before hashing the rest, but that seems perhaps a bit brittle.

cc @michaelwoerister @Eh2406

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions