Building kprobe is not currently as easy as it could be. The streamlined build processes have not been maintained in years so the required docker images can no longer be created. The previous build instructions can be found at the bottom of this document but are not recommended nor guaranteed to work.
Kprobe is built using the Rust toolchain. The current known working path to success assumes that builds are done from a recent version of macOS without the use of any images.
kprobe is distributed as a static binary linked with musl libc which requires a proper cross compilation environment.
To set this up on macOS:
Install the musl-cross homebrew package:
brew install filosottile/musl-cross/musl-crossAdd the following lines to ~/.cargo/config:
[target.x86_64-unknown-linux-musl]
ar = "x86_64-linux-musl-ar"
linker = "x86_64-linux-musl-gcc"And add the musl target to rust:
rustup target add x86_64-unknown-linux-muslThe static libraries required to build kprobe are assumed to exist in the
{REPO_ROOT}/libs/ directory. Originally, these libraries were built using
the kprobe-libs repository. Unfortunately, the build process outlined in
that repository in no longer functional and new processes must be developed.
Instructions for building new versions of libkflow can be found in the musl-libkflow repo
Do not forget to commit the updated libraries.
With all of that setup out of the way building kprobe is straightforward.
cargo build --release --target x86_64-unknown-linux-muslcargo build --releaseThese can be found in LEGACY README. They are not recommended