From ca14306860cbbb28563137c042fd0249d780bbb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alessandro=C2=A0Decina?= Date: Sun, 29 Aug 2021 08:01:32 +0000 Subject: [PATCH] aya-gen: use aya_bpf::cty instead of aya_bpf_cty This avoids having to add an explicit extra dep on aya-bpf-cty in ebpf programs --- aya-gen/src/bindgen.rs | 2 +- xtask/src/codegen/aya_bpf_bindings.rs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/aya-gen/src/bindgen.rs b/aya-gen/src/bindgen.rs index 137c25e0..b927d761 100644 --- a/aya-gen/src/bindgen.rs +++ b/aya-gen/src/bindgen.rs @@ -13,7 +13,7 @@ pub fn user_builder() -> Builder { pub fn bpf_builder() -> Builder { bindgen::builder() .use_core() - .ctypes_prefix("::aya_bpf_cty") + .ctypes_prefix("::aya_bpf::cty") .layout_tests(false) .generate_comments(false) .clang_arg("-Wno-unknown-attributes") diff --git a/xtask/src/codegen/aya_bpf_bindings.rs b/xtask/src/codegen/aya_bpf_bindings.rs index dc41d9c6..20cd2262 100644 --- a/xtask/src/codegen/aya_bpf_bindings.rs +++ b/xtask/src/codegen/aya_bpf_bindings.rs @@ -21,6 +21,9 @@ pub fn codegen(opts: &Options) -> Result<(), anyhow::Error> { let builder = || { let mut bindgen = bindgen::bpf_builder() .header(&*dir.join("include/bindings.h").to_string_lossy()) + // aya-gen uses aya_bpf::cty. We can't use that here since aya-bpf + // depends on aya-bpf-bindings so it would create a circular dep. + .ctypes_prefix("::aya_bpf_cty") .clang_args(&[ "-I", &*opts.libbpf_dir.join("include/uapi").to_string_lossy(),