Browse Source

Bump OCaml framework versions (#8639)

* chore: bump OCaml/webmachine versions

* chore: bump OCaml/httpaf versions
Robin Björklin 1 year ago
parent
commit
23be80bc12

+ 1 - 1
frameworks/OCaml/httpaf/dune

@@ -1,3 +1,3 @@
 (executable
  (name httpaf_unix)
- (libraries httpaf httpaf-lwt-unix lwt lwt.unix yojson))
+ (libraries httpaf httpaf-lwt-unix lwt lwt.unix yojson unix))

+ 1 - 1
frameworks/OCaml/httpaf/dune-project

@@ -1 +1 @@
-(lang dune 2.7)
+(lang dune 3.9)

+ 1 - 1
frameworks/OCaml/httpaf/httpaf.dockerfile

@@ -2,7 +2,7 @@
 
 # https://github.com/rbjorklin/techempower-ocaml-image
 # Use pre-built image with all dependencies for faster test times
-FROM rbjorklin/techempower-ocaml-image:4.14.1-4bf86567
+FROM rbjorklin/techempower-ocaml-image:5.1.1-b58c72ee
 
 # https://caml.inria.fr/pub/docs/manual-ocaml/libref/Gc.html
 # https://linux.die.net/man/1/ocamlrun

+ 1 - 1
frameworks/OCaml/httpaf/httpaf_unix.ml

@@ -170,7 +170,7 @@ let main () =
           accept_loop socket handler);
       let forever, _ = Lwt.wait () in
       Lwt_main.run forever;
-      exit 0 )
+      exit 0)
   done;
 
   while true do

+ 1 - 1
frameworks/OCaml/webmachine/src/dune-project

@@ -1,4 +1,4 @@
-(lang dune 2.7)
+(lang dune 3.9)
 (name webmachine-tfb)
 
 (generate_opam_files true)

+ 1 - 1
frameworks/OCaml/webmachine/src/lib.opam

@@ -6,7 +6,7 @@ license: "MIT"
 homepage: "https://github.com/TechEmpower/FrameworkBenchmarks"
 bug-reports: "https://github.com/TechEmpower/FrameworkBenchmarks/issues"
 depends: [
-  "dune" {>= "2.7" & >= "2.8.5"}
+  "dune" {>= "3.9" & >= "2.8.5"}
   "biniou" {>= "1.2.1"}
   "yojson" {>= "1.7.0"}
   "atd" {>= "2.2.1"}

+ 1 - 1
frameworks/OCaml/webmachine/src/src/bin/dune

@@ -1,5 +1,5 @@
 (executable
- (libraries webmachine lwt cohttp-lwt-unix caqti caqti-lwt caqti-driver-postgresql yojson atdgen-runtime lib)
+ (libraries webmachine lwt cohttp-lwt-unix caqti caqti-lwt caqti-driver-postgresql yojson atdgen-runtime lib unix)
  (preprocess (pps lwt_ppx))
  (public_name tfb)
  (package tfb)

+ 3 - 5
frameworks/OCaml/webmachine/src/src/bin/tfb.ml

@@ -39,14 +39,13 @@ let or_error m =
       Error (Database_error (Caqti_error.show err)) |> Lwt.return
 
 let select_random =
-  Caqti_request.find Caqti_type.int
-    Caqti_type.(tup2 int int)
+  let open Caqti_request.Infix in
+  Caqti_type.(int ->! tup2 int int)
     "SELECT id, randomNumber FROM World WHERE id = $1"
 
 class hello =
   object (self)
     inherit [Cohttp_lwt.Body.t] Wm.resource
-
     method! allowed_methods rd = Wm.continue [ `GET ] rd
 
     method content_types_provided rd =
@@ -68,7 +67,6 @@ class hello =
 class db =
   object (self)
     inherit [Cohttp_lwt.Body.t] Wm.resource
-
     method! allowed_methods rd = Wm.continue [ `GET ] rd
 
     method content_types_provided rd =
@@ -228,7 +226,7 @@ let main () =
       Lwt.async (fun () -> Server.create ~mode:(`TCP (`Socket socket)) config);
       let forever, _ = Lwt.wait () in
       Lwt_main.run forever;
-      exit 0 )
+      exit 0)
   done;
   while true do
     Unix.pause ()

+ 1 - 1
frameworks/OCaml/webmachine/src/src/lib/dune

@@ -1,7 +1,7 @@
 (library
  (name lib)
  (public_name lib)
- (libraries yojson atdgen-runtime)
+ (libraries yojson atdgen-runtime unix)
  (preprocess (pps lwt_ppx)))
 
 (rule

+ 1 - 1
frameworks/OCaml/webmachine/src/tfb.opam

@@ -6,7 +6,7 @@ license: "MIT"
 homepage: "https://github.com/TechEmpower/FrameworkBenchmarks"
 bug-reports: "https://github.com/TechEmpower/FrameworkBenchmarks/issues"
 depends: [
-  "dune" {>= "2.7" & >= "2.8.5"}
+  "dune" {>= "3.9" & >= "2.8.5"}
   "webmachine" {>= "0.7.0"}
   "lwt" {>= "5.4.1"}
   "conf-libev" {>= "4-12"}

+ 1 - 1
frameworks/OCaml/webmachine/webmachine.dockerfile

@@ -1,6 +1,6 @@
 # https://github.com/rbjorklin/techempower-ocaml-image
 # Use pre-built image with all dependencies for faster test times
-FROM rbjorklin/techempower-ocaml-image:4.14.1-4bf86567
+FROM rbjorklin/techempower-ocaml-image:5.1.1-b58c72ee
 
 ENV DIR project