Description
Background
If you try to install near-cli-rs with cargo: cargo install near-cli-rs
it will throw an error because libudev package is missing.
Though this error can be fixed by installing libudev: sudo apt install build-essential cmake pkg-config libudev-dev
, it is not very user-friendly. I think, it will be good to either mention this situation in docs or modify installation process.
Not sure, but this can be related #319
Error message:
error: failed to run custom build command for hidapi v2.6.3
Caused by:
process didn't exit successfully: /tmp/cargo-installcjGkUp/release/build/hidapi-1b417b688a243afd/build-script-build (exit status: 101)
--- stdout
cargo:rustc-check-cfg=cfg(hidapi)
cargo:rustc-check-cfg=cfg(libusb)
cargo:rerun-if-changed=etc/hidapi/linux/hid.c
cargo:rerun-if-env-changed=LIBUDEV_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=LIBUDEV_STATIC
cargo:rerun-if-env-changed=LIBUDEV_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
cargo:rerun-if-env-changed=LIBUDEV_STATIC
cargo:rerun-if-env-changed=LIBUDEV_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/yura-sharko/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hidapi-2.6.3/build.rs:61:54:
Unable to find libudev: Could not run PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags libudev
The pkg-config command could not be found.
Most likely, you need to install a pkg-config package for your OS.
Try apt install pkg-config, or yum install pkg-config,
or pkg install pkg-config, or apk add pkgconfig depending on your distribution.
If you've already installed it, ensure the pkg-config command is one of the
directories in the PATH environment variable.
If you did not expect this build to link to a pre-installed system library,
then check documentation of the hidapi crate for an option to
build the library from source, or disable features or dependencies
that require pkg-config.
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 near-cli-rs v0.17.0, intermediate artifacts can be found at /tmp/cargo-installcjGkUp.
To reuse those artifacts with a future compilation, set the environment variable CARGO_TARGET_DIR to that path.
User Story
I have just installed a new OS and was setting it up for work with near. I decided to install near-cli-rs
, and, because it's written in rust, I naturally tried to install it with cargo. But I got an error.
OS: Ubuntu 24.04.1
Steps to reproduce:
- Make sure you have no
near-cli-rs
installed - Make sure you have no
libudev
installed - Run
cargo install near-cli-rs
Acceptance Criteria
Mention libudev
in the docs https://docs.near.org/tools/near-cli
or
Modify the installation process
Resources & Additional Notes
No response
Priority
🟡 P2 : Medium
Metadata
Assignees
Labels
Type
Projects
Status
Shipped 🚀
Activity