Skip to content
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

Cargo install failed #2989

Closed
abdulalalalalala opened this issue Jun 30, 2024 · 3 comments
Closed

Cargo install failed #2989

abdulalalalalala opened this issue Jun 30, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@abdulalalalalala
Copy link

What is the current bug behavior?

Failed to install hurl via cargo, here is the error:

error: failed to run custom build command for `libxml v0.3.3`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installiBco6J/release/build/libxml-01d19effc1719f56/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=LIBXML_2.0_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=LIBXML_2.0_STATIC
  cargo:rerun-if-env-changed=LIBXML_2.0_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

  --- stderr
  thread 'main' panicked at /home/alice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libxml-0.3.3/build.rs:38:5:
  Could not find libxml2.
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `hurl v4.3.0`, intermediate artifacts can be found at `/tmp/cargo-installiBco6J`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Steps to reproduce

cargo install hurl

What is the expected correct behavior?

Install hurl successfully

Execution context

N/A

  • Hurl Version (hurl --version): 4.3

Possible fixes

May be related to #361

@abdulalalalalala abdulalalalalala added the bug Something isn't working label Jun 30, 2024
@jcamiel
Copy link
Collaborator

jcamiel commented Jun 30, 2024

Hi @abdulalalalalala

On which Linux distribution are you trying to build Hurl?

Can you check that you've followed build instructions for Linux on https://hurl.dev/docs/installation.html#build-on-linux?

@abdulalalalalala
Copy link
Author

Hi @abdulalalalalala

On which Linux distribution are you trying to build Hurl?

Can you check that you've followed build instructions for Linux on https://hurl.dev/docs/installation.html#build-on-linux?

indeed. I'm on Fedora 40.

I looked at the dependencies and found libxml2-devel missing in system, which hurl's cargo installation method requires for compilation. After dnf install libxml2-devel, cargo was able to compile ok.

I guessing that may be because a rust lib libxml actually require the host's system to have libxml2-devel from both "hurl_core" and "hurl" workspaces. I think there is alternative to it called xml-rs that doesn't require host to install extra pkg. It can potentially make hurl to be more "distro agnostic"... but that seems way outside of scope to this issue i posted

@jcamiel
Copy link
Collaborator

jcamiel commented Jul 4, 2024

Hi @abdulalalalalala

For the build on Fedora, we should update the docs https://hurl.dev/docs/installation.html#build-on-linux, I'm going to create an issue on that.

For libxml2, we use it for:

This PR #1910 can gives some context on performance gain using libxml2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants