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

Issue with building kern side of code. #48

Open
0xMimir opened this issue Feb 5, 2024 · 0 comments
Open

Issue with building kern side of code. #48

0xMimir opened this issue Feb 5, 2024 · 0 comments

Comments

@0xMimir
Copy link

0xMimir commented Feb 5, 2024

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-btf

Second part of script executes this command:

sed -i s/ty__/type/g bpfel-unknown-none/release/bpf-recorder-kern

First 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.

@0xMimir 0xMimir mentioned this issue Feb 8, 2024
0xMimir added a commit to 0xMimir/mina-network-debugger that referenced this issue Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant