From bc6dc2a3128658a58e616505eff1ca262695129c Mon Sep 17 00:00:00 2001 From: Shayne Fletcher Date: Mon, 22 Jan 2024 10:52:28 -0800 Subject: [PATCH] add debug trace to relative_path Summary: i'm running into an issue with reindeer building the buck2 examples in github actions on windows. the 'buckify' command fails with ``` thread '' 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 --- src/buckify.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/buckify.rs b/src/buckify.rs index 3b7894da..a7ffe1bb 100644 --- a/src/buckify.rs +++ b/src/buckify.rs @@ -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?"); }