-
Notifications
You must be signed in to change notification settings - Fork 412
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 #1107 #1108
Fix #1107 #1108
Conversation
src/module_compilation.ml
Outdated
let intf_only = (* we add opaque even outside "dev" for mli only *) | ||
cm_kind = Cmi | ||
&& not (Module.has_impl m) | ||
&& Ocaml_version.supports_opaque_for_mli ctx.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.
It feel a bit odd that supports_opaque_for_mli
is connected to the module being intf_only
. It would seem clearer to me to write:
if opaque || (intf_only && Ocaml_version.supports_opaque_for_mli ctx.version) then
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.
Yeah, I think that would be better as well.
This change look good, but #1107 is about implementation only modules. I believe the flags for these latter ones are unchanged by this PR. |
How so? I think such modules would fall under |
Ah, yes you are right |
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.
👍 reads better
-opaque should be passed for mli only modules or for all modules when opaque mode is on Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
CHANGES: - Fix `$ jbuilder --dev` (ocaml/dune#1104, fixes ocaml/dune#1103, @rgrinberg) - Fix dune exec when `--build-dir` is set to an absolute path (ocaml/dune#1105, fixes ocaml/dune#1101, @rgrinberg) - Fix duplicate profile argument in suggested command when an external library is missing (ocaml/dune#1109, ocaml/dune#1106, @emillon) - `-opaque` wasn't correctly being added to modules without an interface. (ocaml/dune#1108, fix ocaml/dune#1107, @rgrinberg) - Fix validation of library `name` fields and make sure this validation also applies when the `name` is derived from the `public_name`. (ocaml/dune#1110, fix ocaml/dune#1102, @rgrinberg) - Fix a bug causing the toplevel `env` stanza in the workspace file to be ignored when at least one context had `(merlin)` (ocaml/dune#1114, @diml)
-opaque should be passed for mli only modules or for all modules when opaque
mode is on
This is overdoing the opaque mode a bit. As we don't really need to pass it when creating cmo/cmx files for which the cmi exists, but it seems like it doesn't do any harm.