50 lines
1.9 KiB
Rust
50 lines
1.9 KiB
Rust
/// Pre-flight environment validator for Warlock's Stave (stave-core crate).
|
|
/// Checks that all required tooling and system interfaces are available.
|
|
|
|
use std::process::Command;
|
|
use std::path::Path;
|
|
|
|
fn main() {
|
|
println!("===============================================================================");
|
|
println!(" WARLOCK'S STAVE: PRE-FLIGHT ENVIRONMENT VALIDATOR");
|
|
println!("===============================================================================");
|
|
|
|
let mut environment_ready = true;
|
|
|
|
match Command::new("rustc").arg("--version").output() {
|
|
Ok(out) => println!(" [OK] Rust Compiler: {}",
|
|
String::from_utf8_lossy(&out.stdout).trim()),
|
|
Err(_) => {
|
|
println!(" [FAIL] 'rustc' not found.");
|
|
environment_ready = false;
|
|
}
|
|
}
|
|
|
|
match Command::new("clang").arg("--version").output() {
|
|
Ok(_) => println!(" [OK] LLVM Clang verified (eBPF ready)."),
|
|
Err(_) => println!(" [WARN] 'clang' missing. eBPF layers bypassed."),
|
|
}
|
|
|
|
match Command::new("x86_64-w64-mingw32-g++").arg("--version").output() {
|
|
Ok(_) => println!(" [OK] MinGW-w64 detected (Wine integration ready)."),
|
|
Err(_) => println!(" [WARN] MinGW missing. Windows plugin skipped."),
|
|
}
|
|
|
|
#[cfg(target_os = "linux")]
|
|
{
|
|
if Path::new("/proc/net/unix").exists() {
|
|
println!(" [OK] Linux procfs readable (socket auditing ready).");
|
|
} else {
|
|
println!(" [FAIL] procfs not available.");
|
|
environment_ready = false;
|
|
}
|
|
}
|
|
|
|
println!("-------------------------------------------------------------------------------");
|
|
if environment_ready {
|
|
println!(" RESULT: Environment validated. Ready to build.");
|
|
} else {
|
|
println!(" RESULT: Critical gaps detected. Resolve errors before building.");
|
|
std::process::exit(1);
|
|
}
|
|
} |