diff --git a/Makefile b/Makefile index a1213572..0f459184 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,18 @@ .PHONY: all build clean test build: - jbuilder build --dev @install + dune build @install all: build test: - jbuilder runtest --dev + dune runtest install: - jbuilder install + dune install uninstall: - jbuilder uninstall + dune uninstall clean: rm -rf _build *.install diff --git a/README.md b/README.md index 40d96cb0..9476e058 100644 --- a/README.md +++ b/README.md @@ -62,10 +62,10 @@ opam install --deps-only httpaf After this, you may install a development version of the library using the install command as usual. -Tests can be run via jbuilder: +Tests can be run via dune: ```bash -jbuilder runtest +dune runtest ``` ## License diff --git a/async/dune b/async/dune new file mode 100644 index 00000000..411e6ed7 --- /dev/null +++ b/async/dune @@ -0,0 +1,7 @@ +(library + (name httpaf_async) + (public_name httpaf-async) + (wrapped false) + (libraries + async core angstrom-async faraday-async httpaf) + (flags (:standard -safe-string))) diff --git a/async/jbuild b/async/jbuild deleted file mode 100644 index a8903689..00000000 --- a/async/jbuild +++ /dev/null @@ -1,9 +0,0 @@ -(jbuild_version 1) - -(library - ((name httpaf_async) - (public_name httpaf-async) - (wrapped false) - (libraries - (async core angstrom-async faraday-async httpaf)) - (flags (:standard -safe-string)))) diff --git a/benchmarks/dune b/benchmarks/dune new file mode 100644 index 00000000..b6d08d02 --- /dev/null +++ b/benchmarks/dune @@ -0,0 +1,10 @@ +(executable + (libraries httpaf httpaf-async async core) + (modules wrk_async_benchmark) + (name wrk_async_benchmark) + (flags (:standard -w -9))) + +(executable + (name wrk_lwt_benchmark) + (modules Wrk_lwt_benchmark) + (libraries httpaf httpaf-lwt lwt.unix)) diff --git a/benchmarks/jbuild b/benchmarks/jbuild deleted file mode 100644 index 87b0897b..00000000 --- a/benchmarks/jbuild +++ /dev/null @@ -1,11 +0,0 @@ -(jbuild_version 1) - -(executable - ((libraries (httpaf httpaf-async async core)) - (modules (wrk_async_benchmark)) - (name wrk_async_benchmark))) - -(executable - ((name wrk_lwt_benchmark) - (modules (Wrk_lwt_benchmark)) - (libraries (httpaf httpaf-lwt lwt.unix)))) diff --git a/benchmarks/wrk_async_benchmark.ml b/benchmarks/wrk_async_benchmark.ml index 7c4043f2..784168a6 100644 --- a/benchmarks/wrk_async_benchmark.ml +++ b/benchmarks/wrk_async_benchmark.ml @@ -8,7 +8,7 @@ let text = "CHAPTER I. Down the Rabbit-Hole Alice was beginning to get very tir let text = Bigstring.of_string text let headers = Headers.of_list ["content-length", string_of_int (Bigstring.length text)] -let error_handler _ ?request error start_response = +let error_handler _ ?request:_ error start_response = let response_body = start_response Headers.empty in begin match error with | `Exn exn -> diff --git a/benchmarks/wrk_lwt_benchmark.ml b/benchmarks/wrk_lwt_benchmark.ml index e19be227..e5a96cf3 100644 --- a/benchmarks/wrk_lwt_benchmark.ml +++ b/benchmarks/wrk_lwt_benchmark.ml @@ -56,7 +56,7 @@ let connection_handler = reqd (Response.create `Not_found) "Route not found" in - let error_handler _ ?request error start_response = + let error_handler _ ?request:_ error start_response = let response_body = start_response Headers.empty in begin match error with diff --git a/dune-project b/dune-project new file mode 100644 index 00000000..799bf5a3 --- /dev/null +++ b/dune-project @@ -0,0 +1,3 @@ +(lang dune 1.5) + +(name httpaf) diff --git a/examples/async/async_echo_post.ml b/examples/async/async_echo_post.ml index 31ec4519..099ffde7 100644 --- a/examples/async/async_echo_post.ml +++ b/examples/async/async_echo_post.ml @@ -5,7 +5,7 @@ open Httpaf open Httpaf_async -let error_handler _ ?request error start_response = +let error_handler _ ?request:_ error start_response = let response_body = start_response Headers.empty in begin match error with | `Exn exn -> @@ -46,7 +46,7 @@ let main port max_accepts_per_batch () = Tcp.(Server.create_sock ~on_handler_error:`Raise ~backlog:10_000 ~max_connections:10_000 ~max_accepts_per_batch where_to_listen) (Server.create_connection_handler ~request_handler ~error_handler) - >>= fun server -> + >>= fun _server -> Deferred.never () let () = diff --git a/examples/async/dune b/examples/async/dune new file mode 100644 index 00000000..465e7fed --- /dev/null +++ b/examples/async/dune @@ -0,0 +1,5 @@ +(executables + (libraries httpaf httpaf-async async core) + (modules async_echo_post async_get async_post) + (names async_echo_post async_get async_post) + (flags (:standard -w -9))) diff --git a/examples/async/jbuild b/examples/async/jbuild deleted file mode 100644 index 0028c1fc..00000000 --- a/examples/async/jbuild +++ /dev/null @@ -1,4 +0,0 @@ -(executables - ((libraries (httpaf httpaf-async async core)) - (modules (async_echo_post async_get async_post)) - (names (async_echo_post async_get async_post)))) diff --git a/examples/lwt/dune b/examples/lwt/dune new file mode 100644 index 00000000..e90ca77c --- /dev/null +++ b/examples/lwt/dune @@ -0,0 +1,3 @@ +(executables + (names lwt_get lwt_post lwt_echo_server) + (libraries httpaf httpaf-lwt lwt lwt.unix)) diff --git a/examples/lwt/jbuild b/examples/lwt/jbuild deleted file mode 100644 index b21fe052..00000000 --- a/examples/lwt/jbuild +++ /dev/null @@ -1,5 +0,0 @@ -(jbuild_version 1) - -(executables - ((names (lwt_get lwt_post lwt_echo_server)) - (libraries (httpaf httpaf-lwt lwt lwt.unix)))) diff --git a/httpaf-async.opam b/httpaf-async.opam index 04e77a6b..af6a885b 100644 --- a/httpaf-async.opam +++ b/httpaf-async.opam @@ -7,13 +7,13 @@ homepage: "https://github.com/inhabitedtype/httpaf" bug-reports: "https://github.com/inhabitedtype/httpaf/issues" dev-repo: "git+https://github.com/inhabitedtype/httpaf.git" build: [ - ["jbuilder" "subst" "-p" name] {pinned} - ["jbuilder" "build" "-p" name "-j" jobs] - ["jbuilder" "runtest" "-p" name] {with-test} + ["dune" "subst"] {pinned} + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name] {with-test} ] depends: [ "ocaml" {>= "4.03.0"} - "jbuilder" {build & >= "1.0+beta10"} + "dune" {build} "angstrom-async" {>= "0.9.0"} "faraday-async" "async" diff --git a/httpaf-lwt.opam b/httpaf-lwt.opam index 1c47a2c9..e28c52e0 100644 --- a/httpaf-lwt.opam +++ b/httpaf-lwt.opam @@ -7,14 +7,14 @@ homepage: "https://github.com/inhabitedtype/httpaf" bug-reports: "https://github.com/inhabitedtype/httpaf/issues" dev-repo: "git+https://github.com/inhabitedtype/httpaf.git" build: [ - ["jbuilder" "subst" "-p" name] {pinned} - ["jbuilder" "build" "-p" name "-j" jobs] + ["dune" "subst"] {pinned} + ["dune" "build" "-p" name "-j" jobs] ] depends: [ "ocaml" {>= "4.03.0"} "faraday-lwt-unix" "httpaf" - "jbuilder" {build & >= "1.0+beta10"} + "dune" {build} "lwt" ] synopsis: "Lwt support for http/af" diff --git a/httpaf.opam b/httpaf.opam index d4ae80a7..623acd94 100644 --- a/httpaf.opam +++ b/httpaf.opam @@ -6,13 +6,13 @@ homepage: "https://github.com/inhabitedtype/httpaf" bug-reports: "https://github.com/inhabitedtype/httpaf/issues" dev-repo: "git+https://github.com/inhabitedtype/httpaf.git" build: [ - ["jbuilder" "subst" "-p" name] {pinned} - ["jbuilder" "build" "-p" name "-j" jobs] - ["jbuilder" "runtest" "-p" name] {with-test} + ["dune" "subst"] {pinned} + ["dune" "build" "-p" name "-j" jobs] + ["dune" "runtest" "-p" name] {with-test} ] depends: [ "ocaml" {>= "4.03.0"} - "jbuilder" {build & >= "1.0+beta10"} + "dune" {build} "alcotest" {with-test} "angstrom" {>= "0.9.0"} "faraday" {>= "0.5.0"} diff --git a/lib/dune b/lib/dune new file mode 100644 index 00000000..fdcd49f5 --- /dev/null +++ b/lib/dune @@ -0,0 +1,6 @@ +(library + (name httpaf) + (public_name httpaf) + (libraries + angstrom faraday bigstringaf result) + (flags (:standard -safe-string))) diff --git a/lib/jbuild b/lib/jbuild deleted file mode 100644 index 17e97851..00000000 --- a/lib/jbuild +++ /dev/null @@ -1,8 +0,0 @@ -(jbuild_version 1) - -(library - ((name httpaf) - (public_name httpaf) - (libraries - (angstrom faraday bigstringaf result)) - (flags (:standard -safe-string)))) diff --git a/lib_test/dune b/lib_test/dune new file mode 100644 index 00000000..2735bcb2 --- /dev/null +++ b/lib_test/dune @@ -0,0 +1,22 @@ +(executables + (libraries bigstringaf httpaf alcotest) + (modules test_httpaf test_httpaf_server test_httpaf_client simulator) + (names test_httpaf test_httpaf_server test_httpaf_client)) + +(alias + (name runtest) + (package httpaf) + (deps test_httpaf.exe) + (action (run %{deps}))) + +(alias + (name runtest) + (package httpaf) + (deps test_httpaf_server.exe) + (action (run %{deps}))) + +(alias + (name runtest) + (package httpaf) + (deps test_httpaf_client.exe) + (action (run %{deps}))) diff --git a/lib_test/jbuild b/lib_test/jbuild deleted file mode 100644 index dfce1d32..00000000 --- a/lib_test/jbuild +++ /dev/null @@ -1,24 +0,0 @@ -(jbuild_version 1) - -(executables - ((libraries (bigstringaf httpaf alcotest)) - (modules (test_httpaf test_httpaf_server test_httpaf_client simulator)) - (names (test_httpaf test_httpaf_server test_httpaf_client)))) - -(alias - ((name runtest) - (package httpaf) - (deps (test_httpaf.exe)) - (action (run ${<})))) - -(alias - ((name runtest) - (package httpaf) - (deps (test_httpaf_server.exe)) - (action (run ${<})))) - -(alias - ((name runtest) - (package httpaf) - (deps (test_httpaf_client.exe)) - (action (run ${<})))) diff --git a/lwt/dune b/lwt/dune new file mode 100644 index 00000000..47a2c7c7 --- /dev/null +++ b/lwt/dune @@ -0,0 +1,5 @@ +(library + (name httpaf_lwt) + (public_name httpaf-lwt) + (libraries faraday-lwt-unix httpaf lwt.unix) + (flags (:standard -safe-string))) diff --git a/lwt/jbuild b/lwt/jbuild deleted file mode 100644 index 179e7f9a..00000000 --- a/lwt/jbuild +++ /dev/null @@ -1,7 +0,0 @@ -(jbuild_version 1) - -(library - ((name httpaf_lwt) - (public_name httpaf-lwt) - (libraries (faraday-lwt-unix httpaf lwt.unix)) - (flags (:standard -safe-string))))