From 46b57347b4904414399c5cfdc1893e5534211fb6 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Tue, 26 Nov 2024 15:01:29 -0500 Subject: [PATCH] Enable unwinding in userspace --- Cargo.toml | 6 ------ test.sh | 16 +++++++++++----- {{project-name}}-ebpf/.cargo/config.toml | 12 ------------ 3 files changed, 11 insertions(+), 23 deletions(-) delete mode 100644 {{project-name}}-ebpf/.cargo/config.toml diff --git a/Cargo.toml b/Cargo.toml index b8ee240..a2b2c84 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,12 +21,6 @@ log = { version = "0.4.22", default-features = false } tokio = { version = "1.40.0", default-features = false } which = { version = "6.0.0", default-features = false } -[profile.dev] -panic = "abort" - -[profile.release] -panic = "abort" - [profile.release.package.{{project-name}}-ebpf] debug = 2 codegen-units = 1 diff --git a/test.sh b/test.sh index 570e13a..beaba75 100755 --- a/test.sh +++ b/test.sh @@ -77,12 +77,18 @@ case $OS in cargo +nightly fmt --all -- --check cargo build --package "${CRATE_NAME}" cargo build --package "${CRATE_NAME}" --release - # We cannot run clippy over the whole workspace at once due to feature unification. Since both - # ${CRATE_NAME} and ${CRATE_NAME}-ebpf depend on ${CRATE_NAME}-common and ${CRATE_NAME} activates - # ${CRATE_NAME}-common's aya dependency, we end up trying to compile the panic handler twice: once - # from the bpf program, and again from std via aya. + # We can't run clippy over the entire workspace all at once because we need panic=abort for the + # ${CRATE_NAME}-ebpf crate and that is provided via the target profile. + # + # We can't use --all-targets on ${CRATE_NAME}-ebpf because we only build core which doesn't have + # libtest. + # + # These concerns aside, we also cannot run clippy over the whole workspace at once due to feature + # unification. Since both ${CRATE_NAME} and ${CRATE_NAME}-ebpf depend on ${CRATE_NAME}-common and + # ${CRATE_NAME} activates ${CRATE_NAME}-common's aya dependency, we end up trying to compile the + # panic handler twice: once from the bpf program, and again from std via aya. cargo clippy --exclude "${CRATE_NAME}-ebpf" --all-targets --workspace -- --deny warnings - cargo clippy --package "${CRATE_NAME}-ebpf" --all-targets -- --deny warnings + cargo clippy --package "${CRATE_NAME}-ebpf" -Z build-std=core --target bpfel-unknown-none -- --deny warnings expect <