Skip to content

Commit

Permalink
Fix #567
Browse files Browse the repository at this point in the history
The alias module needs an implementation for non-jbuilder users.
  • Loading branch information
Jeremie Dimino committed Mar 14, 2018
1 parent 28abc60 commit 24f9b10
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 14 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

- Reduce the number of simultaneously opened fds (#578)

- Always produce an implementation for the alias module, for
non-jbuilder users (Fix #576)

- Accept and ignore upcoming new library fields: `ppx.driver`,
`inline_tests` and `inline_tests.backend`

Expand Down
18 changes: 8 additions & 10 deletions src/gen_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -322,18 +322,16 @@ module Gen(P : Params) = struct
String_map.mem modules main_module_name) then
None
else if String_map.mem modules main_module_name then
let file ext =
Some { Module.File.
name = sprintf "%s__%s-gen" lib.name ext
; syntax = OCaml
}
in
(* The tests don't pass with 4.02 if we don't do that *)
let needs_impl = ctx.version < (4, 03, 0) in
(* This module needs an implementaion for non-jbuilder
users of the library:
https://github.com/ocaml/dune/issues/567 *)
Some
{ Module.name = main_module_name ^ "__"
; impl = if needs_impl then file ".ml" else None
; intf = if not needs_impl then file ".mli" else None
; intf = None
; impl = Some { name = sprintf "%s__.ml-gen" lib.name
; syntax = OCaml
}
; obj_name = lib.name ^ "__"
}
else
Expand Down
3 changes: 2 additions & 1 deletion test/blackbox-tests/test-cases/intf-only/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ Successes:
$ $JBUILDER build --display short --root foo -j1 --debug-dep 2>&1 | grep -v Entering
ocamldep test/bar.ml.d
ocamldep foo.ml.d
ocamlc .foo.objs/foo__.{cmi,cmti}
ocamlc .foo.objs/foo__.{cmi,cmo,cmt}
ocamldep intf.mli.d
ocamlopt .foo.objs/foo__.{cmx,o}
ocamlc .foo.objs/foo__Intf.{cmi,cmti}
ocamlc .foo.objs/foo.{cmi,cmo,cmt}
ocamlopt .foo.objs/foo.{cmx,o}
Expand Down
6 changes: 4 additions & 2 deletions test/blackbox-tests/test-cases/js_of_ocaml/run.t
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
$ $JBUILDER build -j1 --display short --root . --dev bin/technologic.bc.js @install lib/x.cma.js lib/x__Y.cmo.js bin/z.cmo.js
ocamlc lib/stubs.o
ocamlopt .ppx/js_of_ocaml-ppx/ppx.exe
ocamlc lib/.x.objs/x__.{cmi,cmti}
ocamlc lib/.x.objs/x__.{cmi,cmo,cmt}
ocamlmklib lib/dllx_stubs.so,lib/libx_stubs.a
ppx lib/x.pp.ml
ppx lib/y.pp.ml
ppx bin/technologic.pp.ml
ppx bin/z.pp.ml
ocamlopt lib/.x.objs/x__.{cmx,o}
ocamldep lib/x.pp.ml.d
ocamldep lib/y.pp.ml.d
ocamldep bin/technologic.pp.ml.d
Expand Down Expand Up @@ -34,8 +35,9 @@
break it
fix it
$ $JBUILDER build -j1 --display short --root . bin/technologic.bc.js @install
ocamlc lib/.x.objs/x__.{cmi,cmti}
ocamlc lib/.x.objs/x__.{cmi,cmo,cmt}
ocamlc lib/.x.objs/x__Y.{cmi,cmo,cmt}
ocamlopt lib/.x.objs/x__.{cmx,o}
ocamlc lib/.x.objs/x.{cmi,cmo,cmt}
ocamlopt lib/.x.objs/x__Y.{cmx,o}
ocamlc lib/x.cma
Expand Down
3 changes: 2 additions & 1 deletion test/blackbox-tests/test-cases/scope-bug/run.t
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
$ $JBUILDER build -j1 --display short --root . @install
ocamldep alib/alib.ml.d
ocamldep alib/main.ml.d
ocamlc alib/.alib.objs/alib__.{cmi,cmti}
ocamlc alib/.alib.objs/alib__.{cmi,cmo,cmt}
ocamldep blib/blib.ml.d
ocamldep blib/sub/sub.ml.d
ocamlopt alib/.alib.objs/alib__.{cmx,o}
ocamlc blib/sub/.sub.objs/sub.{cmi,cmo,cmt}
ocamlopt blib/sub/.sub.objs/sub.{cmx,o}
ocamlc blib/.blib.objs/blib.{cmi,cmo,cmt}
Expand Down

0 comments on commit 24f9b10

Please sign in to comment.