Skip to content

Commit 11a60fb

Browse files
committed
fix: 强化cargo安装失败时的错误处理
1 parent d10f1fa commit 11a60fb

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

frame-analyzer/build.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,19 @@ fn build_ebpf() -> Result<()> {
9393
ebpf_args.push("--debug");
9494

9595
let _ = fs::remove_dir_all(target_dir.join("bin")); // clean up
96-
Command::new("cargo")
96+
let status = Command::new("cargo")
9797
.args(["install", "frame-analyzer-ebpf"])
98+
.arg("--force")
9899
.args(ebpf_args)
99100
.args(["--root", target_dir_str])
100101
.env_remove("RUSTUP_TOOLCHAIN")
101102
.env("PATH", add_path(bin)?)
102103
.status()?;
104+
if !status.success() {
105+
panic!(
106+
"Critical: Failed to install frame-analyzer-ebpf via cargo install. Check the output above for linker errors."
107+
);
108+
}
103109

104110
#[cfg(debug_assertions)]
105111
let prefix_dir = &target_dir.join("bpfel-unknown-none").join("debug");

0 commit comments

Comments
 (0)