pijul nest
guest [sign in]

Fixed-output derivations enable the network

pmeunier
Jun 9, 2025, 7:19 AM
HX4TXY2DTPEEQPU6CMHSD3X4VX7A4OKV7N3HT3QZKSNHNAZOK7GQC

Dependencies

  • [2] ODUDDQRY Adding the OCaml interface
  • [3] SI454P2V Documentation and cleanup
  • [4] UWQB743K First working shell (with ocaml code)

Change contents

  • edit in src/container.rs at line 21
    [2.45152]
    [2.45152]
    /// Expected output hash.
    pub output_hash: Option<String>,
  • edit in src/container.rs at line 192
    [2.51447]
    [2.51447]
    let newnet = if r.output_hash.is_some() {
    0
    } else {
    libc::CLONE_NEWNET
    };
  • replacement in src/container.rs at line 201
    [2.51555][2.51555:51648]()
    flags: (libc::CLONE_NEWPID | libc::CLONE_NEWNET | libc::CLONE_NEWNS) as u64,
    [2.51555]
    [2.51648]
    flags: (libc::CLONE_NEWPID | newnet | libc::CLONE_NEWNS) as u64,
  • edit in elpe/lib/elpegrpc.proto at line 32
    [2.63573]
    [2.63573]
    optional string output_hash = 5;
  • replacement in elpe/lib/elpe.ml at line 58
    [2.64596][2.64596:64739]()
    let derivation connection ~name ~builder ~paths ~target =
    let req = Elpegrpc.Elpe.DerivationRequest.make ~name ~builder ~paths ~target () in
    [2.64596]
    [2.64739]
    let derivation connection ~name ~builder ~paths ~target ~output_hash =
    let req =
    match output_hash with
    | None ->
    Elpegrpc.Elpe.DerivationRequest.make ~name ~builder ~paths ~target ()
    | Some output_hash ->
    Elpegrpc.Elpe.DerivationRequest.make ~name ~builder ~paths ~target
    ~output_hash ()
    in
  • edit in elpe/lib/elpe.ml at line 232
    [2.69191]
    [2.69191]
    method output_hash : string option Lwt.t = Lwt.return None
  • replacement in elpe/lib/elpe.ml at line 312
    [2.71567][2.71567:71663]()
    | pre :: post :: _ -> Lwt.return (pre ^ "\nif [[ -e Makefile ]]; then make; fi\n" ^ post)
    [2.71567]
    [2.71663]
    | pre :: post :: _ ->
    Lwt.return (pre ^ "\nif [[ -e Makefile ]]; then make; fi\n" ^ post)
  • replacement in elpe/lib/elpe.ml at line 322
    [2.71886][2.71886:71990]()
    | pre :: post :: _ -> Lwt.return (pre ^ "\nif [[ -e Makefile ]]; then make install; fi\n" ^ post)
    [2.71886]
    [2.71990]
    | pre :: post :: _ ->
    Lwt.return
    (pre ^ "\nif [[ -e Makefile ]]; then make install; fi\n" ^ post)
  • replacement in elpe/lib/elpe.ml at line 342
    [2.72403][2.72403:72501]()
    let* res = derivation c ~name:self#name ~builder ~paths:!extra_paths ~target:self#target in
    [2.72403]
    [2.72501]
    let* output_hash = self#output_hash in
    let* res =
    derivation c ~name:self#name ~builder ~paths:!extra_paths
    ~target:self#target ~output_hash
    in