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

[new release] ppx_deriving (6.0.0) #25675

Closed
wants to merge 2 commits into from

Conversation

NathanReb
Copy link
Contributor

Type-driven code generation for OCaml

CHANGES:

CHANGES:

* Fix a bug in `[@@deriving make]` that caused errors when it was used on a set
  of type declarations containing at least one non record type.
  ocaml-ppx/ppx_deriving#281
  (@NathanReb)

* Embed errors instead of raising exceptions when generating code
  with `ppx_deriving.make`
  ocaml-ppx/ppx_deriving#281
  (@NathanReb)

* Remove `[%derive.iter ...]`, `[%derive.map ...]` and `[%derive.fold ...]`
  extensions
  ocaml-ppx/ppx_deriving#278
  (Simmo Saan)

* Port standard plugins to ppxlib registration and attributes
  ocaml-ppx/ppx_deriving#263
  (Simmo Saan)

* Optimize forwarding in eq and ord plugins
  ocaml-ppx/ppx_deriving#252
  (Simmo Saan)

* Delegate quoter to ppxlib
  ocaml-ppx/ppx_deriving#263
  (Simmo Saan)

* Introduce `Ppx_deriving_runtime.Stdlib` with OCaml >= 4.07.
  This module already exists in OCaml < 4.07 but was missing otherwise.
  ocaml-ppx/ppx_deriving#258
  (Kate Deplaix)
@sim642
Copy link
Contributor

sim642 commented Apr 15, 2024

Most CI errors seem to be related to ocaml-ppx/ppx_deriving#279 (which isn't in the changelog):

#=== ERROR while compiling ppx_deriving_yojson.3.7.0 ==========================#
# context              2.2.0~beta3~dev | linux/x86_64 | ocaml-base-compiler.4.14.2 | file:///home/opam/opam-repository
# path                 ~/.opam/4.14/.opam-switch/build/ppx_deriving_yojson.3.7.0
# command              ~/.opam/opam-init/hooks/sandbox.sh build dune build -p ppx_deriving_yojson -j 39
# exit-code            1
# env-file             ~/.opam/log/ppx_deriving_yojson-7-9f30e6.env
# output-file          ~/.opam/log/ppx_deriving_yojson-7-9f30e6.out
### output ###
# (cd _build/default && /home/opam/.opam/4.14/bin/ocamlc.opt -w -40 -g -bin-annot -I src/.ppx_deriving_yojson_runtime.objs/byte -I /home/opam/.opam/4.14/lib/ppx_deriving/runtime -I /home/opam/.opam/4.14/lib/result -intf-suffix .ml -no-alias-deps -o src/.ppx_deriving_yojson_runtime.objs/byte/ppx_deriving_yojson_runtime.cmo -c -impl src/ppx_deriving_yojson_runtime.ml)
# File "src/ppx_deriving_yojson_runtime.ml", line 20, characters 32-45:
# 20 | type 'a error_or = ('a, string) Result.result
#                                      ^^^^^^^^^^^^^
# Error: Unbound type constructor Result.result
# (cd _build/default && /home/opam/.opam/4.14/bin/ocamlopt.opt -w -40 -g -I src/.ppx_deriving_yojson_runtime.objs/byte -I src/.ppx_deriving_yojson_runtime.objs/native -I /home/opam/.opam/4.14/lib/ppx_deriving/runtime -I /home/opam/.opam/4.14/lib/result -intf-suffix .ml -no-alias-deps -o src/.ppx_deriving_yojson_runtime.objs/native/ppx_deriving_yojson_runtime.cmx -c -impl src/ppx_deriving_yojson_runtime.ml)
# File "src/ppx_deriving_yojson_runtime.ml", line 20, characters 32-45:
# 20 | type 'a error_or = ('a, string) Result.result
#                                      ^^^^^^^^^^^^^
# Error: Unbound type constructor Result.result

Maybe existing versions of it need an upper bound on ppx_deriving now. A new version of ppx_deriving_yojson including ocaml-ppx/ppx_deriving_yojson#153 is probably needed.

@NathanReb
Copy link
Contributor Author

It looks to me like this errors are side effects of this change indeed but come from the fact that those package use Result without explicitly depending on it.

The fix is likely to add that dependency to ppx_deriving_yojson, I'll take care of that!

@NathanReb
Copy link
Contributor Author

Okay this is more complicated than I thought. While removing result we seem to have messed up Ppx_deriving_runtime which for some reason re-includes the standard library in a weird way.

Since we removed an overriden Result module there that was defining the type equality ('a, 'err) t = ('a, 'err) result (which is already defined by the result compat package btw), including Ppx_deriving_runtime as is done in ppx_deriving_yojson makes the standard Result module shadow the compat one and therefore causes this error because the standard Result module does not define a result type, only t.

@NathanReb
Copy link
Contributor Author

We could either add an upper bound on ppx_deriving in ppx_deriving_yojson or simply fix this small part of the change in ppx_deriving.

Given both ppx_deriving.api and ppx_deriving.runtime are to be deprecated, I'd be slightly in favor of fixing this in ppx_deriving so it has one last clean version before we deprecate the deriver creation API.

@NathanReb
Copy link
Contributor Author

I'm closing once again, will release 6.0.1 with the fix to Ppx_deriving_runtime.

@NathanReb NathanReb closed this Apr 17, 2024
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

Successfully merging this pull request may close these issues.

2 participants