From 962567c480b9e9fd6d8a978e9da6ab998d47a89d Mon Sep 17 00:00:00 2001 From: miniduikboot Date: Tue, 29 Apr 2025 23:23:57 +0200 Subject: [PATCH 1/2] Rename output of -ebpf crate This makes it possible to run `cargo doc --workspace` and get both the eBPF and normal crate and their dependencies in the output docs. Fixes: https://github.com/aya-rs/aya/issues/1260 --- {{project-name}}-ebpf/Cargo.toml | 2 +- {{project-name}}/src/main.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/{{project-name}}-ebpf/Cargo.toml b/{{project-name}}-ebpf/Cargo.toml index 8c4a0f3..0b03bba 100644 --- a/{{project-name}}-ebpf/Cargo.toml +++ b/{{project-name}}-ebpf/Cargo.toml @@ -13,5 +13,5 @@ aya-log-ebpf = { workspace = true } which = { workspace = true } [[bin]] -name = "{{ project-name }}" +name = "{{ project-name }}_ebpf" path = "src/main.rs" diff --git a/{{project-name}}/src/main.rs b/{{project-name}}/src/main.rs index c1d3483..f8580aa 100644 --- a/{{project-name}}/src/main.rs +++ b/{{project-name}}/src/main.rs @@ -94,7 +94,7 @@ async fn main() -> anyhow::Result<()> { // reach for `Bpf::load_file` instead. let mut ebpf = aya::Ebpf::load(aya::include_bytes_aligned!(concat!( env!("OUT_DIR"), - "/{{project-name}}" + "/{{project-name}}_ebpf" )))?; if let Err(e) = aya_log::EbpfLogger::init(&mut ebpf) { // This can happen if you remove all log statements from your eBPF program. From 679eaabb9ae656fa4628efe9f7dd91f092a9e9ad Mon Sep 17 00:00:00 2001 From: miniduikboot Date: Tue, 29 Apr 2025 23:41:21 +0200 Subject: [PATCH 2/2] Check in CI if unified docs can be generated --- test.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test.sh b/test.sh index 76076ef..96a2b9f 100755 --- a/test.sh +++ b/test.sh @@ -116,6 +116,9 @@ case $OS in eof { } } EOF + + # Check if documentation can be generated for both the userspace and eBPF side at the same time + cargo doc --workspace ;; *) echo "Unsupported OS: ${OS}"