pijul nest
guest [sign in]

Compiling with older versions of Rust, when `pipe()` wasn't yet part of stdlib.

pmeunier
Aug 16, 2025, 3:19 PM
D2BDVT6VPEEKGIH5R6WXIIWBVDBDLAXEJQK4GTXA7UYHG2W375OAC

Dependencies

  • [2] JREIRPI4 Fixing a compilation issue
  • [3] LIMIMBOU Bootstrapping the Rust part
  • [4] BQ4E3XLA Forwarding stdout/stderr
  • [5] ODUDDQRY Adding the OCaml interface
  • [*] UWQB743K First working shell (with ocaml code)

Change contents

  • edit in src/container.rs at line 123
    [4.48182]
    [4.48182]
    }
    }
    fn pipe() -> Result<(OwnedFd, OwnedFd), std::io::Error> {
    use std::os::fd::FromRawFd;
    let mut fd = [0; 2];
    unsafe {
    if libc::pipe(fd.as_mut_ptr()) != 0 {
    Err(std::io::Error::last_os_error())
    } else {
    Ok((OwnedFd::from_raw_fd(fd[0]), OwnedFd::from_raw_fd(fd[1])))
    }
  • replacement in src/container.rs at line 168
    [4.49288][3.12216:12362]()
    let (reader_out, writer_out) = std::io::pipe().unwrap();
    let (reader_err, writer_err) = std::io::pipe().unwrap();
    [4.49288]
    [3.12362]
    let (reader_out, writer_out) = pipe().unwrap();
    let (reader_err, writer_err) = pipe().unwrap();
  • edit in Cargo.toml at line 11
    [2.22]
    [7.71144]
    exclude = [ "essai" ]