Skip to content

Commit

Permalink
Handle Windows extended-length path in dep-info.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Jul 25, 2019
1 parent b1b9b79 commit 3595de3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/cargo/core/compiler/fingerprint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1571,7 +1571,13 @@ pub fn translate_dep_info(

let mut new_contents = Vec::new();
for file in deps {
let file = rustc_cwd.join(file);
let file = if cfg!(windows) && file.starts_with("\\\\?\\") {
// Remove Windows extended-length prefix, since functions like
// strip_prefix won't work if you mix with traditional dos paths.
PathBuf::from(&file[4..])
} else {
rustc_cwd.join(file)
};
let (ty, path) = if let Ok(stripped) = file.strip_prefix(target_root) {
(DepInfoPathType::TargetRootRelative, stripped)
} else if let Ok(stripped) = file.strip_prefix(pkg_root) {
Expand Down

0 comments on commit 3595de3

Please sign in to comment.