mirror of https://github.com/aya-rs/aya
Merge pull request #664 from ajwerner/always-initialize-submodules
xtask: ensure libbpf submodule is initializedreviewable/pr629/r37
commit
78ede184bd
@ -1,3 +1,3 @@
|
||||
[submodule "libbpf"]
|
||||
path = libbpf
|
||||
path = xtask/libbpf
|
||||
url = https://github.com/libbpf/libbpf
|
||||
|
@ -0,0 +1,17 @@
|
||||
use anyhow::{anyhow, Context as _, Result};
|
||||
use std::process::Command;
|
||||
|
||||
pub fn exec(cmd: &mut Command) -> Result<()> {
|
||||
let status = cmd
|
||||
.status()
|
||||
.with_context(|| format!("failed to run {cmd:?}"))?;
|
||||
match status.code() {
|
||||
Some(code) => match code {
|
||||
0 => Ok(()),
|
||||
code => Err(anyhow!("{cmd:?} exited with code {code}")),
|
||||
},
|
||||
None => Err(anyhow!("{cmd:?} terminated by signal")),
|
||||
}
|
||||
}
|
||||
|
||||
pub const LIBBPF_DIR: &str = "xtask/libbpf";
|
Loading…
Reference in New Issue