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.
* Do not build .cmxs when library is (no_dynlink) Signed-off-by: Nicolás Ojeda Bär <n.oje.bar@gmail.com> * Add test Signed-off-by: Nicolás Ojeda Bär <n.oje.bar@gmail.com> * Changes Signed-off-by: Nicolás Ojeda Bär <n.oje.bar@gmail.com> * Improve test Signed-off-by: Nicolás Ojeda Bär <n.oje.bar@gmail.com> * Add test Signed-off-by: Nicolás Ojeda Bär <n.oje.bar@gmail.com> --------- Signed-off-by: Nicolás Ojeda Bär <n.oje.bar@gmail.com>
- Loading branch information
Showing
5 changed files
with
69 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- #11176: when a library declares `(no_dynlink)`, then the `.cmxs` file for it | ||
is no longer built. (@nojb) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
This test checks that if a library is declared with `(no_dynlink)`, then the | ||
corresponding `.cmxs` file is *not* built. | ||
|
||
$ cat >dune-project <<EOF | ||
> (lang dune 3.17) | ||
> EOF | ||
|
||
First we check the behaviour when `(no_dynlink)` is not present. | ||
|
||
$ cat >dune <<EOF | ||
> (library | ||
> (name mylib)) | ||
> EOF | ||
|
||
$ touch a.ml | ||
|
||
$ dune build _build/default/mylib.cmxs | ||
|
||
Now with `(no_dynlink)`. | ||
|
||
$ cat >dune <<EOF | ||
> (library | ||
> (name mylib) | ||
> (no_dynlink)) | ||
> EOF | ||
|
||
$ dune clean | ||
|
||
$ dune build _build/default/mylib.cmxs | ||
Error: Don't know how to build _build/default/mylib.cmxs | ||
Hint: did you mean _build/default/mylib.cma or _build/default/mylib.cmxa? | ||
[1] | ||
|
||
Next, we check that the .cmxs is installed without `(no_dynlink)`: | ||
|
||
$ cat >dune-project <<EOF | ||
> (lang dune 3.17) | ||
> (package (name mylib)) | ||
> EOF | ||
|
||
$ cat >dune <<EOF | ||
> (library | ||
> (public_name mylib)) | ||
> EOF | ||
|
||
$ dune build _build/default/mylib.install | ||
|
||
$ grep cmxs _build/default/mylib.install | ||
"_build/install/default/lib/mylib/mylib.cmxs" | ||
|
||
And *not* installed with `(no_dynlink)`: | ||
|
||
$ cat >dune <<EOF | ||
> (library | ||
> (public_name mylib) | ||
> (no_dynlink)) | ||
> EOF | ||
|
||
$ dune build _build/default/mylib.install | ||
|
||
$ grep cmxs _build/default/mylib.install | ||
[1] |