Skip to content

Commit 9543184

Browse files
authored
Demonstrate re-exports bug (#12783)
* test: demonstrate issue with unused-libs and re_exports Signed-off-by: Rudi Grinberg <[email protected]>
1 parent 33cd807 commit 9543184

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Demonstrate that re_exports is incorrectly triggering the unused library check:
2+
3+
$ cat >dune-project <<EOF
4+
> (lang dune 3.21)
5+
> EOF
6+
7+
$ cat >dune <<EOF
8+
> (library
9+
> (name foo)
10+
> (modules foo))
11+
> (library
12+
> (name bar)
13+
> (modules bar)
14+
> (libraries (re_export foo)))
15+
> EOF
16+
17+
$ touch foo.ml
18+
$ cat >bar.ml <<EOF
19+
> let x = ()
20+
> EOF
21+
22+
$ mkdir use
23+
$ cat >use/dune <<EOF
24+
> (executable
25+
> (libraries bar)
26+
> (name use))
27+
> EOF
28+
29+
$ cat >use/use.ml <<EOF
30+
> let () = Bar.x
31+
> EOF
32+
33+
$ dune build @use/unused-libs
34+
File "use/dune", lines 1-3, characters 0-41:
35+
1 | (executable
36+
2 | (libraries bar)
37+
3 | (name use))
38+
Error: Unused libraries:
39+
- foo
40+
[1]

0 commit comments

Comments
 (0)