-
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.
Browse files
Browse the repository at this point in the history
* `(no_dynlink)`: do not build `.cmxs` (#11176) * 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> (cherry picked from commit 41212a5) * Fix ignored-dune-lock test on macos (#11179) The macos patch utility doesn't like it when a patch contains no hunks, so this change adds a hunk to the patch used in the ignored-dune-lock test. Signed-off-by: Stephen Sherratt <stephen@sherra.tt> --------- Signed-off-by: Stephen Sherratt <stephen@sherra.tt> Co-authored-by: Stephen Sherratt <stephen@sherra.tt>
- Loading branch information
Showing
6 changed files
with
71 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] |
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