use std::time::Duration;
use supermachine::Image;
fn main() -> Result<(), Box<dyn std::error::Error>> {
    eprintln!("[repro] building rust:1-slim with rustc warmup...");
    let _img = Image::builder("rust:1-slim")
        .with_name("_deadlock_repro_v2")
        .with_memory_mib(2048)
        .with_warmup_tag("rustc_v2")
        .with_warmup(|vm| {
            vm.exec_builder()
                .stage_file("/tmp/h.rs", b"fn main(){println!(\"hi\");}".to_vec())
                .argv(["rustc", "-O", "/tmp/h.rs", "-o", "/tmp/h"])
                .timeout(Duration::from_secs(60))
                .output()?;
            Ok(())
        })
        .build()?;
    eprintln!("[repro] OK");
    Ok(())
}
