Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/changes/12299.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Fix: include the module alias in the transitive dependency closure with
`(include_subdirs qualified). (#12299, @anmonteiro)
5 changes: 4 additions & 1 deletion src/dune_rules/modules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,10 @@ module Group = struct
(* XXX ocamldep can't currently give us precise dependencies for
modules under [(include_subdirs qualified)] directories. For that
reason we currently depend on everything under the sub-directory. *)
Module_name.Map.values g.modules |> List.concat_map ~f:closure_node
let closure =
Module_name.Map.values g.modules |> List.concat_map ~f:closure_node
in
lib_interface :: closure
| _ -> [ lib_interface ]

and closure_node = function
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Test `(include_subdirs qualified)` with sandboxing

$ mkdir lib
$ cat > dune-project <<EOF
> (lang dune 3.20)
> EOF

$ mkdir lib/sub
$ cat > lib/dune <<EOF
> (include_subdirs qualified)
> (library (name foo))
> EOF
$ cat > lib/bar.ml <<EOF
> let hello = Sub.Hello.hello
> EOF
$ cat > lib/sub/hello.ml <<EOF
> let hello = "hello from sub"
> EOF

$ DUNE_SANDBOX=symlink dune build

Transitive deps file includes the alias module

$ cat _build/default/lib/.foo.objs/foo__Bar.impl.d
lib/bar.ml: Sub
$ cat _build/default/lib/.foo.objs/foo__Bar.impl.all-deps
foo__Sub
foo__Sub__Hello
Loading