-
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
9 changed files
with
134 additions
and
12 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
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,36 @@ | ||
Referring to files with a glob in the bin section of the install stanza | ||
|
||
$ cat >dune-project <<EOF | ||
> (lang dune 3.6) | ||
> (package (name foo)) | ||
> EOF | ||
|
||
Make some scripts to install in bin. | ||
$ cat >hello.sh <<EOF | ||
> #!/bin/sh | ||
> echo "Hello, World!" | ||
> EOF | ||
|
||
$ cat >foo.sh <<EOF | ||
> #!/bin/sh | ||
> echo foo | ||
> EOF | ||
|
||
Refer to the scripts with a glob. | ||
$ cat >dune <<EOF | ||
> (install | ||
> (section bin) | ||
> (files (glob_files *.sh))) | ||
> EOF | ||
|
||
$ dune build @install | ||
|
||
$ find _build/install/default | sort | ||
_build/install/default | ||
_build/install/default/bin | ||
_build/install/default/bin/foo.sh | ||
_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 |
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,47 @@ | ||
Referring to files with an include in the bin section of the install stanza | ||
|
||
$ cat >dune-project <<EOF | ||
> (lang dune 3.6) | ||
> (package (name foo)) | ||
> EOF | ||
|
||
Make some scripts to install in bin. | ||
$ cat >hello.sh <<EOF | ||
> #!/bin/sh | ||
> echo "Hello, World!" | ||
> EOF | ||
|
||
$ cat >foo.sh <<EOF | ||
> #!/bin/sh | ||
> echo foo | ||
> EOF | ||
|
||
Refer to the scripts with an include statement. | ||
$ echo '(hello.sh foo.sh)' > files.sexp | ||
$ cat >dune <<EOF | ||
> (install | ||
> (section bin) | ||
> (files (include files.sexp))) | ||
> EOF | ||
|
||
$ dune build @install | ||
|
||
Refer to the scripts literally. | ||
|
||
$ cat >dune <<EOF | ||
> (install | ||
> (section bin) | ||
> (files hello.sh foo.sh)) | ||
> EOF | ||
|
||
$ dune build @install | ||
|
||
$ find _build/install/default | sort | ||
_build/install/default | ||
_build/install/default/bin | ||
_build/install/default/bin/foo.sh | ||
_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 |