pijul nest
guest [sign in]

Container: cleanup after failure

pmeunier
Jun 29, 2025, 9:08 PM
RBGQQMWXRUO4W2P5GFH24VRIP52IW5BNSE2ZOBXKFIYARDOPBFWAC

Dependencies

  • [2] RINI5Z3P Correct cleanup of the .drv directory after build
  • [3] ODUDDQRY Adding the OCaml interface
  • [4] VWVW5VOI Copying the sources in /src instead of /
  • [5] YJYXDY6A Capturing stdout/stderr for the derivations that ask
  • [6] BQ4E3XLA Forwarding stdout/stderr
  • [7] BDEVQIAU Handle cyclic Ubuntu dependencies

Change contents

  • edit in src/container.rs at line 320
    [3.52573][3.52573:52702]()
    if status != 0 {
    debug!("returning error");
    return Err(Error::BuildReturn { status });
    }
  • replacement in src/container.rs at line 328
    [3.52999][2.0:53]()
    std::fs::remove_dir(&tmp_dir).unwrap_or(());
    [3.52999]
    [3.52999]
    // Return the error after cleanup
    if status != 0 {
    info!("removing {:?}", tmp_dir);
    std::fs::remove_dir_all(&tmp_dir).unwrap_or(());
    debug!("returning error");
    return Err(Error::BuildReturn { status });
    }
  • replacement in src/container.rs at line 353
    [3.53428][3.53428:53480]()
    match std::os::unix::fs::symlink(&dest, &out) {
    [3.53428]
    [3.53480]
    let s = std::os::unix::fs::symlink(&dest, &out);
    info!("removing {:?}", tmp_dir);
    std::fs::remove_dir_all(&tmp_dir).unwrap_or(());
    match s {
  • replacement in src/container.rs at line 575
    [3.60639][3.60639:60640]()
    [3.60639]
    [3.60640]
    debug!("{}", r.script);
  • replacement in src/container.rs at line 578
    [3.60697][3.60697:60742]()
    info!("chrooting to {:?}", tmp_dir);
    [3.60697]
    [3.60742]
    info!("chrooting to (fork) {:?}", tmp_dir);