Skip to content

Commit 3595de3

Browse files
committed
Handle Windows extended-length path in dep-info.
1 parent b1b9b79 commit 3595de3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/cargo/core/compiler/fingerprint.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -1571,7 +1571,13 @@ pub fn translate_dep_info(
15711571

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

0 commit comments

Comments
 (0)