-
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.
Signed-off-by: Stephen Sherratt <stephen@sherra.tt>
- Loading branch information
Showing
1 changed file
with
67 additions
and
0 deletions.
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
test/blackbox-tests/test-cases/pkg/pin-stanza/update-non-dune-local-pin.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,67 @@ | ||
This demonstrates an issue when pinning a non-opam package. After attempting to | ||
build the package, changes to the package are only picked up by dune after | ||
running `dune clean`, even if building the package failed. | ||
|
||
$ . ../helpers.sh | ||
|
||
$ mkrepo | ||
$ add_mock_repo_if_needed | ||
|
||
$ cat >dune-project <<EOF | ||
> (lang dune 3.13) | ||
> (pin | ||
> (url "file://$PWD/foo") | ||
> (package (name foo))) | ||
> (package | ||
> (name main) | ||
> (depends foo)) | ||
> EOF | ||
|
||
Make a package "foo" whose build will fail after printing a message: | ||
$ mkdir foo | ||
$ cat >foo/foo.opam <<EOF | ||
> opam-version: "2.0" | ||
> build: [ | ||
> [ make ] | ||
> ] | ||
> EOF | ||
$ cat >foo/Makefile <<EOF | ||
> all: | ||
> echo aaa | ||
> false | ||
> EOF | ||
|
||
$ dune pkg lock | ||
Solution for dune.lock: | ||
- foo.dev | ||
|
||
Attempt to build the packgage the first time: | ||
(the error from make is grep'd out because it is not consistant across different systems) | ||
$ dune build 2>&1 | grep -v make | ||
echo aaa | ||
aaa | ||
false | ||
-> required by _build/_private/default/.pkg/foo/target/cookie | ||
|
||
Update the message that gets printed while building foo: | ||
$ cat >foo/Makefile <<EOF | ||
> all: | ||
> echo bbb | ||
> false | ||
> EOF | ||
|
||
The change to the package is ignored: | ||
$ dune build 2>&1 | grep -v make | ||
echo aaa | ||
aaa | ||
false | ||
-> required by _build/_private/default/.pkg/foo/target/cookie | ||
|
||
$ dune clean | ||
|
||
The change to the package is picked up now that we've run `dune clean`: | ||
$ dune build 2>&1 | grep -v make | ||
echo bbb | ||
bbb | ||
false | ||
-> required by _build/_private/default/.pkg/foo/target/cookie |