Skip to content

Commit

Permalink
Merge pull request #2440 from rgrinberg/remove-support-for-jbuild-files
Browse files Browse the repository at this point in the history
Remove compat symlinks for jbuild files
  • Loading branch information
rgrinberg authored Jul 24, 2019
2 parents e6b5bd1 + 116ef1a commit c596a53
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

- Enable `(explicit_js_mode)` by default. (#1941, @nojb)

- Stop symlinking object files to main directory for stanzas defined `jbuild`
files (#2440, @rgrinerg)

1.11.0 (23/07/2019)
-------------------

Expand Down
15 changes: 0 additions & 15 deletions src/module_compilation.ml
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,6 @@ let build_cm cctx ~dep_graphs ~precompiled_cmi ~cm_kind (m : Module.t) =
Option.value_exn (Obj_dir.Module.cmt_file obj_dir m ~ml_kind) in
(fn :: other_targets, A "-bin-annot")
in
if CC.dir_kind cctx = Jbuild then begin
(* Symlink the object files in the original directory for
backward compatibility *)
let old_dst =
(Module.obj_name m) ^ (Cm_kind.ext cm_kind)
|> Path.Build.relative dir
in
SC.add_rule sctx ~dir
(Build.symlink ~src:(Path.build dst) ~dst:old_dst);
List.iter other_targets ~f:(fun in_obj_dir ->
let in_dir = Path.Build.relative dir
(Path.Build.basename in_obj_dir) in
SC.add_rule sctx ~dir
(Build.symlink ~src:(Path.build in_obj_dir) ~dst:in_dir))
end;
let opaque_arg =
let intf_only = cm_kind = Cmi && not (Module.has m ~ml_kind:Impl) in
if opaque
Expand Down
17 changes: 13 additions & 4 deletions test/blackbox-tests/test-cases/ocamldep-multi-stanzas/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,19 @@
library, executable, and executables stanzas in this jbuild file. Note that
each module cannot appear in more than one "modules" field - it must belong
to a single library or executable.
Error: Multiple rules generated for _build/default/lib.cmo:
- <internal location>
- <internal location>
[1]
Entering directory 'jbuild'
ocamldep .lib.objs/lib.ml.d
ocamlc .lib.objs/byte/lib.{cmi,cmo,cmt}
ocamlopt .lib.objs/native/lib.{cmx,o}
ocamlopt lib.{a,cmxa}
ocamldep .test.eobjs/lib.ml.d
ocamldep .test.eobjs/test.ml.d
ocamlc .test.eobjs/byte/lib.{cmi,cmo,cmt}
ocamlc .test.eobjs/byte/test.{cmi,cmo,cmt}
ocamlopt .test.eobjs/native/lib.{cmx,o}
ocamlopt .test.eobjs/native/test.{cmx,o}
ocamlopt test.exe
foo bar

$ dune build src/a.cma --debug-dep --display short --root jbuild
Entering directory 'jbuild'
Expand Down

0 comments on commit c596a53

Please sign in to comment.