Closed
Description
When compiling a rust program with --remap-path-prefix
in 1.46.0, (and nightlies 1.47.0, 1.48.0) the specified prefixes in the binary are unaltered. I expected them to be changed.
When using 1.45.2 and 1.43.0, it works as expected.
Steps to reproduce
- Make sure you are using rustc >=1.46.0, check via
rustc --version
- Create a new cargo project:
cargo new --bin foo
- Add a dependency to Cargo.toml, for example
regex = "1"
- Add code that uses this dependency, for example:
use regex::Regex;
fn main() {
Regex::new(r"{").unwrap();
}
- Run
RUSTFLAGS=--remap-path-prefix=/home/kasper=bar cargo build --release
, where/home/kasper/
is the prefix you want to change, for example your$HOME
. - Inspect the binary using:
strings target/release/foo | grep kasper
(wherekasper
is something contained in the prefix), and see that it returns several lines.
If the same steps are taken on 1.45.2, step 5 returns no results, as expected.
Notes
The crate and code example is arbitrary, and the same behavior is observed for any combination of crates.
Software versions:
- rustc 1.46.0 (04488af 2020-08-24)
- OS: Linux (Ubuntu 20.04.1 LTS)
The following nightly versions also fail:
Metadata
Metadata
Assignees
Labels
Category: This is a bug.Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcMedium priorityRelevant to the compiler team, which will review and decide on the PR/issue.Performance or correctness regression from one stable version to another.