Skip to content

Commit

Permalink
Fix pdb uplift when executable has dashes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Apr 17, 2020
1 parent f9047dc commit 3acd15e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cargo/core/compiler/build_context/target_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,9 @@ impl TargetInfo {
suffix: ".pdb".to_string(),
prefix: prefix.clone(),
flavor: FileFlavor::DebugInfo,
should_replace_hyphens: false,
// rustc calls the linker with underscores, and the
// filename is embedded in the executable.
should_replace_hyphens: true,
})
}
}
Expand Down
3 changes: 3 additions & 0 deletions tests/testsuite/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4201,6 +4201,7 @@ fn uplift_pdb_of_bin_on_windows() {
let p = project()
.file("src/main.rs", "fn main() { panic!(); }")
.file("src/bin/b.rs", "fn main() { panic!(); }")
.file("src/bin/foo-bar.rs", "fn main() { panic!(); }")
.file("examples/c.rs", "fn main() { panic!(); }")
.file("tests/d.rs", "fn main() { panic!(); }")
.build();
Expand All @@ -4209,6 +4210,8 @@ fn uplift_pdb_of_bin_on_windows() {
assert!(p.target_debug_dir().join("foo.pdb").is_file());
assert!(p.target_debug_dir().join("b.pdb").is_file());
assert!(p.target_debug_dir().join("examples/c.pdb").exists());
assert!(p.target_debug_dir().join("foo-bar.exe").is_file());
assert!(p.target_debug_dir().join("foo_bar.pdb").is_file());
assert!(!p.target_debug_dir().join("c.pdb").exists());
assert!(!p.target_debug_dir().join("d.pdb").exists());
}
Expand Down

0 comments on commit 3acd15e

Please sign in to comment.