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

Bump internal AST to 4.10 #130

Merged
merged 4 commits into from
Jun 24, 2020
Merged

Conversation

NathanReb
Copy link
Collaborator

@NathanReb NathanReb commented Jun 9, 2020

Closes #129

Besides the straightforward changes, there are a couple things worth noting:

  • Location checks needed a bit of adjustement for the functors relocation functions. I talked with @trefis to make sure I wasn't messing things up so that should be good.
  • The map_with_path and map_with_ctxt classes now need to deal with module bindings and module declarations without ids, i.e. things like module _ = .... For now I choosed to add the underscore to the path in both cases so that the paths would differ between the inside and the outside of an unnamed module, ie in:
let x = ...

module _ = struct
  let y = ...
end

x and y would have different paths. That means that now one could end up with e.g., A.B._.c as a path. That's not perfect and I'm happy to change that but I think paths need to carry that information somehow. Maybe we could try to identify them using their location in the file somehow, something like:
A.B.<unnamed module at line x>.c.

As a follow up I'll look into our tests and make sure they are ran with the latest versions of OCam rather than with 4.06 and 4.07 as they currently are! I ran the test locally and all seems fine! If we improve the situation with unnamed modules as mentioned above, might be worth adding tests for it though.

@NathanReb NathanReb requested review from trefis and a user June 9, 2020 16:20
@NathanReb NathanReb requested a review from xclerc as a code owner June 9, 2020 16:20
@NathanReb NathanReb force-pushed the bump-ast-4-10 branch 2 times, most recently from 9bd921a to 68cc0a2 Compare June 9, 2020 16:23
@ghost
Copy link

ghost commented Jun 10, 2020

@ceastlund are you happy with using _ for paths? Inside JS, I remeber that ppx_sexp_conv uses that. It's for error messages IIRC.

@ceastlund
Copy link
Collaborator

If these are just synthetic paths used for error messages and the like, I don't have a strong opinion on how we represent them. Using the same placeholder they're declared with seems fine.

@ghost
Copy link

ghost commented Jun 10, 2020

Cool. @trefis could you confirm that you are happy with the changes to the location checks?

Otherwise, I had a quick look and the rest of the changes look good to me.

@trefis
Copy link
Collaborator

trefis commented Jun 10, 2020

Yep, LGTM.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Looks good!

@NathanReb
Copy link
Collaborator Author

I just pushed a fix, the CI was broken for OCaml < 4.08

@NathanReb
Copy link
Collaborator Author

The appveyor builds seem to fail to install cinaps for some reason.

@ghost
Copy link

ghost commented Jun 16, 2020

My guess is that it relies on a behaviour of the stdlib that was broken before 4.08. Let's drop AppVeyor testing for OCaml < 4.08.

@NathanReb
Copy link
Collaborator Author

Maybe it's worth including #148 into this PR then!

@ghost
Copy link

ghost commented Jun 16, 2020

Seems good

@NathanReb
Copy link
Collaborator Author

Just to make sure we're all on the same page, the tests are now only run for 4.10. As I mentioned in the last commit's message, our current test suite can't be compatible with 4.09 or lower since there are differences in how ASTs get printed.

@ghost
Copy link

ghost commented Jun 16, 2020

Yes. It seems too much of a pain to keep the testsuite compatible with multiple versions of the compiler, especially with the compiler libs behaviour changing all the time.

@NathanReb
Copy link
Collaborator Author

One last thing to fix and then we should be good to go: the 4.10 builds on appveyor seem to fail when running cinaps, something about a permission denied:

C:\cygwin64\home\appveyor\.opam\ocaml-variants.4.10.0+mingw64c\bin\dune.exe "runtest" "-p" "ppxlib" "-j" "2" (CWD=C:/cygwin64/home/appveyor/.opam/ocaml-variants.4.10.0+mingw64c/.opam-switch/build/ppxlib.0.13.0)
       cinaps alias src/cinaps (exit 2)
 (cd _build/default/src && .cinaps/cinaps.exe -diff-cmd -)
 Fatal error: exception Sys_error("C:\cygwin64\tmp\cinaps5ab341.mli: Permission denied")
       cinaps alias src/cinaps (exit 2)
 (cd _build/default/src && .cinaps/cinaps.exe -diff-cmd -)
 Fatal error: exception Sys_error("C:\cygwin64\tmp\cinaps5ab341.mli: Permission denied")
[ERROR] The compilation of ppxlib failed at "C:\\cygwin64\\home\\appveyor\\.opam\\ocaml-variants.4.10.0+mingw64c\\bin\\dune.exe runtest -p ppxlib -j 2".

@ghost
Copy link

ghost commented Jun 16, 2020

Can we disable cinaps on appveyor? We only need it to run once.

@NathanReb
Copy link
Collaborator Author

That means disabling the tests on appveyor though, not sure there's a better approach to this unfortunately.

@ghost
Copy link

ghost commented Jun 22, 2020

It is what it is. ppxlib doesn't do much that is system dependent so it's not the end of the world. And it's only until we can figure out what's going on with cinaps on Windows.

Signed-off-by: Nathan Rebours <[email protected]>
Signed-off-by: Nathan Rebours <[email protected]>
Unfortunately, due to differences in how ASTs are printed between
4.09 and 4.10 we can only test 4.10. We could eventually try to make the
tests compatible between those versions, I'm wondering how often this is
susceptible to break.

Signed-off-by: Nathan Rebours <[email protected]>
NathanReb added a commit to NathanReb/opam-repository that referenced this pull request Jul 8, 2020
CHANGES:

- Bump ppxlib's AST to 4.10 (ocaml-ppx/ppxlib#130, @NathanReb)

- Remove omp_config from `Expansion_context` and replace it with `tool_name`
  (ocaml-ppx/ppxlib#149, @NathanReb)

- Change undocumented `Ppxlib.Driver.map_structure` to return a ppxlib's
  `structure` instead of a `Migrate_parsetree.Driver.some_structure`.
  (ocaml-ppx/ppxlib#153, @NathanReb)
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.

Bump the Selected_ast to 410
3 participants