Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: reorder --remap-path-prefix flags for -Zbuild-std #13065

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions tests/build-std/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,46 @@ fn custom_test_framework() {
.build_std_arg("core")
.run();
}

// Fixing rust-lang/rust#117839.
// on macOS it never gets remapped.
// Might be a separate issue, so only run on Linux.
#[cargo_test(build_std_real)]
#[cfg(target_os = "linux")]
fn remap_path_scope() {
let p = project()
.file(
"src/main.rs",
"
fn main() {
panic!(\"remap to /rustc/<hash>\");
}
",
)
.file(
".cargo/config.toml",
"
[profile.release]
debug = \"line-tables-only\"
",
)
.build();

p.cargo("run --release -Ztrim-paths")
.masquerade_as_nightly_cargo(&["-Ztrim-paths"])
.env("RUST_BACKTRACE", "1")
.build_std()
.target_host()
.with_status(101)
.with_stderr_contains(
"\
[FINISHED] release [optimized + debuginfo] [..]
[RUNNING] [..]
[..]thread '[..]' panicked at [..]src/main.rs:3:[..]",
)
.with_stderr_contains("remap to /rustc/<hash>")
.with_stderr_contains("[..]at std-0.0.0/src/[..]")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why std-0.0.0 remap didn't show up on macOS. Is it an expected result of how backtrace or -Zbuild-std works?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or would be fixed after this rust-lang/rust#118149? I didn't look closer enough though.

.with_stderr_contains("[..]at src/main.rs:3[..]")
.with_stderr_contains("[..]at core-0.0.0/src/[..]")
.run();
}