Skip to content

Commit

Permalink
Enable unwinding in userspace
Browse files Browse the repository at this point in the history
  • Loading branch information
tamird committed Nov 26, 2024
1 parent 8838dd0 commit 51e5e13
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 23 deletions.
6 changes: 0 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 11 additions & 5 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF
set timeout 30 ;# Increase timeout if necessary
Expand Down
12 changes: 0 additions & 12 deletions {{project-name}}-ebpf/.cargo/config.toml

This file was deleted.

0 comments on commit 51e5e13

Please sign in to comment.