-
Notifications
You must be signed in to change notification settings - Fork 398
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(coq): duplicate theory prefix in COQPATH bug
This bug happens when using COQPATH so it won't affect most users. When having two theories A.B and A.C installed, dune will erroneously fail saying that the theory A has been defined twice. Signed-off-by: Ali Caglayan <alizter@gmail.com>
- Loading branch information
Showing
7 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
3 changes: 3 additions & 0 deletions
3
test/blackbox-tests/test-cases/coq/compose-installed-prefix-dupe.t/B/dune
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,3 @@ | ||
(coq.theory | ||
(name A.B) | ||
(package Theory1)) |
3 changes: 3 additions & 0 deletions
3
test/blackbox-tests/test-cases/coq/compose-installed-prefix-dupe.t/B/dune-project
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,3 @@ | ||
(lang dune 3.8) | ||
(using coq 0.8) | ||
(package (name Theory1)) |
Empty file.
3 changes: 3 additions & 0 deletions
3
test/blackbox-tests/test-cases/coq/compose-installed-prefix-dupe.t/C/dune
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,3 @@ | ||
(coq.theory | ||
(name A.C) | ||
(package Theory2)) |
3 changes: 3 additions & 0 deletions
3
test/blackbox-tests/test-cases/coq/compose-installed-prefix-dupe.t/C/dune-project
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,3 @@ | ||
(lang dune 3.8) | ||
(using coq 0.8) | ||
(package (name Theory2)) |
41 changes: 41 additions & 0 deletions
41
test/blackbox-tests/test-cases/coq/compose-installed-prefix-dupe.t/run.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,41 @@ | ||
If we have installed theories A.B and A.C then Dune should not complain that A | ||
is a duplicate theory. | ||
|
||
First we install our two theories with the conflicting name prefix. | ||
|
||
$ (cd B && dune build @install && dune install --prefix .) | ||
$ (cd C && dune build @install && dune install --prefix .) | ||
|
||
We add these to COQPATH | ||
|
||
$ export COQPATH=../B/lib/coq/user-contrib:../C/lib/coq/user-contrib:$COQPATH | ||
|
||
Now we create a theory that depends on both | ||
|
||
$ mkdir mytheory && cd mytheory | ||
|
||
$ cat > dune-project << EOF | ||
> (lang dune 3.8) | ||
> (using coq 0.8) | ||
> EOF | ||
|
||
$ cat > dune << EOF | ||
> (coq.theory | ||
> (name mytheory) | ||
> (theories A.B A.C)) | ||
> EOF | ||
|
||
$ cat > a.v << EOF | ||
> From A.B Require a. | ||
> From A.C Require a. | ||
> EOF | ||
|
||
|
||
$ dune build a.vo --display short | ||
Error: Coq theory A is defined twice: | ||
- theory A in | ||
$TESTCASE_ROOT/mytheory/../B/lib/coq/user-contrib/A | ||
- theory A in | ||
$TESTCASE_ROOT/mytheory/../C/lib/coq/user-contrib/A | ||
[1] | ||
|