diff --git a/CHANGES.md b/CHANGES.md index 302d33a373b..c318f670028 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,9 @@ Unreleased ---------- +- Allow `$ dune utop` to load libraries defined in data only directories + defined using `(subdir ..)` (#6631, @rgrinberg) + - Format dune files when they are named `dune-file`. This occurs when we enable the alternative file names project option. (#6566, @rgrinberg) diff --git a/src/dune_rules/utop.ml b/src/dune_rules/utop.ml index d6224540f05..3ce0f1f6b31 100644 --- a/src/dune_rules/utop.ml +++ b/src/dune_rules/utop.ml @@ -38,9 +38,7 @@ let libs_and_ppx_under_dir sctx ~db ~dir = | None -> Memo.return ([], []) | Some dir -> let+ libs, pps = - Source_tree_map_reduce.map_reduce - dir (* TODO this is wrong under [(subdir ..)] *) - ~traverse:{ data_only = false; vendored = true; normal = true } + Source_tree_map_reduce.map_reduce dir ~traverse:Sub_dirs.Status.Set.all ~f:(fun dir -> let dir = Path.Build.append_source (Super_context.context sctx).build_dir diff --git a/test/blackbox-tests/test-cases/utop/lib-under-subdir.t b/test/blackbox-tests/test-cases/utop/lib-under-subdir.t index 0575410332b..247c8b4bb14 100644 --- a/test/blackbox-tests/test-cases/utop/lib-under-subdir.t +++ b/test/blackbox-tests/test-cases/utop/lib-under-subdir.t @@ -22,8 +22,4 @@ dune utop should read libraries in (subdir ..) > EOF $ dune utop . -- foo.ml - File "foo.ml", line 1, characters 0-9: - 1 | Foolib.hw () - ^^^^^^^^^ - Error: Unbound module Foolib - [2] + foolib