Skip to content

Commit

Permalink
add debug trace to relative_path
Browse files Browse the repository at this point in the history
Summary:
i'm running into an issue with reindeer building the buck2 examples in github actions on windows. the 'buckify' command fails with
```
        thread '<unnamed>' panicked at src\buckify.rs:111:30:
        root dir not prefix of other?
```
adding this debug trace will hopefully be useful in working out what's going wrong.

Reviewed By: dtolnay

Differential Revision: D52963374

fbshipit-source-id: 3aeb88141dc2d3b15c9c20b8b54cd576e73e2ea4
  • Loading branch information
Shayne Fletcher authored and facebook-github-bot committed Jan 22, 2024
1 parent f29a1b6 commit bc6dc2a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/buckify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ pub fn relative_path(mut base: &Path, to: &Path) -> PathBuf {
let mut res = PathBuf::new();

while !to.starts_with(base) {
log::debug!(
"relative_path: to={}, base={}, res={}",
to.display(),
base.display(),
res.display()
);
res.push("..");
base = base.parent().expect("root dir not prefix of other?");
}
Expand Down

0 comments on commit bc6dc2a

Please sign in to comment.