Capturing stdout/stderr for the derivations that ask

pmeunier
Jun 27, 2025, 10:30 PM
YJYXDY6AUDJMBUVKKUKM2GO2XVIKZVQFT4SRD4Z7XSTQBTSJ5ZSAC

Dependencies

  • [2] BQ4E3XLA Forwarding stdout/stderr
  • [3] VWVW5VOI Copying the sources in /src instead of /
  • [4] BDEVQIAU Handle cyclic Ubuntu dependencies
  • [5] ODUDDQRY Adding the OCaml interface
  • [6] HX4TXY2D Fixed-output derivations enable the network

Change contents

  • replacement in src/container.rs at line 36
    [2.1864][2.1864:1920]()
    /// Success, with the result path.
    Ok(PathBuf),
    [2.1864]
    [2.1920]
    /// Success, with the potential result path.
    Ok(Option<PathBuf>),
  • replacement in src/container.rs at line 228
    [2.6241][2.6241:6271]()
    ) -> Result<PathBuf, Error> {
    [2.6241]
    [4.49966]
    ) -> Result<Option<PathBuf>, Error> {
  • replacement in src/container.rs at line 257
    [4.50931][4.50931:50970]()
    return Ok(store.join(&format!(
    [4.50931]
    [4.50970]
    return Ok(Some(store.join(&format!(
  • replacement in src/container.rs at line 261
    [4.51092][4.51092:51105]()
    )));
    [4.51092]
    [4.51105]
    ))));
  • replacement in src/container.rs at line 327
    [4.52849][4.52849:52916]()
    std::fs::remove_dir(&entry?.path()).unwrap_or(());
    [4.52849]
    [4.52916]
    if let Ok(entry) = entry {
    std::fs::remove_dir(&entry.path()).unwrap_or(());
    }
  • replacement in src/container.rs at line 338
    [4.53121][4.53121:53159]()
    return Err(Error::NoDestDir);
    [4.53121]
    [4.53159]
    return Ok(None);
  • replacement in src/container.rs at line 364
    [4.53891][4.53891:53903]()
    Ok(out)
    [4.53891]
    [4.53903]
    Ok(Some(out))
  • replacement in src/container.rs at line 577
    [3.203][4.60926:60960](),[4.60926][4.60926:60960]()
    debug!("execve {:?}", c);
    [3.203]
    [2.6439]
    let this_stdout = std::io::stdout().as_raw_fd();
    let this_stderr = std::io::stderr().as_raw_fd();
  • replacement in src/container.rs at line 581
    [2.6456][2.6456:6491]()
    libc::dup2(stdout, 1);
    [2.6456]
    [2.6491]
    if libc::dup2(stdout, this_stdout) < 0 {
    return Err(std::io::Error::last_os_error().into());
    }
    if libc::dup2(stderr, this_stderr) < 0 {
    return Err(std::io::Error::last_os_error().into());
    }
    // libc::dup2(stdout, 1);
  • edit in src/container.rs at line 589
    [2.6526][2.6526:6536](),[2.6536][4.60960:60977](),[4.60960][4.60960:60977]()
    }
    unsafe {
  • replacement in src/container.rs at line 609
    [4.61641][4.61641:61675]()
    libc::chroot(c.as_ptr());
    [4.61641]
    [4.61675]
    if libc::chroot(c.as_ptr()) != 0 {
    return Err(std::io::Error::last_os_error().into());
    }