-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
To build kern side of bpf debugger, this build script is used,
First part of script which is commented out executes this command:
CARGO_TARGET_DIR=target/bpf cargo +nightly-2022-10-10 rustc --package=bpf-recorder --bin=bpf-recorder-kern --features=kern --no-default-features --target=bpfel-unknown-none -Z build-std=core --release -- -Cdebuginfo=2 -Clink-arg=--disable-memory-builtins -Clink-arg=--keep-btfSecond part of script executes this command:
sed -i s/ty__/type/g bpfel-unknown-none/release/bpf-recorder-kernFirst part being commented out, means that sed command can be ran on outdated code, or that it doesn't get ran on new code,
This can lead to following error:
libbpf: map 'event_queue': unknown field 'ty__'.
libbpf: failed to initialize skeleton BPF object 'bpf-recorder': -95
thread 'main' panicked at bpf-recorder/src/main.rs:1184:32:
failed to open bpf: -95
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Simple fix is to add following line to build.rs
println!("cargo:rerun-if-changed={}", target_dir);But better solution would be to fix first step, which currently works when ran outside script but not in it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels