From bd336acb020ab39ab4ff9d9ef6157cce7aed87f8 Mon Sep 17 00:00:00 2001 From: Michal Rostecki Date: Wed, 4 May 2022 12:56:23 +0200 Subject: [PATCH] aya-gen: Disable Debug derive for BTF types It's a workaround for the upstream bindgen issue: https://github.com/rust-lang/rust-bindgen/issues/2083 tl;dr: Rust nightly complains about #[repr(packed)] structs deriving Debug without Copy. It needs to be fixed properly upstream, but for now we have to disable Debug derive here. Signed-off-by: Michal Rostecki --- aya-gen/src/bindgen.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aya-gen/src/bindgen.rs b/aya-gen/src/bindgen.rs index b927d761..45a6062f 100644 --- a/aya-gen/src/bindgen.rs +++ b/aya-gen/src/bindgen.rs @@ -19,4 +19,11 @@ pub fn bpf_builder() -> Builder { .clang_arg("-Wno-unknown-attributes") .default_enum_style(EnumVariation::ModuleConsts) .prepend_enum_name(false) + // NOTE(vadorovsky): It's a workaround for the upstream bindgen issue: + // https://github.com/rust-lang/rust-bindgen/issues/2083 + // tl;dr: Rust nightly complains about #[repr(packed)] structs deriving + // Debug without Copy. + // It needs to be fixed properly upstream, but for now we have to + // disable Debug derive here. + .derive_debug(false) }