-
Notifications
You must be signed in to change notification settings - Fork 94
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
Fix for handle differences in sig_class for OCaml 5.1 vs OCaml 4.14 #1018
Conversation
@@ -1037,6 +1037,7 @@ and read_signature_noenv env parent (items : Odoc_model.Compat.signature) = | |||
else shadowed | |||
in | |||
loop (ModuleType mtd :: acc, shadowed) rest | |||
#if OCAML_VERSION < (5,1,0) |
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.
You could restrict the ifdef to the pattern rather than duplicate the code, since we only need to ignore ghost items.
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.
I've changed this to just ifdef the pattern.
I forgot about this iterator on signature items when updating for 5.1, sorry about this. The compiler has a specialized iterator on visible signature items with the aim to avoid similar issues, I am not sure if would make to vendor this iterator in odoc? |
@Octachron we need to keep track of where in the structure we are, and I think that's quite hard with the iterators, isn't it? |
After more testing I found an issue with this change against
https://github.com/tmcgilchrist/odoc/blob/ocaml_5_1_fix/src/loader/cmi.cppo.ml#L939 inside the Happily nothing else has failed with the same error in ocaml-docs-ci :-) |
b4f11fc
to
79df28e
Compare
79df28e
to
32de8a7
Compare
Thanks! We need this change in the other branches (2.3 and master) and to cut patch releases. But, |
@panglesd shall I prep a PR for the other branches this change need to exist on? |
Thanks @tmcgilchrist ! I was going to open the PRs myself, since I also want to investigate the |
It seems that the following command triggers the
|
Here is a minimal repro:
Note that the following version does not raise:
which is very strange. I compared the typedtree for the two versions and, keeping only the relevant part, and, here is the result: Failing version:
Passing version
Notice the two nesting of
@Octachron do you have any idea? I tend to think it's 1. |
Signed-off-by: Paul-Elliot <peada@free.fr>
CHANGES: Additions - OCaml 5.1.0 further compatibility (@tmcgilchrist, ocaml/odoc#1018)
@panglesd How did you get the tree structure in #1018 (comment)? That would be helpful to diagnose the issues in future. |
I used the The
to get the typedtree output! |
Can we have a new release with this change ? |
A release for 2.2 series would be appreciated. That would cross off a few more failing package for ocaml-docs-ci. |
CHANGES: Additions - OCaml 5.1.0 further compatibility (@tmcgilchrist, ocaml/odoc#1018)
Fixes the issue reported as #1007
4979052 is a direct fix for the exception
b4f11fc pins the version of odoc-parser as per meta-data changes in opam-repository see https://github.com/ocaml/opam-repository/blob/master/packages/odoc/odoc.2.2.1/opam
cc @jonludlam I can cherry pick 4979052 onto 2.3.0. For ocaml-docs-ci we could use a new release of 2.2.x and 2.3.x.