Get rid of compatibility symlinks for Dune directories

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
This commit is contained in:
Jeremie Dimino 2018-06-12 18:47:30 +01:00 committed by Jérémie Dimino
parent 6abe76c4e7
commit de26077d28
5 changed files with 22 additions and 8 deletions

View File

@ -37,6 +37,7 @@ type t =
{ super_context : Super_context.t
; scope : Scope.t
; dir : Path.t
; dir_kind : File_tree.Dune_file.Kind.t
; obj_dir : Path.t
; modules : Module.t Module.Name.Map.t
; alias_module : Module.t option
@ -50,6 +51,7 @@ type t =
let super_context t = t.super_context
let scope t = t.scope
let dir t = t.dir
let dir_kind t = t.dir_kind
let obj_dir t = t.obj_dir
let modules t = t.modules
let alias_module t = t.alias_module
@ -59,12 +61,13 @@ let requires t = t.requires
let includes t = t.includes
let preprocessing t = t.preprocessing
let create ~super_context ~scope ~dir ?(obj_dir=dir) ~modules ?alias_module
?lib_interface_module ~flags ~requires
?(preprocessing=Preprocessing.dummy) () =
let create ~super_context ~scope ~dir ?(dir_kind=File_tree.Dune_file.Kind.Dune)
?(obj_dir=dir) ~modules ?alias_module ?lib_interface_module ~flags
~requires ?(preprocessing=Preprocessing.dummy) () =
{ super_context
; scope
; dir
; dir_kind
; obj_dir
; modules
; alias_module

View File

@ -16,6 +16,7 @@ val create
: super_context : Super_context.t
-> scope : Scope.t
-> dir : Path.t
-> ?dir_kind : File_tree.Dune_file.Kind.t
-> ?obj_dir : Path.t
-> modules : Module.t Module.Name.Map.t
-> ?alias_module : Module.t
@ -32,6 +33,7 @@ val for_alias_module : t -> t
val super_context : t -> Super_context.t
val scope : t -> Scope.t
val dir : t -> Path.t
val dir_kind : t -> File_tree.Dune_file.Kind.t
val obj_dir : t -> Path.t
val modules : t -> Module.t Module.Name.Map.t
val alias_module : t -> Module.t option

View File

@ -569,6 +569,7 @@ module Gen(P : Install_rules.Params) = struct
~super_context:sctx
~scope
~dir
~dir_kind
~obj_dir
~modules
?alias_module
@ -874,6 +875,7 @@ module Gen(P : Install_rules.Params) = struct
~super_context:sctx
~scope
~dir
~dir_kind
~obj_dir
~modules
~flags

View File

@ -74,7 +74,7 @@ let build_cm cctx ?sandbox ?(dynlink=true) ~dep_graphs ~cm_kind (m : Module.t) =
(fn :: other_targets, A "-bin-annot")
in
let hidden_targets = List.map other_targets ~f:(Target.file obj_dir) in
if obj_dir <> dir then begin
if CC.dir_kind cctx = Jbuild && obj_dir <> dir then begin
(* Symlink the object files in the original directory for
backward compatibility *)
let old_dst = Module.cm_file_unsafe m ~obj_dir:dir cm_kind in

View File

@ -8,10 +8,17 @@
each module cannot appear in more than one "modules" field - it must belong
to a single library or executable.
This warning will become an error in the future.
Multiple rules generated for _build/default/lib$ext_obj:
- <internal location>
- <internal location>
[1]
ocamldep lib.ml.d
ocamlc .lib.objs/lib.{cmi,cmo,cmt}
ocamlopt .lib.objs/lib.{cmx,o}
ocamlopt lib.{a,cmxa}
ocamldep test.ml.d
ocamlc .test.eobjs/lib.{cmi,cmo,cmt}
ocamlopt .test.eobjs/lib.{cmx,o}
ocamlc .test.eobjs/test.{cmi,cmo,cmt}
ocamlopt .test.eobjs/test.{cmx,o}
ocamlopt test.exe
foo bar
$ dune build src/a.cma --debug-dep --display short
File "src/dune", line 1, characters 0-0: