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.
aya/xtask/src/build_test.rs

30 lines
705 B
Rust

use clap::Parser;
use std::process::Command;
use crate::build_ebpf;
#[derive(Parser)]
pub struct Options {
/// Whether to compile for the musl libc target
#[clap(short, long)]
pub musl: bool,
#[clap(flatten)]
pub ebpf_options: build_ebpf::Options,
}
pub fn build_test(opts: Options) -> anyhow::Result<()> {
build_ebpf::build_ebpf(opts.ebpf_options)?;
let mut args = vec!["build", "-p", "integration-test", "--verbose"];
if opts.musl {
args.push("--target=x86_64-unknown-linux-musl");
}
let status = Command::new("cargo")
.args(&args)
.status()
.expect("failed to build bpf program");
assert!(status.success());
Ok(())
}