-
Notifications
You must be signed in to change notification settings - Fork 29
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
Support ocaml 4.08 and 4.09 #46
Conversation
It is not used in this module, and does not exist in 4.08.
Great, thanks a lot @emillon ! I'll try to review this ASAP. Main question I have tho is if we should just add support for this in OMP directly as requested in ocaml-ppx/ocaml-migrate-parsetree#52 ? I'm unsure how much extra work that'd be, just mentioning so this PR is linked to the above issue. |
The support here is really ad hoc to what's used in |
Indeed I dunno what OMP maintainers may think; I suggest we ping them. Meanwhile I don't see a problem adding this to ppx_import and removing it later if we migrate the code there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, tested on my own projects on 4.07.1 and 4.08.1 and so far seems to work! A couple of comments:
- see the note about using %{ocaml_version} and avoiding the gen.ml wrapper altoghether
- I wonder if we want to introduce the
UTypes
changed constructors, maybe we could indeed just use aliases to the real constructor names as in OMP?
OK! I switched it to use the types from the 4.07 As for |
Sounds good @emillon , thanks! I think this is ready to merge, and do a release. WDYT folks @gasche @whitequark ? |
[I also wonder if you want to squash the last commit that undoes the introduction of Utypes as to get a slightly better git history] |
Done 👍 |
@emillon I also realized while testing the release that you should add an entry in CHANGES.md |
Sure, will do! Should I try to add 4.09 support while I'm at it? with the new way of reusing 4.07 types it might not be too bad. |
As you want @emillon ; we can always do that in a separate PR. I propose to merge tomorrow afternoon if no futher comments arise [but can wait if you want] |
And that should be ready. Thanks! |
Thanks a lot @emillon
Great!
This is likely some legacy code from the initial port to dune.
Changes look fine to me; I'll leave some time for comments, then merge + release to opam. We should update the |
I cleaned the history a bit, should now be all good. |
For Types, values are shallowly migrated to 4.07 versions of `Types.module_type` and `Types.signature_item`. The code to convert for `Types` to 4.07 versions is selected by dune according to the compiler version. In 4.09, the argument passed to init_path is changed, so the right piece of code is selected.
It is used as a rewriter.
CHANGES: * OCaml 4.08 and 4.09 support ocaml-ppx/ppx_import#46 (Etienne Millon)
Hi!
This PR adds support to OCaml 4.08 (#41). There are several aspects to this:
compiler-libs
(see the first commits)Types.module_type
andTypes.signature_item
from different versions of the compiler. To do so, I created aUtypes
module that contains just what we need, and some shallow conversion functions are provided in a compat module that is selected by dune.This is not perfect but I think it's a nice solution until OMP or a similar library supports
Types
.Some additional remarks:
Let me know what you think.
Thanks