From 12f53f9f4aefb0996817a8750b076ca4bed13f27 Mon Sep 17 00:00:00 2001 From: ArthurW Date: Thu, 29 Aug 2024 15:18:19 +0200 Subject: [PATCH 1/6] fix CI: disable testing on 4.14 since ppx_expect.v0.17.0 requires ocaml >=5.1 --- .github/workflows/workflow.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 38e2de086..aeb1b0c1b 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -22,7 +22,6 @@ jobs: - ubuntu-latest - macos-latest ocaml-compiler: - - "4.14" - "5" local-packages: - | @@ -66,7 +65,6 @@ jobs: - ubuntu-latest - macos-latest ocaml-compiler: - - "4.14" - "5" local-packages: - | From 5dba4f0861c5be1ef66891c2665f968778561d52 Mon Sep 17 00:00:00 2001 From: ArthurW Date: Thu, 29 Aug 2024 15:01:45 +0200 Subject: [PATCH 2/6] fix CI: use sexplib0 instead of sexplib --- cohttp-lwt-unix/test/test_parser.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cohttp-lwt-unix/test/test_parser.ml b/cohttp-lwt-unix/test/test_parser.ml index 60c09f840..5208290aa 100644 --- a/cohttp-lwt-unix/test/test_parser.ml +++ b/cohttp-lwt-unix/test/test_parser.ml @@ -221,7 +221,7 @@ let res_content_parse () = Rep_io.read_body_chunk reader >>= fun body -> assert_equal ~printer:(fun chunk -> - Transfer.sexp_of_chunk chunk |> Sexplib.Sexp.to_string_hum) + Transfer.sexp_of_chunk chunk |> Sexplib0.Sexp.to_string_hum) (Transfer.Final_chunk "home=Cosby&favorite+flavor=flies") body; return () | _ -> assert false From 0cc5ffbd1e2466326e7a3e3cac571de0de099e47 Mon Sep 17 00:00:00 2001 From: ArthurW Date: Thu, 29 Aug 2024 15:10:26 +0200 Subject: [PATCH 3/6] fix CI: cohttp-eio, breaking change in tls.1.0.0 --- cohttp-eio.opam | 2 +- cohttp-eio/examples/client_tls.ml | 6 +++++- dune-project | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cohttp-eio.opam b/cohttp-eio.opam index 954e8c875..f0331c184 100644 --- a/cohttp-eio.opam +++ b/cohttp-eio.opam @@ -28,7 +28,7 @@ depends: [ "mdx" {with-test} "logs" "uri" - "tls-eio" {with-test & >= "0.17.2"} + "tls-eio" {with-test & >= "1.0.0"} "mirage-crypto-rng-eio" {with-test & >= "0.11.2"} "fmt" "ptime" diff --git a/cohttp-eio/examples/client_tls.ml b/cohttp-eio/examples/client_tls.ml index 3ccba76ba..9e7ee3a5b 100644 --- a/cohttp-eio/examples/client_tls.ml +++ b/cohttp-eio/examples/client_tls.ml @@ -9,7 +9,11 @@ let null_auth ?ip:_ ~host:_ _ = Ok None (* Warning: use a real authenticator in your code! *) let https ~authenticator = - let tls_config = Tls.Config.client ~authenticator () in + let tls_config = + match Tls.Config.client ~authenticator () with + | Error (`Msg msg) -> failwith ("tls configuration problem: " ^ msg) + | Ok tls_config -> tls_config + in fun uri raw -> let host = Uri.host uri diff --git a/dune-project b/dune-project index 2f3ee6d4e..82faac68c 100644 --- a/dune-project +++ b/dune-project @@ -379,7 +379,7 @@ (mdx :with-test) logs uri - (tls-eio (and :with-test (>= 0.17.2))) + (tls-eio (and :with-test (>= 1.0.0))) (mirage-crypto-rng-eio (and :with-test (>= 0.11.2))) fmt ptime From 29dddeaf5dcd35c8053dadf27ec7e565dab53698 Mon Sep 17 00:00:00 2001 From: ArthurW Date: Thu, 29 Aug 2024 16:54:28 +0200 Subject: [PATCH 4/6] fix CI: cohttp-async s3_cp example, breaking change in mirage-crypto --- cohttp-async.opam | 2 +- cohttp-async/examples/dune | 2 +- cohttp-async/examples/s3_cp.ml | 17 +++++------------ dune-project | 2 +- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/cohttp-async.opam b/cohttp-async.opam index 483bd0e31..bcb3a4a0f 100644 --- a/cohttp-async.opam +++ b/cohttp-async.opam @@ -36,7 +36,7 @@ depends: [ "core_unix" {>= "v0.14.0"} "conduit-async" {>= "1.2.0"} "magic-mime" - "mirage-crypto" {with-test} + "digestif" {with-test} "logs" "fmt" {>= "0.8.2"} "sexplib0" diff --git a/cohttp-async/examples/dune b/cohttp-async/examples/dune index 87e0e97d3..59786145b 100644 --- a/cohttp-async/examples/dune +++ b/cohttp-async/examples/dune @@ -1,7 +1,7 @@ (executables (names hello_world receive_post) (libraries - mirage-crypto + digestif.c http cohttp-async base diff --git a/cohttp-async/examples/s3_cp.ml b/cohttp-async/examples/s3_cp.ml index f74b1eef6..6c5cdbbd9 100644 --- a/cohttp-async/examples/s3_cp.ml +++ b/cohttp-async/examples/s3_cp.ml @@ -171,8 +171,7 @@ module Auth = struct let digest s = (* string -> sha256 as a hex string *) - Mirage_crypto.Hash.(digest `SHA256 (Cstruct.of_string s)) - |> Compat.cstruct_to_hex_string + Digestif.SHA256.(digest_string s |> to_hex) let make_amz_headers ?body time = (* Return x-amz-date and x-amz-sha256 headers *) @@ -239,16 +238,12 @@ module Auth = struct Printf.sprintf "AWS4-HMAC-SHA256\n%s\n%s\n%s" time_str scope_str hashed_req let make_signing_key ?date ~region ~service ~secret_access_key () = - let mac k v = - Mirage_crypto.Hash.(mac `SHA256 ~key:k (Cstruct.of_string v)) - in + let mac k v = Digestif.SHA256.(hmac_string ~key:k v |> to_raw_string) in let date' = match date with None -> Date.today ~zone:Time.Zone.utc | Some d -> d in let date_str = Date.to_string_iso8601_basic date' in - let date_key = - mac (Cstruct.of_string ("AWS4" ^ secret_access_key)) date_str - in + let date_key = mac ("AWS4" ^ secret_access_key) date_str in let date_region_key = mac date_key (string_of_region region) in let date_region_service_key = mac date_region_key (string_of_service service) @@ -278,14 +273,12 @@ module Auth = struct (string_of_service service) in let signature = - Mirage_crypto.Hash.( - mac `SHA256 ~key:signing_key (Cstruct.of_string string_to_sign)) + Digestif.SHA256.(hmac_string ~key:signing_key string_to_sign |> to_hex) in let auth_header = Printf.sprintf "AWS4-HMAC-SHA256 Credential=%s,SignedHeaders=%s,Signature=%s" creds - signed_headers - (Compat.cstruct_to_hex_string signature) + signed_headers signature in [ ("Authorization", auth_header) ] end diff --git a/dune-project b/dune-project index 82faac68c..da5ed7351 100644 --- a/dune-project +++ b/dune-project @@ -190,7 +190,7 @@ (conduit-async (>= 1.2.0)) magic-mime - (mirage-crypto :with-test) + (digestif :with-test) logs (fmt (>= 0.8.2)) From e1a8514ff0521f63cd06d371dd7ab30a447b0b8e Mon Sep 17 00:00:00 2001 From: ArthurW Date: Thu, 29 Aug 2024 15:14:03 +0200 Subject: [PATCH 5/6] fix CI: opam lowerbounds lint --- cohttp-curl-async.opam | 2 +- cohttp-curl-lwt.opam | 2 +- cohttp-curl.opam | 2 +- dune-project | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cohttp-curl-async.opam b/cohttp-curl-async.opam index a3c8fc466..1594a3010 100644 --- a/cohttp-curl-async.opam +++ b/cohttp-curl-async.opam @@ -21,7 +21,7 @@ doc: "https://mirage.github.io/ocaml-cohttp/" bug-reports: "https://github.com/mirage/ocaml-cohttp/issues" depends: [ "dune" {>= "3.0"} - "ocurl" + "ocurl" {>= "0.9.2"} "http" {= version} "stringext" "cohttp-curl" {= version} diff --git a/cohttp-curl-lwt.opam b/cohttp-curl-lwt.opam index e16e1efa0..0139e88a5 100644 --- a/cohttp-curl-lwt.opam +++ b/cohttp-curl-lwt.opam @@ -22,7 +22,7 @@ bug-reports: "https://github.com/mirage/ocaml-cohttp/issues" depends: [ "dune" {>= "3.0"} "ocaml" {>= "4.08"} - "ocurl" + "ocurl" {>= "0.9.2"} "http" {= version} "cohttp-curl" {= version} "stringext" diff --git a/cohttp-curl.opam b/cohttp-curl.opam index 5c4ae95e3..8895914a2 100644 --- a/cohttp-curl.opam +++ b/cohttp-curl.opam @@ -20,7 +20,7 @@ bug-reports: "https://github.com/mirage/ocaml-cohttp/issues" depends: [ "dune" {>= "3.0"} "ocaml" {>= "4.08"} - "ocurl" + "ocurl" {>= "0.9.2"} "http" {= version} "stringext" "odoc" {with-doc} diff --git a/dune-project b/dune-project index da5ed7351..c3657fe7c 100644 --- a/dune-project +++ b/dune-project @@ -264,7 +264,7 @@ (depends (ocaml (>= 4.08)) - ocurl + (ocurl (>= 0.9.2)) (http (= :version)) stringext)) @@ -277,7 +277,7 @@ (depends (ocaml (>= 4.08)) - ocurl + (ocurl (>= 0.9.2)) (http (= :version)) (cohttp-curl @@ -312,7 +312,7 @@ (description "An HTTP client that relies on Curl + Async for the backend. Does not require\nconduit for SSL.") (depends - ocurl + (ocurl (>= 0.9.2)) (http (= :version)) stringext From 211c8253457af727eac3c68c4fd8a3bb1299cbc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Tue, 10 Sep 2024 12:10:01 +0200 Subject: [PATCH 6/6] fix CI: update nix flake.lock --- flake.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/flake.lock b/flake.lock index a83db54a5..95e638b1d 100644 --- a/flake.lock +++ b/flake.lock @@ -42,11 +42,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1719186318, - "narHash": "sha256-H6bVeSIy34Fmhe756Q+hTlHnCgYLsKpOklY69tyj9NM=", + "lastModified": 1725916231, + "narHash": "sha256-kaU41Z43Uv2As0Sor8FPACJfWjkbUsWnZMtbCgqicvU=", "owner": "nix-ocaml", "repo": "nix-overlays", - "rev": "97eb195f9e19d3a006a84d978de2cdafe610d429", + "rev": "d63aa7b62251c70bbf0a28a67c30555077a2b758", "type": "github" }, "original": { @@ -57,17 +57,17 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1719146883, - "narHash": "sha256-DAyIfQgyqalov0DcEKRvDOUin7axELasaP6NCPt7UQA=", + "lastModified": 1725857262, + "narHash": "sha256-m9n0PncgZepVgmjOO1rfVXMgUACDOwZbhjSRjJ/NUpM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "084f8df2f3ff80cdec6f515931036f63c5d2f36c", + "rev": "5af6aefbcc55670e36663fd1f8a796e1e323001a", "type": "github" }, "original": { "owner": "NixOS", "repo": "nixpkgs", - "rev": "084f8df2f3ff80cdec6f515931036f63c5d2f36c", + "rev": "5af6aefbcc55670e36663fd1f8a796e1e323001a", "type": "github" } },