Skip to content

Commit

Permalink
More debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
illicitonion committed Apr 28, 2021
1 parent b738cbf commit 9ef077c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cargo/cargo_build_script_runner/bin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ fn run_buildrs() -> Result<(), String> {
// directory - resolving these may cause tools which inspect $0, or try to resolve files
// relative to themselves, to fail.
let exec_root = env::current_dir().expect("Failed to get current directory");
visit_dirs(&exec_root).expect("Error walking dirs");
if let Err(err) = visit_dirs(&exec_root) {
eprintln!("DWH: Error from visit_dirs: {:?}", err);
}
let manifest_dir_env = env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR was not set");
let rustc_env = env::var("RUSTC").expect("RUSTC was not set");
let manifest_dir = exec_root.join(&manifest_dir_env);
eprintln!("DWH: Running in manifest_dir: {}", manifest_dir.display());
let rustc = exec_root.join(&rustc_env);
let Options {
progname,
Expand Down Expand Up @@ -279,14 +282,15 @@ fn main() {
}

fn visit_dirs(dir: &Path) -> std::io::Result<()> {
eprintln!("DWH: Visiting dir {}", dir.display());
if dir.is_dir() {
for entry in std::fs::read_dir(dir)? {
let entry = entry?;
let path = entry.path();
if path.is_dir() {
visit_dirs(&path)?;
} else {
println!("{}", dir.join(path).display());
eprintln!("DWH: {}", path.display());
}
}
}
Expand Down

0 comments on commit 9ef077c

Please sign in to comment.