-
Notifications
You must be signed in to change notification settings - Fork 413
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
melange: the compiler does not support -bin-annot-occurrences #10622
Conversation
Signed-off-by: Ulysse Gérard <thevoodoos@gmail.com>
cc @anmonteiro - do we want this, or fix this on the melange side? |
We’ll have to fix it in both sides I suppose. Where can I read more about this flag? |
let fn = Option.value_exn (Obj_dir.Module.cmt_file obj_dir m ~cm_kind ~ml_kind) in | ||
let annots = | ||
if Version.supports_bin_annot_occurrences ocaml.version | ||
then [ "-bin-annot"; "-bin-annot-occurrences" ] |
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.
spurious change? the previous version did not duplicate the flag name here
let annots = | ||
[ "-bin-annot" ] | ||
@ | ||
if Version.supports_bin_annot_occurrences ocaml.version |
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.
How about just maintaining the old code but introducing:
let supports_bin_annot_occurences = Version.supports_bin_annot_occurences ocaml.version && not cm_kind <> Melange in
actually, since melange supports 5.2, this is just a matter of supporting the flag. I bet it'd be nice to have occurrences support in Melange projects, too, so let me release a Melange version with support for this flag. |
released melange 4.0.1-52 with this change: ocaml/opam-repository#26043 |
Thanks @anmonteiro I guess that means this PR is not useful anymore ? |
I’d vote to close it |
When dune 3.16 uses ocaml 5.2 (or melange acting like a 5.2 compiler), it will pass `-bin-annot-occurences`, but `melange.4.0.0-52` doesn't support it (4.0.1-52 does support it). See melange-re/melange#1132 and ocaml/dune#10622.
When dune 3.16 uses ocaml 5.2 (or melange acting like a 5.2 compiler), it will pass `-bin-annot-occurences`, but `melange.4.0.0-52` doesn't support it (4.0.1-52 does support it). See melange-re/melange#1132 and ocaml/dune#10622.
The Melange compiler does not accept the
-bin-annot-occurrences
flag.The test relying on OCaml's version is therefore incorrect when building with melange compiler.
This PR adds a special case to prevent use of this flag when building with melange.