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

Port to ppxlib and OCaml 4.11 (continuation of #111 and #118) #121

Merged
merged 14 commits into from
May 24, 2020

Conversation

thierry-martinez
Copy link
Contributor

This pull-request pursues the work that @rgrinberg and @kit-ty-kate started to port ppx_deriving_yojson to ppxlib and OCaml 4.11. See #111 and #118.

My commit includes only minor modifications for location handling. Previously, !Ast_helper.default_loc was used without being initialized: I tried to use more precise location informations when available.

This was referenced May 21, 2020
@thierry-martinez thierry-martinez changed the title Port to ppxlib and OCaml 4.11 (continuation o f#111 and #118) Port to ppxlib and OCaml 4.11 (continuation of #111 and #118) May 21, 2020
Copy link
Contributor

@gasche gasche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks nice, thanks! (And thanks to @rgrinberg and @kit-ty-kate of course.)

One uninformed question: there is a deep change in the way locations are being handled, now they are threaded through the plugin as a new parameter. This is a new change you made. Can you explain why it is necessary? (I guess this is something about a difference in the way ppx_metaquot vs. ppxlib's metaquoter work?)

Is this something that should be documented for other authors of ppx_deriving plugins? (Do I correctly understand that this means that the ppxlib change has more severe backward-compatibility implications than we thought at first?)

@thierry-martinez
Copy link
Contributor Author

there is a deep change in the way locations are being handled, now they are threaded through the plugin as a new parameter. This is a new change you made. Can you explain why it is necessary? (I guess this is something about a difference in the way ppx_metaquot vs. ppxlib's metaquoter work?)

Yes, ppxlib.metaquot expects loc to be bound in the environment, while ppx_tools.metaquot relied on !Ast_helper.default_loc: we already noted this change in ocaml-ppx/ppx_deriving#206 (comment) but it is worth documenting this for other authors.

@gasche
Copy link
Contributor

gasche commented May 24, 2020

Let me go ahead and merge this one as well. Thanks @thierry-martinez and @rgrinberg !

It is not completely clear when we will be ready to migrate all ppx_deriving plugins to the ppxlib approach (for example we found an upstream bug in the process, ocaml-ppx/ocaml-migrate-parsetree#97 , and I wonder if we should wait for it to be fixed; there are some compatibility issues that need ironing out or careful documentation). What @thierry-martinez proposed is thus to create pre-ppxlib branch to not delay the 4.11-compatible release process. This is what we are doing for now (master has ppxlib support, but is not quite release-ready, and pre-ppxlib is the boring, safe approach for yet another OCaml release).

@gasche gasche merged commit d067114 into ocaml-ppx:master May 24, 2020
kit-ty-kate added a commit to kit-ty-kate/opam-repository that referenced this pull request Nov 6, 2020
CHANGES:

  * Update to ppx_deriving 5.0 and ppxlib
    (ocaml-ppx/ppx_deriving_yojson#121)
    Rudi Grinberg, Thierry Martinez, Kate Deplaix and Gabriel Scherer

  * Fix issues when the equality operator `(=)` is shadowed
    (ocaml-ppx/ppx_deriving_yojson#126, ocaml-ppx/ppx_deriving_yojson#128, fixes ocaml-ppx/ppx_deriving_yojson#79)
    Martin Slota, Kate Deplaix
kit-ty-kate added a commit to kit-ty-kate/opam-repository that referenced this pull request Nov 7, 2020
CHANGES:

  * Update to ppx_deriving 5.0 and ppxlib
    (ocaml-ppx/ppx_deriving_yojson#121)
    Rudi Grinberg, Thierry Martinez, Kate Deplaix and Gabriel Scherer

  * Fix issues when the equality operator `(=)` is shadowed
    (ocaml-ppx/ppx_deriving_yojson#126, ocaml-ppx/ppx_deriving_yojson#128, fixes ocaml-ppx/ppx_deriving_yojson#79)
    Martin Slota, Kate Deplaix
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.

4 participants