-
Notifications
You must be signed in to change notification settings - Fork 413
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: show limitation installing multi-context libs (#10493)
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
- Loading branch information
1 parent
f51d90b
commit 77e79d8
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
test/blackbox-tests/test-cases/enabled_if/install-multiple-context-libs.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,48 @@ | ||
Test installation for melange libraries in multiple contexts. | ||
The expectation is that libraries that don't collide (e.g. a melange and a | ||
native library) can be installed in the same context. | ||
|
||
Create a package named foo | ||
|
||
$ mkdir -p a b | ||
$ cat > dune-project << EOF | ||
> (lang dune 3.13) | ||
> (using melange 0.1) | ||
> (package (name foo)) | ||
> EOF | ||
|
||
Define libraries in multiple contexts | ||
|
||
$ cat > dune-workspace << EOF | ||
> (lang dune 3.13) | ||
> (context default) | ||
> (context | ||
> (default | ||
> (name melange))) | ||
> EOF | ||
$ cat > a/dune << EOF | ||
> (library | ||
> (name foo) | ||
> (public_name foo.native) | ||
> (enabled_if (= %{context_name} "default"))) | ||
> (library | ||
> (name foo) | ||
> (public_name foo.melange) | ||
> (modes melange) | ||
> (enabled_if (= %{context_name} "melange"))) | ||
> EOF | ||
$ cat > a/foo.ml <<EOF | ||
> let () = print_endline "foo" | ||
> EOF | ||
|
||
$ dune build | ||
|
||
$ mkdir -p out/man | ||
|
||
|
||
Try installing both | ||
|
||
$ dune install foo --prefix out | ||
Error: Cannot specify '--prefix' or '--libdir' when installing into multiple | ||
contexts! | ||
[1] |