janestreet-deprecated/ppx_type_conv

Conflict with ppx_deriving arguments (non-optional labeled argument expected)

Closed this issue · 6 comments

copy commented

Compiling the code below yields:

% ocamlbuild -use-ocamlfind -pkg ppx_deriving.show -package ppx_deriving -pkg ppx_sexp_conv test.byte
+ ocamlfind ocamldep -package ppx_sexp_conv -package ppx_deriving -package ppx_deriving.show -modules test.ml > test.ml.depends
File "test.ml", line 1, characters 25-51:
Error: non-optional labeled argument expected
Command exited with code 2.
Compilation unsuccessful after building 1 target (0 cached) in 00:00:00.
type t = int [@@deriving show { with_path = false }]

Reporting here since the error is from this repository. This is with ppx_deriving 4.1+dev, ppx_type_conv v0.9.0 and ppx_sexp_conv v0.9.0.

This is only supported with the development version of ppx_type_conv. Ppx_deriving 4.1+dev is a branch i made. I'll backport support for this in ppx_type_conv v0.9 if the ppx_deriving changes are merged upstream.

I was also hit by this option handling difference recently when I use ppx_deriving and ppx_typerep_conv at the same time. Any news?

Me too, this prevents me from using visitors, since it expects a mandatory argument. Are there any informations on this?

It might be a little late to mention it, but why in hell do janestreet derivers and ppx_deriving use the same namespace? This seems to cause lots of trouble for pretty much no benefits.

Update: I tried the latest development version of ppx_type_conv via opam pin. The error is gone, but the deriver is apparently never invoked. It looks like there are some incompatibilities that are not caught by the typechecker.

@diml could you give me any hints on how to trace the problem and test a newer version?

This stuff is a bit complicated indeed, this is mostly for historical reason. I did some work to clean up things a bit earlier this year, the last part of the work is doing a minor release of ppx_core and ppx_type_conv. I think after that everything should work smoothly. I'll prepare this

This issue is fixed by: ocaml/opam-repository#10885