remove usage of cstruct, require mirage-crypto 1.0.0 #1

Merged
reynir merged 5 commits from no-cstruct into main 2024-09-05 15:12:38 +00:00
Owner
ready for review, but for compiling requires: - builder in main https://github.com/robur-coop/builder/pull/49 - dream alpha7 https://github.com/ocaml/opam-repository/pull/26465 - caqti with https://github.com/paurkedal/ocaml-caqti/pull/120 //cc @reynir
hannes added 1 commit 2024-09-02 14:16:14 +00:00
Author
Owner

I also:

  • moved from pbkdf & scrypt-kdf to kdf.pbkdf, kdf.scrypt
  • moved from hex to ohex
I also: - moved from pbkdf & scrypt-kdf to kdf.pbkdf, kdf.scrypt - moved from hex to ohex
hannes added 1 commit 2024-09-02 14:38:13 +00:00
reynir approved these changes 2024-09-04 09:00:30 +00:00
reynir left a comment
Owner

Thanks! This looks great. Pinning caqti this seems to work for me. I will merge once caqti has been released.

Thanks! This looks great. Pinning caqti this seems to work for me. I will merge once caqti has been released.
@ -44,3 +44,3 @@
match user_info.password_hash with
| `Pbkdf2_sha256 (password_hash, salt, params) ->
Cstruct.equal
String.equal
Owner

Here we should probably have used Eqaf in the first place. But let's save that for another PR.

Here we should probably have used Eqaf in the first place. But let's save that for another PR.
@ -77,3 +77,3 @@
Db.collect_list builds () >>= fun builds ->
Grej.list_iter_result (fun (id, opam_sha, env_sha, pkg_sha) ->
let input_id = Mirage_crypto.Hash.SHA256.digest (Cstruct.concat [ opam_sha ; env_sha ; pkg_sha ]) in
let input_id = Digestif.SHA256.(to_raw_string (digestv_string [ opam_sha ; env_sha ; pkg_sha ])) in
Owner

I like this! We now avoid allocating an intermediate string :D

I like this! We now avoid allocating an intermediate string :D
hannes marked this conversation as resolved
builder-web.opam Outdated
@ -24,3 +23,3 @@
"hex"
"ohex" {>= "0.2.0"}
"lwt" {>= "5.7.0"}
"caqti" {>= "2.1.1"}
Owner

This will need to be updated once we have a caqti release.

This will need to be updated once we have a caqti release.
hannes marked this conversation as resolved
db/builder_db.ml Outdated
@ -224,7 +224,7 @@ module Build = struct
Fpath.pp t.script
t.platform
Fmt.(Dump.option int64) t.main_binary
Fmt.(Dump.option (using Cstruct.to_string string)) t.input_id
Owner

Reading the documentation for Fmt.using I'm confused what it does. But the new code looks good to me.

Reading the documentation for `Fmt.using` I'm confused what it does. But the new code looks good to me.
hannes marked this conversation as resolved
Author
Owner
FWIW caqti is released https://github.com/ocaml/opam-repository/pull/26479
hannes added 1 commit 2024-09-05 14:58:29 +00:00
hannes added 2 commits 2024-09-05 15:02:21 +00:00
Author
Owner

CI run at https://github.com/robur-coop/builder-web/runs/29735284723 looks promising. IMHO good to merge. And maybe we should cut a release to opam-repository?

CI run at https://github.com/robur-coop/builder-web/runs/29735284723 looks promising. IMHO good to merge. And maybe we should cut a release to opam-repository?
reynir merged commit 47b1759d0f into main 2024-09-05 15:12:38 +00:00
reynir deleted branch no-cstruct 2024-09-05 15:12:39 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: robur/builder-web#1
No description provided.