Build requires cargo-libbpf installed
Something's wrong with the libbpf-cargo dependency: cargo build
on a F38 box fails with:
error: failed to run custom build command for `udev-hid-bpf v0.1.0 (/home/whot/code/udev-hid-bpf)`
Caused by:
process didn't exit successfully: `/home/whot/code/udev-hid-bpf/target/debug/build/udev-hid-bpf-b0861b9859995480/build-script-build` (exit status: 101)
--- stdout
cargo:rerun-if-changed=./src/bpf/
cargo:rerun-if-changed=./src/hid_bpf_wrapper.h
--- stderr
Warning: unrecognized map: license
Warning: unrecognized map: version
Warning: unrecognized map: .ksyms
error: no such command: `libbpf`
View all installed commands with `cargo --list`
thread 'main' panicked at 'Failed to remove BPF object in ./target/bpf/attach.bpf.o: Os { code: 2, kind: NotFound, message: "No such file or directory" }', build.rs:34:33
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
This is with a few printfs added for better errors. Note the no such command: libbpf
which weirdly doesn't cause the Command::new()...
to fail. The actual failure is during fs.remove_file()
.
Installing the Fedora libbpf-cargo
gets past this point so it looks like there's an issue with setting up the $PATH
correctly, or maybe we need to use the SkeletonBuilder
API (see the docs).