Skip to content

Commit

Permalink
Display LIBXML2 env value on errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcamiel authored and dginev committed Oct 18, 2023
1 parent da4369a commit 11f1d4a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@ fn main() {
// println!("{:?}", std::env::vars());
// panic!("set libxml2.");
let p = std::path::Path::new(s);
let fname = std::path::Path::new(p.file_name().expect("no file name in LIBXML2 env"));
assert!(p.is_file());
let fname = std::path::Path::new(
p.file_name()
.unwrap_or_else(|| panic!("no file name in LIBXML2 env ({s})")),
);
assert!(
p.is_file(),
"{}",
&format!("not a file in LIBXML2 env ({s})")
);
println!(
"cargo:rustc-link-lib={}",
fname
Expand Down

0 comments on commit 11f1d4a

Please sign in to comment.