|
|
|
@ -43,7 +43,6 @@ pub fn build_ebpf(opts: Options) -> Result<(), anyhow::Error> {
|
|
|
|
|
let dir = PathBuf::from("{{project-name}}-ebpf");
|
|
|
|
|
let target = format!("--target={}", opts.target);
|
|
|
|
|
let mut args = vec![
|
|
|
|
|
"+nightly",
|
|
|
|
|
"build",
|
|
|
|
|
"--verbose",
|
|
|
|
|
target.as_str(),
|
|
|
|
@ -53,8 +52,14 @@ pub fn build_ebpf(opts: Options) -> Result<(), anyhow::Error> {
|
|
|
|
|
if opts.release {
|
|
|
|
|
args.push("--release")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Command::new creates a child process which inherits all env variables. This means env
|
|
|
|
|
// vars set by the cargo xtask command are also inherited. RUSTUP_TOOLCHAIN is removed
|
|
|
|
|
// so the rust-toolchain.toml file in the -ebpf folder is honored.
|
|
|
|
|
|
|
|
|
|
let status = Command::new("cargo")
|
|
|
|
|
.current_dir(dir)
|
|
|
|
|
.env_remove("RUSTUP_TOOLCHAIN")
|
|
|
|
|
.args(&args)
|
|
|
|
|
.status()
|
|
|
|
|
.expect("failed to build bpf program");
|
|
|
|
|