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

Fix #1107 #1108

Merged
merged 1 commit into from
Aug 7, 2018
Merged

Fix #1107 #1108

merged 1 commit into from
Aug 7, 2018

Conversation

rgrinberg
Copy link
Member

-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.

@rgrinberg rgrinberg requested review from emillon and a user August 7, 2018 08:38
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
Copy link

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

Copy link
Member Author

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.

@ghost
Copy link

ghost commented Aug 7, 2018

This change look good, but #1107 is about implementation only modules. I believe the flags for these latter ones are unchanged by this PR.

@rgrinberg
Copy link
Member Author

I believe the flags for these latter ones are unchanged by this PR.

How so? I think such modules would fall under opaque when it's switched on. Since we are just adding -opaque for any kind of cm_kind.

@ghost
Copy link

ghost commented Aug 7, 2018

Ah, yes you are right

Copy link
Collaborator

@emillon emillon left a 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>
@rgrinberg rgrinberg merged commit 0ec0f4d into ocaml:master Aug 7, 2018
rgrinberg added a commit to rgrinberg/opam-repository that referenced this pull request Aug 8, 2018
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)
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.

2 participants