Skip to content

Commit bb02750

Browse files
committed
fix: load rules under subdir
data_only_dirs can also define libraries using (subdir ..) ps-id: 5af7aeb4-f29b-4338-aa14-fe2d568245be Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
1 parent 8779f66 commit bb02750

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

CHANGES.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Unreleased
22
----------
33

4+
- Allow `$ dune utop` to load libraries defined in data only directories
5+
defined using `(subdir ..)` (#6631, @rgrinberg)
6+
47
- Format dune files when they are named `dune-file`. This occurs when we enable
58
the alternative file names project option. (#6566, @rgrinberg)
69

src/dune_rules/utop.ml

+1-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ let libs_and_ppx_under_dir sctx ~db ~dir =
3838
| None -> Memo.return ([], [])
3939
| Some dir ->
4040
let+ libs, pps =
41-
Source_tree_map_reduce.map_reduce
42-
dir (* TODO this is wrong under [(subdir ..)] *)
43-
~traverse:{ data_only = false; vendored = true; normal = true }
41+
Source_tree_map_reduce.map_reduce dir ~traverse:Sub_dirs.Status.Set.all
4442
~f:(fun dir ->
4543
let dir =
4644
Path.Build.append_source (Super_context.context sctx).build_dir

test/blackbox-tests/test-cases/utop/lib-under-subdir.t

+1-5
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,4 @@ dune utop should read libraries in (subdir ..)
2222
> EOF
2323

2424
$ dune utop . -- foo.ml
25-
File "foo.ml", line 1, characters 0-9:
26-
1 | Foolib.hw ()
27-
^^^^^^^^^
28-
Error: Unbound module Foolib
29-
[2]
25+
foolib

0 commit comments

Comments
 (0)