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 2cc258a commit 9d6c81a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 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
8 changes: 6 additions & 2 deletions src/gen_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,14 @@ module Gen(P : Params) = struct
String_map.mem main_module_name modules) then
None
else if String_map.mem main_module_name modules then
(* 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 = None
; intf = Some { name = lib.name ^ "__.mli-gen"
; intf = None
; impl = Some { name = sprintf "%s__.ml-gen" lib.name
; syntax = OCaml
}
; obj_name = lib.name ^ "__"
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 9d6c81a

Please sign in to comment.