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

dune/jbuilder support unreleased? #23

Closed
timbertson opened this issue Feb 16, 2019 · 6 comments
Closed

dune/jbuilder support unreleased? #23

timbertson opened this issue Feb 16, 2019 · 6 comments

Comments

@timbertson
Copy link

I'm not very clear on PPX actually works, so apologies if I'm just doing it wrong. But here's my sample code:

$ cat dune
(executable
	(name rpc)
	(preprocess (pps ppx_deriving_protobuf))
)

$ cat rpc.ml
type t = int [@@deriving protobuf]

let () =
	Printf.printf "%S\n" (Bytes.to_string (Protobuf.Encoder.encode_exn to_protobuf 1))

With ocaml 4.06.1 and ppx_deriving_protobuf 2.6 (in a fresh opam switch), running this gives me:

$ jbuilder build rpc.exe
# ( ... )
File "rpc.ml", line 4, characters 40-67:
Error: Unbound module Protobuf

If I peek in _build/log and use the same ppx command executable to dump the output, I see it's not actually generating any code:

$ (cd _build/default && .ppx/e62b9ba70091960bbddb1d98645d590a/ppx.exe -o /dev/stdout --impl rpc.ml)
type t = int[@@deriving protobuf]
let () =
  Printf.printf "%S\n"
    (Bytes.to_string (Protobuf.Encoder.encode_exn to_protobuf 1))

After I opam pin add ppx_deriving_protobuf git@github.com:ocaml-ppx/ppx_deriving_protobuf.git, it works:

$ jbuilder build rpc.exe
$ ./_build/default/rpc.exe 
"\b\001"

Looking at the git log, I'm guessing the port to jbuilder (c5ece55) also makes the library work in jbuilder/dune, but that's ahead of the latest v2.6. Any chance of a release?

Side note: there's a warning about an unused rec in from_protobuf, which dune turns into an error (which is why I used the jbuilder command as a workaround).

@XVilka
Copy link
Contributor

XVilka commented Jul 9, 2019

It makes sense to prepare the release to support newer OCaml and ppx-deriving versions, once released: ocaml/opam-repository#14454

@XVilka
Copy link
Contributor

XVilka commented Jul 12, 2019

Now ppx_deriving and ppx_deriving_yojson were released and updated in opam repository, nothing stops from the releasing new version of ppx_deriving_protobuf, I think.

@XVilka
Copy link
Contributor

XVilka commented Jul 17, 2019

Would be possible to craft a new release once #26 is merged.

@XVilka
Copy link
Contributor

XVilka commented Aug 7, 2019

@gasche can you please release a new version with 4.08 support?

@gasche
Copy link
Contributor

gasche commented Aug 7, 2019

I'm in holidays right now; please feel free to ping me again in a couple days if I haven't sent more signal.

@XVilka
Copy link
Contributor

XVilka commented Aug 10, 2019

Thanks to @gasche it can be closed now.

@gasche gasche closed this as completed Aug 10, 2019
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

No branches or pull requests

3 participants