We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
std::path::absolute()
1 parent bfe9a6b commit 437d9beCopy full SHA for 437d9be
src/bootstrap/src/core/builder.rs
@@ -447,19 +447,8 @@ impl StepDescription {
447
return p.clone();
448
}
449
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
460
// 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() {
+ match std::path::absolute(p) {
463
Ok(p) => p.strip_prefix(&builder.src).unwrap_or(&p).to_path_buf(),
464
Err(e) => {
465
eprintln!("ERROR: {:?}", e);
0 commit comments