dialohq / ocaml-grpc

gRPC library for OCaml
https://dialohq.github.io/ocaml-grpc
BSD 3-Clause "New" or "Revised" License
58 stars 9 forks source link

New release of grpc and grpc-eio OPAM package #42

Closed aryx closed 8 months ago

aryx commented 8 months ago

Hi,

Would it be possible to release grpc-eio on OPAM? I would love to migrate out of grpc-lwt to grpc-eio but could not find an easy way to install it via opam. I'd rather avoid vendoring the code.

quernd commented 8 months ago

Absolutely, thanks for bringing this up. I'll try to prepare for a release during the day.

Sorry for not being very proactive with OPAM releases, we use Nix internally (and before that, we had lots of pinned dependencies).

aryx commented 8 months ago

No problem. The great thing with dune is that's super composable, so I was able to simply vendor ocaml-grpc in a subdirectory and it all worked!

aryx commented 8 months ago

I was able to switch from lwt to eio, and oh boy, this is far simpler!

quernd commented 8 months ago

I tagged a new version and opened a PR in the OPAM repository, but CI is failing: https://github.com/ocaml/opam-repository/pull/24660

I don't understand because OCaml-CI for this repo builds without any problems... I'll get back to it.

aryx commented 8 months ago

I saw some issue also with eio 0.12. You're using h2-eio which is using gluten-eio which is not compatible with eio 0.12 :(

quernd commented 8 months ago

The build failures are due to the fact that the dune file for grpc-async requires h2-async, but we removed it from the dependencies in grpc-async.opam. The reasoning was that technically, none of the grpc-{async,eio,lwt} libraries need the respective specialized h2 backend because they only use the agnostic part of h2 and the user is supposed to set up the HTTP2 transport.

It's a bit inconsistent though, as grpc-eio.opam still requires h2-eio, so the examples get away with requiring h2-lwt-unix and h2-async only because they get h2-eio through grpc-eio.

I'm going to fix this and then it should all work out.

quernd commented 8 months ago

Alternatively, we can make grpc-{async,eio,lwt} depend on h2-{async,eio,lwt} even if not strictly required since it makes little sense to use them without. That might be less surprising in the end. What do you think @tmcgilchrist?

tmcgilchrist commented 8 months ago

No issues with making grpc-eio consistent with the other libraries. Just need to modify the tutorial to and the README to be clear what dependencies you need. Something like https://github.com/dialohq/ocaml-grpc/pull/43?

You're using h2-eio which is using gluten-eio which is not compatible with eio 0.12

@aryx I don't believe that is correct gluten-eio should work with latest eio version see https://github.com/anmonteiro/gluten/pull/66. What errors are you seeing?

aryx commented 8 months ago

Maybe antonio fixed the code, but I don't think he released a new OPAM package for it. If you look at https://opam.ocaml.org/packages/h2-eio/ it depends on the latest gluten-eio which is https://opam.ocaml.org/packages/gluten-eio/gluten-eio.0.4.1/ and this explicitely says eio < 0.12

aryx commented 8 months ago

So when you try to install grpc-eio, the opam conflict resolver will install eio 0.11, not 0.12, because it can't solve the constraints otherwise.

tmcgilchrist commented 8 months ago

You're quite right I'm using source versions of both those dependencies (not opam versions).

quernd commented 8 months ago

Thanks for your input @tmcgilchrist In the meantime, I worked around the OPAM CI failure by adding h2-async to the dependencies in the grpc-async.opam file. We can publish a patch release to address this, I merged both #43 and #44.

tmcgilchrist commented 8 months ago

Thanks @quernd.

New releases of h2/gluten requested https://github.com/anmonteiro/ocaml-h2/issues/227 and https://github.com/anmonteiro/gluten/issues/72. Hopefully Antonio has some time to make them soon.

aryx commented 8 months ago

Thx! It works. grpc-eio is now available on OPAM.

anmonteiro commented 8 months ago

I'm releasing gluten and h2 shortly, thanks everyone.

anmonteiro commented 8 months ago

gluten release: https://github.com/ocaml/opam-repository/pull/24676 h2 release: https://github.com/ocaml/opam-repository/pull/24687

tmcgilchrist commented 8 months ago

Thanks Antonio.

On Fri, 27 Oct 2023 at 4:50 am, Antonio Nuno Monteiro < @.***> wrote:

gluten release: ocaml/opam-repository#24676 https://github.com/ocaml/opam-repository/pull/24676 h2 release: ocaml/opam-repository#24687 https://github.com/ocaml/opam-repository/pull/24687

— Reply to this email directly, view it on GitHub https://github.com/dialohq/ocaml-grpc/issues/42#issuecomment-1781571045, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABJXOMWPUQT2IMMFFAGCYLYBKPHLAVCNFSM6AAAAAA6K3KFP6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBRGU3TCMBUGU . You are receiving this because you were mentioned.Message ID: @.***>

aryx commented 1 month ago

Is there a plan to release gprc and grpc-eio 0.3 that is compatible with eio 1.0? It's still using eio 0.11 I think right now.

wokalski commented 1 month ago

yes @aryx, I had to switch context to something else but finishing the open Eio rewrite PR is still near the top of my todo and I'm planning to finish it asap (this week).

aryx commented 1 month ago

update: I was wrong; you can actually already use grpc 0.2.0 with eio 1.0.

aryx commented 1 month ago

still, could be nice to release a grpc-eio 0.3.0; maybe there's some nice things since the last release.