From b20b1f1b0aedd6a6e665b39afff91d37ce134634 Mon Sep 17 00:00:00 2001 From: Dave Tucker Date: Fri, 28 Jun 2024 13:01:42 +0100 Subject: [PATCH] chore(xtask): Create bindings dir If the bindings directory doesn't exist then create it. Signed-off-by: Dave Tucker --- xtask/src/codegen/aya_ebpf_bindings.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xtask/src/codegen/aya_ebpf_bindings.rs b/xtask/src/codegen/aya_ebpf_bindings.rs index af400e42..6823864d 100644 --- a/xtask/src/codegen/aya_ebpf_bindings.rs +++ b/xtask/src/codegen/aya_ebpf_bindings.rs @@ -1,4 +1,7 @@ -use std::path::{Path, PathBuf}; +use std::{ + fs::create_dir_all, + path::{Path, PathBuf}, +}; use anyhow::anyhow; use aya_tool::{bindgen, write_to_file_fmt}; @@ -112,6 +115,10 @@ pub fn codegen(opts: &SysrootOptions, libbpf_dir: &Path) -> Result<(), anyhow::E } let generated = dir.join("src").join(arch.to_string()); + if !generated.exists() { + create_dir_all(&generated)?; + } + // write the bindings, with the original helpers removed write_to_file_fmt( generated.join("bindings.rs"),