Skip to content

Display LIBXML2 env value on build errors. #122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 18, 2023
Merged

Display LIBXML2 env value on build errors. #122

merged 1 commit into from
Oct 18, 2023

Conversation

jcamiel
Copy link
Contributor

@jcamiel jcamiel commented Oct 18, 2023

This PR add a (very small) improvement in case LIBXML2 env value is misconfigured.
I've encountered this problem while porting Hurl to conda-forge where LIBXML2 value is set to "2.11".

Before the PR:

$ export LIBXML2="2.11"
$ cargo build
   Compiling libxml v0.3.3 (/Users/jc/Documents/Dev/rust-libxml)
error: failed to run custom build command for `libxml v0.3.3 (/Users/jc/Documents/Dev/rust-libxml)`

Caused by:
  process didn't exit successfully: `/Users/jc/Documents/Dev/rust-libxml/target/debug/build/libxml-5bb5ffa4b9ec77c1/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at build.rs:7:5:
  assertion failed: p.is_file()
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

After the PR:

$ export LIBXML2="2.11"
   Compiling libxml v0.3.3 (/Users/jc/Documents/Dev/rust-libxml)
error: failed to run custom build command for `libxml v0.3.3 (/Users/jc/Documents/Dev/rust-libxml)`

Caused by:
  process didn't exit successfully: `/Users/jc/Documents/Dev/rust-libxml/target/debug/build/libxml-5bb5ffa4b9ec77c1/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at build.rs:10:5:
  not a file in LIBXML2 env (2.11)
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

In a nutshell assertion failed: p.is_file() vs not a file in LIBXML2 env (2.11)

(build.rs have been formatted with cargo fmt and lint with cargo clippy)

@jcamiel jcamiel changed the title Display LIBXML2 env value on errors. Display LIBXML2 env value on build errors. Oct 18, 2023
@dginev
Copy link
Member

dginev commented Oct 18, 2023

That sounds reasonable, thank you!

@dginev dginev merged commit 11f1d4a into KWARC:master Oct 18, 2023
@jcamiel jcamiel deleted the display-libxml2-env-value-on-error branch October 18, 2023 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants