forked from ocaml/dune
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: re-add
public_name
conflict check (ocaml#10585)
Signed-off-by: Antonio Nuno Monteiro <[email protected]>
- Loading branch information
1 parent
4e29393
commit 3f35fd1
Showing
3 changed files
with
106 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...ackbox-tests/test-cases/lib-collision/lib-collision-public-same-public-name-same-folder.t
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
Public libraries using the same library name, in the same context, defined in | ||
the same folder. | ||
|
||
$ mkdir -p a b | ||
|
||
$ cat > dune-project << EOF | ||
> (lang dune 3.13) | ||
> (package (name bar) (allow_empty)) | ||
> EOF | ||
|
||
$ cat > a/dune << EOF | ||
> (library | ||
> (name foo) | ||
> (public_name bar.foo)) | ||
> (library | ||
> (name bar) | ||
> (public_name bar.foo)) | ||
> EOF | ||
|
||
Without any consumers of the libraries | ||
|
||
$ dune build | ||
File "a/dune", lines 1-3, characters 0-44: | ||
1 | (library | ||
2 | (name foo) | ||
3 | (public_name bar.foo)) | ||
Error: Public library bar.foo is defined twice: | ||
- a/dune:4 | ||
- a/dune:1 | ||
[1] | ||
|
||
With some consumer | ||
|
||
$ cat > dune << EOF | ||
> (executable | ||
> (name main) | ||
> (libraries foo)) | ||
> EOF | ||
|
||
$ cat > main.ml <<EOF | ||
> let () = Foo.x | ||
> EOF | ||
|
||
$ dune build | ||
File "a/dune", lines 1-3, characters 0-44: | ||
1 | (library | ||
2 | (name foo) | ||
3 | (public_name bar.foo)) | ||
Error: Public library bar.foo is defined twice: | ||
- a/dune:4 | ||
- a/dune:1 | ||
[1] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters