/// Check required tool to build Syzkaller
Check required tool to build Syzkaller
Check required tool to build Syzkaller
fn check_env() {
    const TOOLS: [(&str, &str); 6] = [
        ("wget", "download syzkaller"),
        ("sha384sum", "check download"),
        ("unzip", "unzip syzkaller.zip"),
        ("patch", "patch patches/*.diff"),
        ("make", "build the syzkaller description and executor"),
        ("go", "build the syzkaller"),
    ];
    let mut missing = false;
    for (tool, reason) in TOOLS.iter().copied() {
        let status = Command::new("which").arg(tool).status().unwrap();
        if !status.success() {
            eprintln!("missing tool {} to {}.", tool, reason);
            missing = true;
        }
    }
    if missing {
        eprintln!("missing tools, please install them first");
        exit(1)
    }
}
fn check_env ( ) { const TOOLS : [ ( & str , & str ) ; 6 ] = [ ( " " , " " ) , ( " " , " " ) , ( " " , " " ) , ( " " , " " ) , ( " " , " " ) , ( " " , " " ) , ] ; let mut missing = false ; for ( tool , reason ) in TOOLS . iter ( ) . copied ( ) { let status = Command :: new ( " " ) . arg ( tool ) . status ( ) . unwrap ( ) ; if ! status . success ( ) { eprintln ! ( " " tool reason ) ; missing = true ; } } if missing { eprintln ! ( " " ) ; exit ( 1 ) } }
Check required tool to build Syzkaller
Check required tool to build Syzkaller