Skip to content

Commit

Permalink
test: show limitation installing multi-context libs (#10493)
Browse files Browse the repository at this point in the history
Signed-off-by: Antonio Nuno Monteiro <anmonteiro@gmail.com>
  • Loading branch information
anmonteiro authored May 14, 2024
1 parent f51d90b commit 77e79d8
Showing 1 changed file with 48 additions and 0 deletions.
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]

0 comments on commit 77e79d8

Please sign in to comment.