-
Notifications
You must be signed in to change notification settings - Fork 410
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This fixes a memo dependency cycle between evaluating globs in install stanzas and populating the artifacts database. Populating the artifacts database involves enumerating all files installed in the "bin" section which involves expanding globs as these files can be specified as globs rather than literal files. Expanding globs in the install stanza requires loading the rules for the directory containing the glob, and doing so depends on the artifacts database. Signed-off-by: Stephen Sherratt <stephen@sherra.tt>
- Loading branch information
Showing
6 changed files
with
89 additions
and
11 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
33 changes: 33 additions & 0 deletions
33
test/blackbox-tests/test-cases/install-glob/install-glob-bin-section-recursive.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,33 @@ | ||
Test that files can be installed with recursive globs in the bin section. The | ||
bin section is a special case in that installable binaries are added to the | ||
artifact database early in the build which can lead to dependency cycles. | ||
|
||
$ cat >dune-project <<EOF | ||
> (lang dune 3.6) | ||
> (package (name foo)) | ||
> EOF | ||
|
||
$ cat >dune <<EOF | ||
> (install | ||
> (section bin) | ||
> (files (glob_files_rec a/*.sh))) | ||
> EOF | ||
|
||
$ mkdir -p a/b a/c | ||
$ touch a/foo.sh a/b/bar.sh a/c/baz.sh | ||
|
||
$ dune build @install | ||
$ find _build/install | sort | ||
_build/install | ||
_build/install/default | ||
_build/install/default/bin | ||
_build/install/default/bin/a | ||
_build/install/default/bin/a/b | ||
_build/install/default/bin/a/b/bar.sh | ||
_build/install/default/bin/a/c | ||
_build/install/default/bin/a/c/baz.sh | ||
_build/install/default/bin/a/foo.sh | ||
_build/install/default/lib | ||
_build/install/default/lib/foo | ||
_build/install/default/lib/foo/META | ||
_build/install/default/lib/foo/dune-package |
30 changes: 30 additions & 0 deletions
30
test/blackbox-tests/test-cases/install-glob/install-glob-bin-section.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,30 @@ | ||
Test that files can be installed with globs in the bin section. The bin section | ||
is a special case in that installable binaries are added to the artifact | ||
database early in the build which can lead to dependency cycles. | ||
|
||
$ cat >dune-project <<EOF | ||
> (lang dune 3.6) | ||
> (package (name foo)) | ||
> EOF | ||
|
||
$ cat >dune <<EOF | ||
> (install | ||
> (section bin) | ||
> (files (glob_files *.sh))) | ||
> EOF | ||
|
||
$ cat >hello.sh <<EOF | ||
> #!/bin/sh | ||
> echo "Hello, World!" | ||
> EOF | ||
|
||
$ dune build @install | ||
$ find _build/install | sort | ||
_build/install | ||
_build/install/default | ||
_build/install/default/bin | ||
_build/install/default/bin/hello.sh | ||
_build/install/default/lib | ||
_build/install/default/lib/foo | ||
_build/install/default/lib/foo/META | ||
_build/install/default/lib/foo/dune-package |