pijul nest
guest [sign in]

Reorganisation of the frontend

pmeunier
Jun 27, 2025, 10:32 PM
R7J4254ZZREVMWXXDUM772GPLZSCZSIJKOLEAI33WUF2CPS3X6WQC

Dependencies

  • [2] BQ4E3XLA Forwarding stdout/stderr
  • [3] Q6PRCWS6 Optional argument to set the Ubuntu release for each individual package
  • [4] GM4Q532K Adding a post_setup method before unpacking
  • [5] VAKO4QFF Formatting
  • [6] HX4TXY2D Fixed-output derivations enable the network
  • [7] ODUDDQRY Adding the OCaml interface
  • [8] 7Q4257EP Formatting, cleanup and Rust 2021 compatibility
  • [9] UWQB743K First working shell (with ocaml code)
  • [*] KOWYPLMX Nix and config.toml

Change contents

  • edit in shell.nix at line 98
    [11.2728]
    [11.2728]
    ocamlPackages.yojson
    ocamlPackages.toml
    ocamlPackages.hex
  • edit in elpe/lib/elpe.ml at line 3
    [6.56191]
    [6.56191]
    include Derivation
  • replacement in elpe/lib/elpe.ml at line 5
    [6.56192][6.56192:56239](),[6.56239][6.63961:63997](),[6.63997][6.56662:58003](),[6.56662][6.56662:58003](),[6.58003][6.63998:64595]()
    exception Error of H2.Client_connection.error
    type store_path = { path : string }
    let ubuntu_release connection ~release ~arch ~repository =
    let req =
    Elpegrpc.Elpe.UbuntuReleaseRequest.make ~release ~arch ~repository ()
    in
    let open Ocaml_protoc_plugin in
    let open Elpegrpc.Elpe in
    let encode, decode = Service.make_client_functions Elpe.ubuntuRelease in
    let enc = encode req |> Writer.contents in
    Client.call ~service:"elpe.Elpe" ~rpc:"UbuntuRelease"
    ~do_request:
    (H2_lwt_unix.Client.request connection ~error_handler:(fun _ ->
    failwith "Error"))
    ~handler:
    (Client.Rpc.unary enc ~f:(fun decoder ->
    let+ decoder = decoder in
    match decoder with
    | Some decoder -> (
    Reader.create decoder |> decode |> function
    | Ok v -> v
    | Error e ->
    failwith
    (Printf.sprintf "Could not decode request: %s"
    (Result.show_error e)))
    | None -> Elpe.Derivation.Response.make ()))
    ()
    let ubuntu_package connection ~index ~name =
    let req = Elpegrpc.Elpe.UbuntuPackageRequest.make ~index ~name () in
    let open Ocaml_protoc_plugin in
    let open Elpegrpc.Elpe in
    let encode, decode = Service.make_client_functions Elpe.ubuntuPackage in
    let enc = encode req |> Writer.contents in
    Client.call ~service:"elpe.Elpe" ~rpc:"UbuntuPackage"
    ~do_request:
    (H2_lwt_unix.Client.request connection ~error_handler:(fun _ ->
    failwith "Error"))
    ~handler:
    (Client.Rpc.unary enc ~f:(fun decoder ->
    let+ decoder = decoder in
    match decoder with
    | Some decoder -> (
    Reader.create decoder |> decode |> function
    | Ok v -> v
    | Error e ->
    failwith
    (Printf.sprintf "Could not decode request: %s"
    (Result.show_error e)))
    | None -> Elpe.Derivation.Response.make ()))
    ()
    [6.56192]
    [6.64595]
    module Rust = struct
    include Rust
    end
  • replacement in elpe/lib/elpe.ml at line 9
    [6.64596][6.290:624](),[6.624][6.64739:64918](),[6.64739][6.64739:64918](),[6.64918][2.6654:6743](),[2.6743][6.58003:58134](),[6.64971][6.58003:58134](),[6.58003][6.58003:58134](),[6.58134][2.6744:7380](),[2.7380][6.58365:58489](),[6.58365][6.58365:58489](),[6.58489][2.7381:7594]()
    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
    let open Ocaml_protoc_plugin in
    let open Elpegrpc.Elpe in
    let encode, decode = Service.make_client_functions Elpe.derivation in
    let enc = encode req |> Writer.contents in
    let result = ref None in
    let* _ = Client.call ~service:"elpe.Elpe" ~rpc:"Derivation"
    ~do_request:
    (H2_lwt_unix.Client.request connection ~error_handler:(fun _ ->
    failwith "Error"))
    ~handler:
    (Client.Rpc.server_streaming enc ~f:(fun responses ->
    Lwt_stream.iter_s
    (fun str ->
    Reader.create str |> decode |> function
    | Ok (`Ok path) -> (result := Some(`Ok path); Lwt.return ())
    | Ok (`Error path) -> (result := Some(`Error path); Lwt.return ())
    | Ok (`Stdout buf) -> (
    let buf = Bytes.unsafe_to_string buf in
    Printf.printf "%s" buf; Lwt.return ())
    | Ok (`Stderr buf) -> (
    let buf = Bytes.unsafe_to_string buf in
    Printf.eprintf "%s" buf; Lwt.return ())
    | Error e ->
    failwith
    (Printf.sprintf "Could not decode request: %s"
    (Result.show_error e))
    | _ -> Lwt.return ())
    responses
    ))
    ()
    in
    match !result with
    Some v -> Lwt.return v
    | None -> assert false
    [6.64596]
    [6.58600]
    exception Error of H2.Client_connection.error
  • edit in elpe/lib/elpe.ml at line 21
    [6.65269]
    [6.65269]
    let entry : string = entry in
  • replacement in elpe/lib/elpe.ml at line 102
    [6.68470][6.68470:68538](),[6.68538][6.58601:58628](),[6.58601][6.58601:58628]()
    type build_result = { destdir : string list; paths : string list }
    class virtual derivation =
    [6.68470]
    [6.68539]
    let local_src p =
  • edit in elpe/lib/elpe.ml at line 104
    [6.68548][6.58644:58677](),[6.58644][6.58644:58677](),[6.58677][6.68549:68805](),[6.68805][6.58780:58816](),[6.58780][6.58780:58816](),[6.58816][3.0:40](),[3.40][6.58834:58843](),[6.58834][6.58834:58843]()
    method virtual name : string
    (* Returns the script to setup the build process, also used in shells. *)
    method setup : string Lwt.t = Lwt.return ""
    (* List of paths resulting from building the package. *)
    method build : build_result Lwt.t = failwith "Not implemented"
    end
    let backend_conn = ref None
    let ubuntu ?(release = "plucky") name =
    object
  • replacement in elpe/lib/elpe.ml at line 105
    [6.58866][6.58866:58889]()
    method name = name
    [6.58866]
    [6.58889]
    method name = Filename.basename p
  • edit in elpe/lib/elpe.ml at line 110
    [6.58998][6.58998:59078](),[6.59078][3.41:117](),[3.117][6.59188:59234](),[6.59188][6.59188:59234](),[6.59234][6.68806:68947](),[6.68947][6.59267:59300](),[6.59267][6.59267:59300]()
    in
    let* index =
    Lwt_list.map_p
    (fun repository ->
    let* res = ubuntu_release c ~release ~arch:Amd64 ~repository in
    let res, _ = Result.get_ok res in
    match res with
    | `Ok r -> Lwt.return r.destdir
    | `Error e -> failwith e
    | _ -> assert false)
    [ "main"; "universe" ]
  • replacement in elpe/lib/elpe.ml at line 111
    [6.59309][6.59309:59348](),[6.59349][6.59349:59399]()
    let index = List.concat index in
    let* res = ubuntu_package c ~index ~name in
    [6.59309]
    [6.59399]
    let* res = add_path c p in
  • edit in elpe/lib/elpe.ml at line 114
    [6.68969][6.68969:69095](),[6.69095][6.59465:59678](),[6.59465][6.59465:59678](),[6.59678][6.69096:69191](),[6.69191][6.625:688](),[6.688][6.69191:69473](),[6.69191][6.69191:69473](),[6.69473][6.59678:59679](),[6.59678][6.59678:59679](),[6.59679][6.69474:70130](),[6.70130][6.59679:59699](),[6.59679][6.59679:59699](),[6.59699][6.70131:70319](),[6.70319][6.59856:59908](),[6.59856][6.59856:59908](),[6.59908][6.70320:70423](),[6.70423][6.59983:59992](),[6.59983][6.59983:59992](),[6.59992][4.0:43](),[4.43][6.70424:70496](),[6.59992][6.70424:70496](),[6.70517][6.70517:70629](),[6.70629][4.44:121](),[4.121][6.60214:60215](),[6.70692][6.60214:60215](),[6.60214][6.60214:60215](),[6.60215][4.122:160](),[4.160][6.70693:70770](),[6.60215][6.70693:70770](),[6.70770][6.60343:60344](),[6.60343][6.60343:60344](),[6.60344][6.70771:71021](),[6.71021][6.60588:60589](),[6.60588][6.60588:60589](),[6.60589][6.71022:71105](),[6.71105][6.61249:61250](),[6.61249][6.61249:61250](),[6.61250][6.71106:71380](),[6.71380][6.61359:61360](),[6.61359][6.61359:61360](),[6.61360][6.71381:71456](),[6.71456][6.61596:61597](),[6.61596][6.61596:61597](),[6.61597][6.71457:71567](),[6.71567][6.689:795](),[6.795][6.71663:71689](),[6.71663][6.71663:71689](),[6.71689][6.61678:61679](),[6.61678][6.61678:61679](),[6.61679][6.71690:71769](),[6.71769][6.61761:61762](),[6.61761][6.61761:61762](),[6.61762][6.71770:71886](),[6.71886][6.796:922](),[6.922][6.71990:72016](),[6.71990][6.71990:72016](),[6.72016][6.61943:61944](),[6.61943][6.61943:61944](),[6.61944][6.72017:72403](),[6.72403][6.923:968](),[6.968][2.7595:7610](),[2.7610][6.985:1103](),[6.985][6.985:1103](),[6.1103][2.7611:7630]()
    | `Ok r -> Lwt.return { destdir = r.destdir; paths = r.paths }
    | `Error e -> failwith e
    | _ -> assert false
    end
    class virtual std_derivation =
    object (self)
    inherit derivation
    method environment : (string * string) List.t Lwt.t = Lwt.return []
    method build_inputs : derivation list Lwt.t = Lwt.return []
    method target : string = "x86_64-linux-gnu"
    val extra_paths : string list ref = ref []
    method output_hash : string option Lwt.t = Lwt.return None
    method derivation (drv : derivation) =
    let* path = drv#build in
    extra_paths := path.destdir @ !extra_paths;
    Lwt.return path
    method local_src p =
    let path_drv =
    object
    inherit derivation
    method name = Filename.basename p
    method! build =
    let c =
    match !backend_conn with
    | None -> failwith "no conn"
    | Some c -> c
    in
    let* res = add_path c p in
    let res, _ = Result.get_ok res in
    match res with
    | `Ok r -> Lwt.return { destdir = r.destdir; paths = r.paths }
    | `Error e -> failwith e
    | _ -> assert false
    end
    in
    let* built = path_drv#build in
    extra_paths := built.destdir @ !extra_paths;
    Lwt.return (List.hd built.destdir)
    method src : string Lwt.t = failwith ("No src defined for " ^ self#name)
    method! setup =
    let* bash = self#derivation (ubuntu "bash-static") in
    let bash = List.hd bash.destdir in
    let* build_inputs = self#build_inputs in
    let* () =
    Lwt_list.iter_p
    (fun d ->
    let* p = d#build in
    extra_paths := p.destdir @ !extra_paths;
    Lwt.return ())
    build_inputs
    in
    let* post_setup = self#post_setup in
    Lwt.return
    ("#!" ^ bash
    ^ "/usr/bin/bash-static\n\
    export PATH=/usr/bin\n\
    export LIBRARY_PATH=/lib/" ^ self#target ^ ":/lib64/" ^ self#target
    ^ ":/usr/lib:/usr/lib64:/usr/lib/x86_64-linux-gnu\n"^post_setup^"\n")
    method post_setup = Lwt.return ""
    method pre_unpack = Lwt.return ""
    method post_unpack = Lwt.return ""
    method unpack_phase =
    let* src = self#src in
    let* all = Lwt.all [ self#pre_unpack; self#post_unpack ] in
    match all with
    | pre :: post :: _ -> Lwt.return (pre ^ "\ncp -R " ^ src ^ "/* .\n" ^ post)
    | _ -> assert false
    method pre_configure = Lwt.return ""
    method post_configure = Lwt.return ""
    method configure_phase =
    let* all = Lwt.all [ self#pre_configure; self#post_configure ] in
    match all with
    | pre :: post :: _ ->
    Lwt.return
    (pre ^ "\nif [[ -e configure ]]; then ./configure; fi\n" ^ post)
    | _ -> assert false
    method pre_build = Lwt.return ""
    method post_build = Lwt.return ""
    method build_phase =
    let* all = Lwt.all [ self#pre_build; self#post_build ] in
    match all with
    | pre :: post :: _ ->
    Lwt.return (pre ^ "\nif [[ -e Makefile ]]; then make; fi\n" ^ post)
    | _ -> assert false
    method pre_install = Lwt.return ""
    method post_install = Lwt.return ""
    method install_phase =
    let* all = Lwt.all [ self#pre_install; self#post_install ] in
    match all with
    | pre :: post :: _ ->
    Lwt.return
    (pre ^ "\nif [[ -e Makefile ]]; then make install; fi\n" ^ post)
    | _ -> assert false
    method! build =
    let* phases =
    Lwt.all
    [
    self#setup;
    self#unpack_phase;
    self#configure_phase;
    self#build_phase;
    self#install_phase;
    ]
    in
    let builder = String.concat "\n" phases in
    let c =
    match !backend_conn with None -> failwith "no conn" | Some c -> c
    in
    let* output_hash = self#output_hash in
    let* r =
    derivation c ~name:self#name ~builder ~paths:!extra_paths
    ~target:self#target ~output_hash
    in
    match r with
  • replacement in elpe/lib/dune at line 5
    [6.62434][5.0:71]()
    (libraries grpc-lwt lwt lwt.unix h2 h2-lwt-unix ocaml-protoc-plugin))
    [6.62434]
    [6.62510]
    (libraries grpc-lwt lwt lwt.unix h2 h2-lwt-unix ocaml-protoc-plugin core yojson toml hex))
  • file addition: derivation.ml (----------)
    [6.55449]
    open Lwt.Syntax
    type store_path = { path : string }
    type build_result = { destdir : string list; paths : string list }
    let backend_conn = ref None
    class virtual derivation =
    object
    method virtual name : string
    val stdout_ : Buffer.t option ref = ref None
    val stderr_ : Buffer.t option ref = ref None
    method stdout = stdout_
    method stderr = stderr_
    method set_stdout =
    let buf = Buffer.create 1024 in
    stdout_ := Some buf;
    buf
    method set_stderr =
    let buf = Buffer.create 1024 in
    stderr_ := Some buf;
    buf
    (* Returns the script to setup the build process, also used in shells. *)
    method setup : string Lwt.t = Lwt.return ""
    (* List of paths resulting from building the package. *)
    method build : build_result Lwt.t = failwith "Not implemented"
    end
    open Grpc_lwt
    let ubuntu_release connection ~release ~arch ~repository =
    let req =
    Elpegrpc.Elpe.UbuntuReleaseRequest.make ~release ~arch ~repository ()
    in
    let open Ocaml_protoc_plugin in
    let encode, decode =
    Service.make_client_functions Elpegrpc.Elpe.Elpe.ubuntuRelease
    in
    let enc = encode req |> Writer.contents in
    Client.call ~service:"elpe.Elpe" ~rpc:"UbuntuRelease"
    ~do_request:
    (H2_lwt_unix.Client.request connection ~error_handler:(fun _ ->
    failwith "Error"))
    ~handler:
    (Client.Rpc.unary enc ~f:(fun decoder ->
    let+ decoder = decoder in
    match decoder with
    | Some decoder -> (
    Reader.create decoder |> decode |> function
    | Ok v -> v
    | Error e ->
    failwith
    (Printf.sprintf "Could not decode request: %s"
    (Result.show_error e)))
    | None -> Elpegrpc.Elpe.Elpe.Derivation.Response.make ()))
    ()
    let ubuntu_package connection ~index ~name =
    let req = Elpegrpc.Elpe.UbuntuPackageRequest.make ~index ~name () in
    let open Ocaml_protoc_plugin in
    let encode, decode =
    Service.make_client_functions Elpegrpc.Elpe.Elpe.ubuntuPackage
    in
    let enc = encode req |> Writer.contents in
    Client.call ~service:"elpe.Elpe" ~rpc:"UbuntuPackage"
    ~do_request:
    (H2_lwt_unix.Client.request connection ~error_handler:(fun _ ->
    failwith "Error"))
    ~handler:
    (Client.Rpc.unary enc ~f:(fun decoder ->
    let+ decoder = decoder in
    match decoder with
    | Some decoder -> (
    Reader.create decoder |> decode |> function
    | Ok v -> v
    | Error e ->
    failwith
    (Printf.sprintf "Could not decode request: %s"
    (Result.show_error e)))
    | None -> Elpegrpc.Elpe.Elpe.Derivation.Response.make ()))
    ()
    let ubuntu ?(release = "plucky") name =
    object
    inherit derivation
    method name = name
    method! build =
    let c =
    match !backend_conn with None -> failwith "no conn" | Some c -> c
    in
    let* index =
    Lwt_list.map_p
    (fun repository ->
    let* res = ubuntu_release c ~release ~arch:Amd64 ~repository in
    let res, _ = Result.get_ok res in
    match res with
    | `Ok r -> Lwt.return r.destdir
    | `Error e -> failwith e
    | _ -> assert false)
    [ "main"; "universe" ]
    in
    let index = List.concat index in
    let* res = ubuntu_package c ~index ~name in
    let res, _ = Result.get_ok res in
    match res with
    | `Ok r -> Lwt.return { destdir = r.destdir; paths = r.paths }
    | `Error e -> failwith e
    | _ -> assert false
    end
    let derivation ?(stdout = None) ?(stderr = None) 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
    let open Ocaml_protoc_plugin in
    let encode, decode =
    Service.make_client_functions Elpegrpc.Elpe.Elpe.derivation
    in
    let enc = encode req |> Writer.contents in
    let result = ref None in
    let* _ =
    Client.call ~service:"elpe.Elpe" ~rpc:"Derivation"
    ~do_request:
    (H2_lwt_unix.Client.request connection ~error_handler:(fun _ ->
    failwith "Error"))
    ~handler:
    (Client.Rpc.server_streaming enc ~f:(fun responses ->
    Lwt_stream.iter_s
    (fun str ->
    Reader.create str |> decode |> function
    | Ok (`Ok path) ->
    result := Some (`Ok path);
    Lwt.return ()
    | Ok (`Error path) ->
    result := Some (`Error path);
    Lwt.return ()
    | Ok (`Stdout buf) ->
    let _ =
    match stdout with
    | Some b -> Buffer.add_bytes b buf
    | None ->
    let buf = Bytes.to_string buf in
    Printf.printf "%s" buf
    in
    Lwt.return ()
    | Ok (`Stderr buf) ->
    let _ =
    match stderr with
    | Some b -> Buffer.add_bytes b buf
    | None ->
    let buf = Bytes.to_string buf in
    Printf.printf "%s" buf
    in
    Lwt.return ()
    | Error e ->
    failwith
    (Printf.sprintf "Could not decode request: %s"
    (Result.show_error e))
    | _ -> Lwt.return ())
    responses))
    ()
    in
    match !result with Some v -> Lwt.return v | None -> assert false
    class virtual std_derivation =
    object (self)
    inherit derivation
    method environment : (string * string) List.t Lwt.t = Lwt.return []
    method build_inputs : derivation list Lwt.t = Lwt.return []
    method target : string = "x86_64-linux-gnu"
    val extra_paths : string list ref = ref []
    val extra_paths_h : (string, unit) Hashtbl.t = Hashtbl.create 16
    method output_hash : string option Lwt.t = Lwt.return None
    method derivation (drv : derivation) =
    let* path = drv#build in
    List.fold_right
    (fun r () ->
    if Hashtbl.find_opt extra_paths_h r = None then
    let _ = Hashtbl.add extra_paths_h r () in
    extra_paths := r :: !extra_paths
    else ())
    path.destdir ();
    Lwt.return path
    method src : derivation Lwt.t = failwith ("No src defined for " ^ self#name)
    method! setup =
    let* bash = self#derivation (ubuntu "bash-static") in
    let bash = List.hd bash.destdir in
    let* build_inputs = self#build_inputs in
    let* paths =
    Lwt_list.map_p
    (fun d ->
    let* p = d#build in
    extra_paths := p.destdir @ !extra_paths;
    Lwt.return p.destdir)
    build_inputs
    in
    let path =
    List.fold_left
    (List.fold_left (fun acc path ->
    (if acc = "" then acc ^ path else acc ^ ":" ^ path) ^ "/usr/bin"))
    "" paths
    in
    let* post_setup = self#post_setup in
    Lwt.return
    ("#!" ^ bash ^ "/usr/bin/bash-static\nexport PATH=" ^ path
    ^ "\nexport LIBRARY_PATH=/lib/" ^ self#target ^ ":/lib64/" ^ self#target
    ^ ":/usr/lib:/usr/lib64:/usr/lib/x86_64-linux-gnu\n" ^ post_setup ^ "\n"
    )
    method post_setup = Lwt.return ""
    method pre_unpack = Lwt.return ""
    method post_unpack = Lwt.return ""
    method unpack_phase =
    let* src = self#src in
    let* src_built = src#build in
    extra_paths := src_built.destdir @ !extra_paths;
    let* all = Lwt.all [ self#pre_unpack; self#post_unpack ] in
    match all with
    | pre :: post :: _ ->
    Lwt.return
    (pre ^ "\ncp -R " ^ List.hd src_built.destdir ^ "/. .\n" ^ post)
    | _ -> assert false
    method pre_configure = Lwt.return ""
    method post_configure = Lwt.return ""
    method configure_phase =
    let* all = Lwt.all [ self#pre_configure; self#post_configure ] in
    match all with
    | pre :: post :: _ ->
    Lwt.return
    (pre ^ "\nif [[ -e configure ]]; then ./configure; fi\n" ^ post)
    | _ -> assert false
    method pre_build = Lwt.return ""
    method post_build = Lwt.return ""
    method build_phase =
    let* all = Lwt.all [ self#pre_build; self#post_build ] in
    match all with
    | pre :: post :: _ ->
    Lwt.return (pre ^ "\nif [[ -e Makefile ]]; then make; fi\n" ^ post)
    | _ -> assert false
    method pre_install = Lwt.return ""
    method post_install = Lwt.return ""
    method install_phase =
    let* all = Lwt.all [ self#pre_install; self#post_install ] in
    match all with
    | pre :: post :: _ ->
    Lwt.return
    (pre ^ "\nif [[ -e Makefile ]]; then make install; fi\n" ^ post)
    | _ -> assert false
    method! build =
    let* phases =
    Lwt.all
    [
    self#setup;
    self#unpack_phase;
    self#configure_phase;
    self#build_phase;
    self#install_phase;
    ]
    in
    let builder = String.concat "\n" phases in
    let c =
    match !backend_conn with None -> failwith "no conn" | Some c -> c
    in
    let* output_hash = self#output_hash in
    let* r =
    derivation c ~name:self#name ~builder ~paths:!extra_paths
    ~stdout:!(self#stdout) ~stderr:!(self#stderr) ~target:self#target
    ~output_hash
    in
    match r with
    | `Ok r -> Lwt.return { destdir = r.destdir; paths = r.paths }
    | `Error e -> failwith e
    | _ -> assert false
    end
    let http ~url ~hash_algorithm ~hash =
    object
    inherit derivation
    method name = "http"
    method! build =
    let connection =
    match !backend_conn with None -> failwith "no conn" | Some c -> c
    in
    let req =
    Elpegrpc.Elpe.AddUrlRequest.make ~url ~hash_algorithm ~hash ()
    in
    let* res =
    let open Ocaml_protoc_plugin in
    let encode, decode =
    Service.make_client_functions Elpegrpc.Elpe.Elpe.addUrl
    in
    let enc = encode req |> Writer.contents in
    Client.call ~service:"elpe.Elpe" ~rpc:"AddUrl"
    ~do_request:
    (H2_lwt_unix.Client.request connection ~error_handler:(fun _ ->
    failwith "Error"))
    ~handler:
    (Client.Rpc.unary enc ~f:(fun decoder ->
    let+ decoder = decoder in
    match decoder with
    | Some decoder -> (
    Reader.create decoder |> decode |> function
    | Ok v -> v
    | Error e ->
    failwith
    (Printf.sprintf "Could not decode request: %s"
    (Result.show_error e)))
    | None -> Elpegrpc.Elpe.Elpe.Derivation.Response.make ()))
    ()
    in
    let res, _ = Result.get_ok res in
    match res with
    | `Ok r -> Lwt.return { destdir = r.destdir; paths = r.paths }
    | `Error e -> failwith e
    | _ -> assert false
    end
  • edit in elpe/dune-project at line 17
    [6.62990][6.73011:73052]()
    (depends ocaml elpe lwt core core_unix)
  • edit in elpe/dune-project at line 21
    [6.63041][6.232:301]()
    (depends ocaml lwt grpc-lwt h2-lwt-unix ocaml-protoc-plugin protoc)
  • edit in default.nix at line 119
    [6.69926]
    [6.69968]
    ocamlPackages.hex