-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
host context resolution: topological sort to ensure no duplication an…
…d error on bad configurations. and tests. Signed-off-by: Lucas Pluvinage <[email protected]>
- Loading branch information
Showing
33 changed files
with
294 additions
and
39 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
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
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
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
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
6 changes: 6 additions & 0 deletions
6
test/blackbox-tests/test-cases/custom-cross-compilation/bad-configuration/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,6 @@ | ||
(executable | ||
(name p) | ||
(public_name p) | ||
) | ||
|
||
(rule (with-stdout-to file (run ./p.exe))) |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/custom-cross-compilation/bad-configuration/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 @@ | ||
(lang dune 1.10) |
10 changes: 10 additions & 0 deletions
10
test/blackbox-tests/test-cases/custom-cross-compilation/bad-configuration/dune-workspace
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,10 @@ | ||
(lang dune 1.10) | ||
(context (default)) | ||
(context (default | ||
(name cross-1) | ||
(host default) | ||
)) | ||
(context (default | ||
(name cross-2) | ||
(host cross-1) | ||
)) |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/custom-cross-compilation/bad-configuration/p.ml
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 @@ | ||
let () = Printf.printf "%d\n" 137 |
Empty file.
6 changes: 6 additions & 0 deletions
6
test/blackbox-tests/test-cases/custom-cross-compilation/context-not-found/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,6 @@ | ||
(executable | ||
(name p) | ||
(public_name p) | ||
) | ||
|
||
(rule (with-stdout-to file (run ./p.exe))) |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/custom-cross-compilation/context-not-found/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 @@ | ||
(lang dune 1.10) |
6 changes: 6 additions & 0 deletions
6
test/blackbox-tests/test-cases/custom-cross-compilation/context-not-found/dune-workspace
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,6 @@ | ||
(lang dune 1.10) | ||
(context (default)) | ||
(context (default | ||
(name cross-1) | ||
(host oups) | ||
)) |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/custom-cross-compilation/context-not-found/p.ml
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 @@ | ||
let () = Printf.printf "%d\n" 137 |
Empty file.
6 changes: 6 additions & 0 deletions
6
test/blackbox-tests/test-cases/custom-cross-compilation/normal/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,6 @@ | ||
(executable | ||
(name p) | ||
(public_name p) | ||
) | ||
|
||
(rule (with-stdout-to file (run ./p.exe))) |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/custom-cross-compilation/normal/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 @@ | ||
(lang dune 1.10) |
6 changes: 6 additions & 0 deletions
6
test/blackbox-tests/test-cases/custom-cross-compilation/normal/dune-workspace
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,6 @@ | ||
(lang dune 1.10) | ||
(context (default)) | ||
(context (default | ||
(name cross) | ||
(host default) | ||
)) |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/custom-cross-compilation/normal/p.ml
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 @@ | ||
let () = Printf.printf "%d\n" 137 |
Empty file.
57 changes: 57 additions & 0 deletions
57
test/blackbox-tests/test-cases/custom-cross-compilation/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,57 @@ | ||
$ dune build --root ./normal --display short file @install | ||
Entering directory 'normal' | ||
ocamldep .p.eobjs/p.ml.d [cross] | ||
ocamlc .p.eobjs/byte/p.{cmi,cmo,cmt} [cross] | ||
ocamlopt .p.eobjs/native/p.{cmx,o} [cross] | ||
ocamlopt p.exe [cross] | ||
ocamldep .p.eobjs/p.ml.d | ||
ocamlc .p.eobjs/byte/p.{cmi,cmo,cmt} | ||
ocamlopt .p.eobjs/native/p.{cmx,o} | ||
ocamlopt p.exe | ||
p file [cross] | ||
p file | ||
|
||
$ cat normal/_build/cross/file | ||
137 | ||
|
||
$ dune build --root ./bad-configuration --display short file @install | ||
Entering directory 'bad-configuration' | ||
File "dune-workspace", line 3, characters 9-53: | ||
3 | (context (default | ||
4 | (name cross-1) | ||
5 | (host default) | ||
6 | )) | ||
Error: Context 'cross-1' is both a host (for 'cross-2') and a target (for 'default'). | ||
[1] | ||
|
||
$ dune build --root ./topological-loop --display short file @install | ||
Entering directory 'topological-loop' | ||
File "dune-workspace", line 11, characters 9-53: | ||
11 | (context (default | ||
12 | (name cross-3) | ||
13 | (host cross-2) | ||
14 | )) | ||
Error: Context 'cross-3' is both a host (for 'cross-1') and a target (for 'cross-2'). | ||
[1] | ||
|
||
$ env OCAMLFIND_CONF=$PWD/target-and-host/etc/findlib.conf dune build --root ./target-and-host --display short file @install | ||
Entering directory 'target-and-host' | ||
File "dune-workspace", line 3, characters 9-69: | ||
3 | (context (default | ||
4 | (name cross-1) | ||
5 | (targets foo) | ||
6 | (host default) | ||
7 | )) | ||
Error: `targets` and `host` options cannot be used in the same context. | ||
[1] | ||
|
||
|
||
$ dune build --root ./context-not-found --display short file @install | ||
Entering directory 'context-not-found' | ||
File "dune-workspace", line 3, characters 9-50: | ||
3 | (context (default | ||
4 | (name cross-1) | ||
5 | (host oups) | ||
6 | )) | ||
Error: Undefined host context 'oups' for 'cross-1'. | ||
[1] |
6 changes: 6 additions & 0 deletions
6
test/blackbox-tests/test-cases/custom-cross-compilation/target-and-host/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,6 @@ | ||
(executable | ||
(name p) | ||
(public_name p) | ||
) | ||
|
||
(rule (with-stdout-to file (run ./p.exe))) |
1 change: 1 addition & 0 deletions
1
test/blackbox-tests/test-cases/custom-cross-compilation/target-and-host/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 @@ | ||
(lang dune 1.10) |
Oops, something went wrong.