Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
-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>
  • Loading branch information
rgrinberg committed Aug 7, 2018
1 parent b616c7e commit 53b65ed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ next

- Fix `$ jbuilder --dev` (#1104, fixes #1103, @rgrinberg)

- Fix #1107. `-opaque` wasn't correctly being added to modules without
an interface. (#1108, fix #1107, @rgrinberg)


1.1.0 (06/08/2018)
------------------
Expand Down
7 changes: 6 additions & 1 deletion src/module_compilation.ml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,12 @@ let build_cm cctx ?sandbox ?(dynlink=true) ~dep_graphs ~cm_kind (m : Module.t) =
SC.add_rule sctx (Build.symlink ~src:in_obj_dir ~dst:in_dir))
end;
let opaque_arg =
if opaque && cm_kind = Cmi then
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
in
if opaque || intf_only then
Arg_spec.A "-opaque"
else
As []
Expand Down

0 comments on commit 53b65ed

Please sign in to comment.