Skip to content

Commit 437d9be

Browse files
committed
Implement std::path::absolute()
1 parent bfe9a6b commit 437d9be

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/bootstrap/src/core/builder.rs

+1-12
Original file line numberDiff line numberDiff line change
@@ -447,19 +447,8 @@ impl StepDescription {
447447
return p.clone();
448448
}
449449

450-
#[cfg(windows)]
451-
{
452-
if p.is_absolute() {
453-
panic!("Absolute paths are not supported on Windows");
454-
}
455-
456-
// Strip current directory prefix if present
457-
return path.strip_prefix(".").unwrap_or(path).to_path_buf();
458-
}
459-
460450
// Make the path absolute, strip the prefix, and convert to a PathBuf.
461-
// FIXME: Replace `path.canonicalize()` with `std::path::absolute(path)` to support absolute paths on Windows.
462-
match p.canonicalize() {
451+
match std::path::absolute(p) {
463452
Ok(p) => p.strip_prefix(&builder.src).unwrap_or(&p).to_path_buf(),
464453
Err(e) => {
465454
eprintln!("ERROR: {:?}", e);

0 commit comments

Comments
 (0)