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-unix-nossl, cohttp-lwt-jsoo, cohttp, cohttp-… #17571

Merged
merged 1 commit into from
Nov 6, 2020

Conversation

mseri
Copy link
Member

@mseri mseri commented Nov 3, 2020

…lwt, cohttp-lwt-unix, cohttp-lwt-unix-ssl, cohttp-top, cohttp-async and cohttp-mirage (3.0.0)

CHANGES:

EDIT: @dinosaure added a nice account of the breaking changes on the upstream repo. I am reporting it here.

breaking changes, the API to launch a server was updated and types used by the client were updated too. A clean-recompilation of your project should be enough for users of the client part - however, if you deeply use Conduit, you should look the release of Conduit 3.0.0 (documentation & howto) to be aware about the new usage of this library.

About the server-side part of Cohttp, we broke the API according to Conduit 3.0.0. The user must update the way to launch a Cohttp server. The technical update is about the ~mode argument which disappears to let 3 arguments: cfg, service and protocol.

This allow users to choose which kind of service they want (a TLS service or a simple TCP service). Such values are provided by Conduit 3.0.0. For example, if you want to launch a simple HTTP (no secure) service, you can use:

  • Conduit_{async,lwt}.TCP.service
  • Conduit_{async,lwt}.TCP.protocol

The encryption layer can be provided by Conduit_{async,lwt}_{tls,ssl}.TCP module (tls means an usage of ocaml-tls, ssl means a usage of OpenSSL). Then, the cfg value depends on the service value. For example, for Conduit_lwt.TCP.service, cfg = Conduit_lwt.TCP.configuration. In this way, the user is able to launch a HTTP server with:

let cfg =
  { Conduit_lwt.TCP.sockaddr= Unix.ADDR_INET (Unix.inet_addr_loopback, 8080)
  ; capacity= 40 }
let run cohttp_config =
  Cohttp_lwt_unix.Server.create cfg Conduit_lwt.TCP.protocol Conduit_lwt.TCP.service
    cohttp_config

Of course, the documentation was updated according this new interface. More details can be found into Conduit 3.0.0 too about encryption services.

Finally, an other breaking change is about the TLS stack used by cohttp-lwt-unix on the client side. In anyway, cohttp-lwt-unix uses ocaml-tls to handle TLS. To explicitely use OpenSSL, users will need to depend ong cohttp-lwt-unix-ssl instead. If they do not want to use the encryption layer, they now need to use cohttp-lwt-unix-nossl.

See also the porting notes posted on the companion breakages PR: #17577 (comment)

@mseri
Copy link
Member Author

mseri commented Nov 3, 2020

A number of packages will need an upper bound due to the breaking changes, but many packages should work fine as they are. I would like to use the CI revdeps to see what needs fixing, once those are fixed, I will rebase and undraft the PR

@mseri mseri marked this pull request as draft November 3, 2020 17:59
@camelus
Copy link
Contributor

camelus commented Nov 3, 2020

Commit: 8647f38

A pull request by opam-seasoned @mseri.

☀️ All lint checks passed 8647f38
  • These packages passed lint tests: cohttp-async.3.0.0, cohttp-lwt-jsoo.3.0.0, cohttp-lwt-unix-nossl.3.0.0, cohttp-lwt-unix-ssl.3.0.0, cohttp-lwt-unix.3.0.0, cohttp-lwt.3.0.0, cohttp-mirage.3.0.0, cohttp-top.3.0.0, cohttp.3.0.0

☀️ Installability check (+9)
  • new installable packages (9): cohttp.3.0.0 cohttp-async.3.0.0 cohttp-lwt.3.0.0 cohttp-lwt-jsoo.3.0.0 cohttp-lwt-unix.3.0.0 cohttp-lwt-unix-nossl.3.0.0 cohttp-lwt-unix-ssl.3.0.0 cohttp-mirage.3.0.0 cohttp-top.3.0.0

mseri added a commit to mseri/opam-repository that referenced this pull request Nov 5, 2020
See https://github.com/ocaml/opam-repository/pulls

Signed-off-by: Marcello Seri <marcello.seri@gmail.com>
mseri added a commit that referenced this pull request Nov 5, 2020
@mseri mseri marked this pull request as ready for review November 5, 2020 08:25
@mseri
Copy link
Member Author

mseri commented Nov 5, 2020

This should be fine now

@hannesm
Copy link
Member

hannesm commented Nov 5, 2020

I think you should rebase on master now that #17577 is merged :) -- to give the CI another revdeps run

…lwt, cohttp-lwt-unix, cohttp-lwt-unix-ssl, cohttp-top, cohttp-async and cohttp-mirage (3.0.0)

CHANGES:

- 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)
- port to conduit 3.0.0: minor breaking changes on the server API, an explicit distinction
  between cohttp-lwt-unix (using tls), cohttp-lwt-notls and cohttp-lwt-ssl (using lwt_ssl),
  and includes ssl in cohttp-async (@dinosaure mirage/ocaml-cohttp#692)
- 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)
@mseri
Copy link
Member Author

mseri commented Nov 5, 2020

I was just about doing that, in #17577 I had introduced a typo, which was just fixed by @kit-ty-kate

@mseri
Copy link
Member Author

mseri commented Nov 6, 2020

All green finally. I am going to prepare the release announcement tonight or tomorrow, then merge

@hannesm
Copy link
Member

hannesm commented Nov 6, 2020

🎉 🎉 🎉

@mseri mseri merged commit 634d990 into ocaml:master Nov 6, 2020
@mseri mseri deleted the release-cohttp-3.0.0 branch November 6, 2020 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants