Merge pull request 'Fix build of builder-web with more recent packages:' (#166) from fix-build into main

Reviewed-on: #166
This commit is contained in:
Hannes Mehnert 2023-08-25 09:52:34 +00:00
commit d43c3aa26c
5 changed files with 7 additions and 7 deletions

View file

@ -892,7 +892,7 @@ let default_cmd, default_info =
Cmd.info ~doc "builder-db" Cmd.info ~doc "builder-db"
let () = let () =
Mirage_crypto_rng_unix.initialize (); Mirage_crypto_rng_unix.initialize (module Mirage_crypto_rng.Fortuna);
Cmdliner.Cmd.group Cmdliner.Cmd.group
~default:default_cmd default_info ~default:default_cmd default_info
[ help_cmd; migrate_cmd; [ help_cmd; migrate_cmd;

View file

@ -22,12 +22,12 @@ depends: [
"cstruct" {>= "6.0.0"} "cstruct" {>= "6.0.0"}
"bos" "bos"
"hex" "hex"
"lwt" {>= "5.6.0"} "lwt" {>= "5.7.0"}
"caqti" {>= "1.8.0"} "caqti" {>= "1.8.0"}
"caqti-lwt" "caqti-lwt"
"caqti-driver-sqlite3" "caqti-driver-sqlite3"
"pbkdf" "pbkdf"
"mirage-crypto-rng" "mirage-crypto-rng" {>= "0.11.0"}
"scrypt-kdf" "scrypt-kdf"
"opam-core" "opam-core"
"opam-format" {>= "2.1.0"} "opam-format" {>= "2.1.0"}

View file

@ -247,7 +247,7 @@ module Viz_aux = struct
|> Lwt.return |> Lwt.return
|> if_error "Error finding a version of the requested visualization") |> if_error "Error finding a version of the requested visualization")
>>= fun viz_path -> >>= fun viz_path ->
Lwt_result.catch ( Lwt_result.catch (fun () ->
Lwt_io.with_file ~mode:Lwt_io.Input Lwt_io.with_file ~mode:Lwt_io.Input
(Fpath.to_string viz_path) (Fpath.to_string viz_path)
Lwt_io.read Lwt_io.read

View file

@ -15,7 +15,7 @@ module Writer = struct
| `Await gz -> state.gz <- gz ; Lwt.return_unit | `Await gz -> state.gz <- gz ; Lwt.return_unit
| `Flush gz -> | `Flush gz ->
let max = Cstruct.length oc - Gz.Def.dst_rem gz in let max = Cstruct.length oc - Gz.Def.dst_rem gz in
let str = Cstruct.copy oc 0 max in let str = Cstruct.to_string ~len:max oc in
Dream.write stream str >>= fun () -> Dream.write stream str >>= fun () ->
let { Cstruct.buffer; off= cs_off; len= cs_len; } = oc in let { Cstruct.buffer; off= cs_off; len= cs_len; } = oc in
until_await (Gz.Def.dst gz buffer cs_off cs_len) until_await (Gz.Def.dst gz buffer cs_off cs_len)
@ -76,7 +76,7 @@ let targz_response datadir finish (files : Builder_db.file list) (stream : Dream
| `Await _gz -> assert false | `Await _gz -> assert false
| `Flush gz | `End gz as flush_or_end -> | `Flush gz | `End gz as flush_or_end ->
let max = Cstruct.length state.oc - Gz.Def.dst_rem gz in let max = Cstruct.length state.oc - Gz.Def.dst_rem gz in
let str = Cstruct.copy state.oc 0 max in let str = Cstruct.to_string ~len:max state.oc in
Dream.write stream str >>= fun () -> match flush_or_end with Dream.write stream str >>= fun () -> match flush_or_end with
| `Flush gz -> | `Flush gz ->
let { Cstruct.buffer; off= cs_off; len= cs_len; } = state.oc in let { Cstruct.buffer; off= cs_off; len= cs_len; } = state.oc in

View file

@ -3,7 +3,7 @@ let ( >>| ) x f = Result.map f x
module type CONN = Caqti_blocking.CONNECTION module type CONN = Caqti_blocking.CONNECTION
let () = Mirage_crypto_rng_unix.initialize () let () = Mirage_crypto_rng_unix.initialize (module Mirage_crypto_rng.Fortuna)
let iter f xs = List.fold_left (fun r x -> r >>= fun () -> f x) (Ok ()) xs let iter f xs = List.fold_left (fun r x -> r >>= fun () -> f x) (Ok ()) xs
let get_opt message = function let get_opt message = function