You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
532 B
Rust

use anyhow::{anyhow, Context as _};
use aya_build::cargo_metadata;
fn main() -> anyhow::Result<()> {
let cargo_metadata::Metadata { packages, .. } = cargo_metadata::MetadataCommand::new()
.no_deps()
.exec()
.context("MetadataCommand::exec")?;
let ebpf_package = packages
.into_iter()
.find(|cargo_metadata::Package { name, .. }| name == "{{project-name}}-ebpf")
.ok_or_else(|| anyhow!("{{project-name}}-ebpf package not found"))?;
aya_build::build_ebpf([ebpf_package])
}