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: merge trim-paths from different profiles #12908

Merged
merged 2 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
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
Prev Previous commit
fix(trim-paths): merge trim-paths from different profiles
In 4d29af1 we forgot to add trim-paths to `fn merge()`.
This commit follows how `-Zprofile-rustflags` works ---
overriding instead of merging array.
  • Loading branch information
weihanglo committed Nov 2, 2023
commit 7535971d8b1d6b060796e6fb59d6964b9451adb7
4 changes: 4 additions & 0 deletions src/cargo/util/toml/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3007,6 +3007,10 @@ impl TomlProfile {
if let Some(v) = &profile.strip {
self.strip = Some(v.clone());
}

if let Some(v) = &profile.trim_paths {
self.trim_paths = Some(v.clone())
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/profile_trim_paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ fn profile_merge_works() {
"\
[COMPILING] foo v0.0.1 ([CWD])
[RUNNING] `rustc [..]\
-Zremap-path-scope=macro \
-Zremap-path-scope=diagnostics \
--remap-path-prefix=[..]/lib/rustlib/src/rust=/rustc/[..] \
--remap-path-prefix=[CWD]= [..]
[FINISHED] custom [..]",
Expand Down