Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[new release] cohttp-lwt-jsoo, cohttp, cohttp-lwt, cohttp-lwt-unix, cohttp-top, cohttp-async and cohttp-mirage (4.0.0) #18385

Merged
merged 5 commits into from
Mar 27, 2021

Conversation

mseri
Copy link
Member

@mseri mseri commented Mar 24, 2021

ocaml-cohttp -- an OCaml library for HTTP clients and servers

Cohttp is an OCaml library for creating HTTP daemons. It has a portable HTTP parser, and implementations using various asynchronous programming libraries:

  • Cohttp_lwt_unix uses the Lwt library, and specifically the UNIX bindings. It uses ocaml-tls as the TLS implementation to handle HTTPS connections.
  • Cohttp_async uses the Async library and async_ssl to handle HTTPS connections.
  • Cohttp_lwt exposes an OS-independent Lwt interface, which is used by the Mirage interface to generate standalone microkernels (use the cohttp-mirage subpackage).
  • Cohttp_lwt_jsoo compiles to a JavaScript module that maps the Cohttp calls to XMLHTTPRequests. This is used to compile OCaml libraries like the GitHub bindings to JavaScript and still run efficiently.

You can implement other targets using the parser very easily. Look at the IO signature in lib/s.mli and implement that in the desired backend.

CHANGES:

@camelus
Copy link
Contributor

camelus commented Mar 24, 2021

Commit: 25295eb

A pull request by opam-seasoned @mseri.

☀️ All lint checks passed 25295eb
  • These packages passed lint tests: cohttp-async.4.0.0, cohttp-lwt-jsoo.4.0.0, cohttp-lwt-unix.4.0.0, cohttp-lwt.4.0.0, cohttp-mirage.4.0.0, cohttp-top.4.0.0, cohttp.4.0.0, comby.1.2.2, doi2bib.0.3.0, git-cohttp-mirage.3.2.0, git-cohttp-mirage.3.3.0, git-cohttp-mirage.3.3.1, git-cohttp-mirage.3.3.2, git-cohttp-mirage.3.3.3, git-http.2.0.0, git-http.2.1.0, git-http.2.1.1, git-http.2.1.2, git-http.2.1.3

☀️ Installability check (+7)
  • new installable packages (7): cohttp.4.0.0 cohttp-async.4.0.0 cohttp-lwt.4.0.0 cohttp-lwt-jsoo.4.0.0 cohttp-lwt-unix.4.0.0 cohttp-mirage.4.0.0 cohttp-top.4.0.0

@mseri
Copy link
Member Author

mseri commented Mar 24, 2021

doi2bib test failure is related to a small leak in doi2bib: see mirage/ocaml-cohttp#730

@mseri
Copy link
Member Author

mseri commented Mar 24, 2021

I have a separate PR to partly revert #17577 since cohttp 4.0.0 breaks fewer things, but I will submit that separately once this is good and merged

@mseri
Copy link
Member Author

mseri commented Mar 24, 2021

I have reported the archive change of KaSim to the upstream repository

@mseri
Copy link
Member Author

mseri commented Mar 24, 2021

Te failure for comby is the same as doi2bib and related to mirage/ocaml-cohttp#730:

#=== ERROR while compiling comby.1.2.2 ========================================#
# context              2.0.8 | linux/x86_64 | ocaml-base-compiler.4.11.2 | file:///src
# path                 ~/.opam/4.11/.opam-switch/build/comby.1.2.2
# command              ~/.opam/4.11/bin/dune build -p comby -j 47 @install @runtest
# exit-code            1
# env-file             ~/.opam/log/comby-23-e7966f.env
# output-file          ~/.opam/log/comby-23-e7966f.out
### output ###
# File "test/common/test_server.ml", line 1, characters 0-0:
#          git (internal) (exit 1)
# (cd _build/default && /usr/bin/git --no-pager diff --no-index --color=always -u test/common/test_server.ml test/common/test_server.ml.corrected)
# diff --git a/test/common/test_server.ml b/test/common/test_server.ml.corrected
# index cd68a86..57a09c9 100644
# --- a/test/common/test_server.ml
# +++ b/test/common/test_server.ml.corrected
# @@ -202,6 +202,10 @@ let%expect_test "post_substitute" =
#    |> post `Substitute
#    |> print_string;
#  
# -  [%expect {| { "result": "oh hi there", "id": 0 } |}]
# +  [%expect {|
# +    Cohttp_lwt: body not consumed - leaking stream!
# +    Cohttp_lwt: body not consumed - leaking stream!
# +    Cohttp_lwt: body not consumed - leaking stream!
# +    { "result": "oh hi there", "id": 0 } |}]
#  
#  let () = kill ()

It is not really a failure, the warning informs that there are bodies that are not drained. Ping @rvantonder
EDIT: this seems fixed in comby 1.3.0 maybe it is just that the server tests in comby 1.3.0 are disabled

mseri and others added 3 commits March 25, 2021 21:00
…ohttp-top, cohttp-async and cohttp-mirage (4.0.0)

CHANGES:

- cohttp.response: fix malformed status header for custom status codes (@mseri @aalekseyev mirage/ocaml-cohttp#752)
- Remove dependency to base (@samoht mirage/ocaml-cohttp#745)
- fix opam files and dependencies
- add GitHub Actions workflow (@smorimoto mirage/ocaml-cohttp#739)
- lwt_jsoo: Forward exceptions to caller when response is null (@mefyl mirage/ocaml-cohttp#738)
- Remove wrapped false (@rgrinberg mirage/ocaml-cohttp#734)
- Use implicit executable dependency for generate.exe (@TheLortex mirage/ocaml-cohttp#735)
- cohttp: update HTTP codes (@emillon mirage/ocaml-cohttp#711)
- cohttp: add Uti.t to uri scheme (@brendanlong mirage/ocaml-cohttp#707)
- cohttp: fix chunked encoding of empty body (@mefyl mirage/ocaml-cohttp#715)
- cohttp-async: fix body not being uploaded with unchunked Async.Pipe (@mefyl mirage/ocaml-cohttp#706)
- cohttp-{async, lwt}: fix suprising behaviours of Body.is_empty (@anuragsoni mirage/ocaml-cohttp#714 mirage/ocaml-cohttp#712 mirage/ocaml-cohttp#713)
- cohttp-lwt-jsoo: rename Cohttp_lwt_xhr to Cohttp_lwt_jsoo for consistency (@mseri mirage/ocaml-cohttp#717)
- refactoring of tests (@mseri mirage/ocaml-cohttp#709, @dinosaure mirage/ocaml-cohttp#692)
- update documentation (@dinosaure mirage/ocaml-cohttp#716, @mseri mirage/ocaml-cohttp#720)
- cohttp: fix transfer-encoding ordering in headers (@mseri mirage/ocaml-cohttp#721)
- lower-level support for long-running cohttp-async connections (@brendanlong mirage/ocaml-cohttp#704)
- fix deadlock in logging (@dinosaure mirage/ocaml-cohttp#722)
- add of_form and to_form functions to body (@seliopou mirage/ocaml-cohttp#440, @mseri mirage/ocaml-cohttp#723)
- cohttp-lwt: partly inline read_response, fix body stream leak (@madroach @dinosaure mirage/ocaml-cohttp#696)
- improve media type parsing (@seliopou mirage/ocaml-cohttp#542, @dinosaure mirage/ocaml-cohttp#725)
- add comparison functions for Request.t and Response.t via ppx_compare (@msaffer-js @dinosaure mirage/ocaml-cohttp#686)
- [reverted] breaking changes to client and server API to use conduit
  3.0.0 (@dinosaure mirage/ocaml-cohttp#692). However, as the design discussion did not reach
  consensus, these changes were reverted to preserve better compatibility with
  existing cohttp users. (mirage/ocaml-cohttp#741,  @samoht)
@mseri
Copy link
Member Author

mseri commented Mar 25, 2021

Rebased to do the tests with the new relaxed constraints

@rvantonder
Copy link
Contributor

For #18385 (comment), I see it's running the tests there for comby 1.2.2 which I disabled in 1.3.0. Maybe it makes sense to just constrain cohttp on 1.2.2 to suppress this? For future versions I'll fix up the leak issue.

The new requests contain a scheme record field

Signed-off-by: Marcello Seri <[email protected]>
@mseri
Copy link
Member Author

mseri commented Mar 25, 2021

It looks good now. Only git-http needed some bounds (new versions are unaffected since they use the experimental new API). I think this is ready to be merged

@mseri
Copy link
Member Author

mseri commented Mar 26, 2021

PS: I tested this on macos, but I don't have a BSD system to run the tests on

@kit-ty-kate
Copy link
Member

Tested on FreeBSD. Thanks!

@kit-ty-kate kit-ty-kate merged commit 5d219ed into ocaml:master Mar 27, 2021
@mseri mseri deleted the release-cohttp-4.0.0 branch March 27, 2021 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants