Browse Source

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
Alessandro Decina 3 years ago
parent
commit
ca14306860
2 changed files with 4 additions and 1 deletions
  1. 1 1
      aya-gen/src/bindgen.rs
  2. 3 0
      xtask/src/codegen/aya_bpf_bindings.rs

+ 1 - 1
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")

+ 3 - 0
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(),