imandra-ai / ocaml-gcloud

OCaml bindings to Google Cloud Platform APIs
MIT License
25 stars 4 forks source link

Fails to build from source - dependency versions maybe? #4

Closed ismith closed 5 years ago

ismith commented 5 years ago

And get the following error on running dune build

File "src/auth.ml", line 260, characters 53-58:
Error: This variant expression is expected to have type algorithm
       The constructor RS256 does not belong to type Jwt.algorithm
Hint: Did you mean HS256?

OCaml version 4.07.0.

https://hackernoon.com/rs256-in-ocaml-reasonml-9ae579b9420a led me to https://github.com/besport/ocaml-jwt/pull/16, which, given the author (@mattjbray) makes me think you're using that branch of ocaml-jwt (https://github.com/AestheticIntegration/ocaml-jwt.git#rsa256).

Which fails to compile for lack of Nocrypto.Rsa.PKCS1.sign, which brings us to setting up a build of mirleft/ocaml-nocrypt from #master:

File "src/cipher_block.ml", line 132, characters 7-35:
Error: Unbound module EndianBytes
Command exited with code 2.

Any chance you'd be willing to share more about how your build env is setup (or opam list), or whether you plan to get ocaml-gcloud into an opam-ready state?

actionshrimp commented 5 years ago

I've just added a missing constraint for ppx_sexp_conv (unfortunately I think this means you have to be on ocaml < 4.07), and also an opam lockfile with all other versions in, including a couple of pins. The main difference will probably be:

opam pin nocrypo --dev-repo and opam pin jwt git+https://github.com/AestheticIntegration/ocaml-jwt.git#b5c706e5bf087312f135867bb5a38e268512d2b8

after that it built on a fresh opam switch for me.

ismith commented 5 years ago

Yep, now builds for me with ocaml 4.06 (but not 4.07, due to the ppx_sexp_conv constraint). Thanks!