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

More examples, including one which tests tls-async #11

Closed mbacarella closed 1 year ago

mbacarella commented 2 years ago

This depends on https://github.com/anmonteiro/gluten/pull/31 https://github.com/anmonteiro/ocaml-h2/pull/174

Also I added some self-signed certificates for the example SSL/TLS servers.

mbacarella commented 2 years ago

Oh, also, https://github.com/dialohq/ocaml-grpc/pull/11/files#diff-1fb9d92d4f0b89e8c93cdefc87d39436b213422961c40453cf2fef5f4a195c57L3

Not sure if this was (implicit_transitive_deps false) on purpose but I found it pretty hard to get the core/async examples to compile with it turned on, so I commented it out. Thoughts?

quernd commented 1 year ago

Thank you very much for this contribution, and sorry for the long delay.

I was hoping to merge this once h2 0.9.0 has landed in Opam because of the interface changes, but I think we still rely on some pin-depends. Anyway, I think we can bump h2 with https://github.com/dialohq/ocaml-grpc/pull/16 and then move on to your PR.

Not sure if this was (implicit_transitive_deps false) on purpose but I found it pretty hard to get the core/async examples to compile with it turned on, so I commented it out. Thoughts?

Yes, let's remove this. I wasn't even able to compile the library like this because of this error:

File "lib/grpc-async/connection.ml", line 1, characters 0-0:
Error: This expression has type Base.unit
       but an expression was expected of type unit
       Base.unit is abstract because no corresponding cmi file was found in path.
File "lib/grpc-async/grpc_async.ml", line 1, characters 0-0:
Error: This expression has type Base.unit
       but an expression was expected of type unit
       Base.unit is abstract because no corresponding cmi file was found in path.
wokalski commented 1 year ago

@quernd let's clean this up tomorrow morning. Please merge your PR if ready (I've reviewed and accepted it) and move on to this one 👍.

quernd commented 1 year ago

@mbacarella I merged the latest changes from main into your branch and that removes most of the diffs so reviewing will be easier. Do you mind if I push these commits directly to your branch?

Also with v.0.15.0 of the Jane Street libraries I ran into this

File "examples/greeter-client-tls-async/greeter_client_tls_async.ml", line 65, characters 2-13:
65 |   Command.run cmd
       ^^^^^^^^^^^
Error (alert deprecated): Async.Command.run
[since 2021-03] Use [Command_unix]
File "examples/greeter-client-tls-async/greeter_client_tls_async.ml", line 65, characters 2-13:
65 |   Command.run cmd
       ^^^^^^^^^^^
Error: This expression has type [ `Use_Command_unix ]
       This is not a function; it cannot be applied.

but it's easily fixed by using Command_unix instead of Command.

mbacarella commented 1 year ago

Do you mind if I push these commits directly to your branch?

Fine by me!