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}" diff --git a/{{project-name}}-ebpf/Cargo.toml b/{{project-name}}-ebpf/Cargo.toml index 370ea43..a3639a8 100644 --- a/{{project-name}}-ebpf/Cargo.toml +++ b/{{project-name}}-ebpf/Cargo.toml @@ -13,5 +13,12 @@ aya-log-ebpf = { workspace = true } which = { workspace = true } [[bin]] -name = "{{ project-name }}" +name = "{{ project-name }}_ebpf" path = "src/main.rs" + +# Tip: if you want to get aya-ebpf documentation in your crate docs, try +# running `cargo doc --all`. This block makes cargo doc skip the dummy library +# (see {{ project-name }}/Cargo.toml for more details) +[lib] +name = "{{ project-name | snake_case }}_ebpf_dummy" +doc = false diff --git a/{{project-name}}/src/main.rs b/{{project-name}}/src/main.rs index b558ec8..c40b800 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" )))?; match aya_log::EbpfLogger::init(&mut ebpf) { Err(e) => {