Skip to content

Commit

Permalink
Add reproduction case for #3252
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
  • Loading branch information
rgrinberg committed Mar 14, 2020
1 parent 17f6fca commit 666629f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/blackbox-tests/dune.inc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@
test-cases/bad-alias-error
(progn (run dune-cram run run.t) (diff? run.t run.t.corrected)))))

(rule
(alias bin-eager-deps)
(deps (package dune) (source_tree test-cases/bin-eager-deps))
(action
(chdir
test-cases/bin-eager-deps
(progn (run dune-cram run run.t) (diff? run.t run.t.corrected)))))

(rule
(alias block-strings)
(deps (package dune) (source_tree test-cases/block-strings))
Expand Down Expand Up @@ -2392,6 +2400,7 @@
(alias all-alias)
(alias all-promotions)
(alias bad-alias-error)
(alias bin-eager-deps)
(alias block-strings)
(alias byte-code-only)
(alias byte_complete)
Expand Down Expand Up @@ -2677,6 +2686,7 @@
(alias all-alias)
(alias all-promotions)
(alias bad-alias-error)
(alias bin-eager-deps)
(alias block-strings)
(alias byte-code-only)
(alias byte_complete)
Expand Down
24 changes: 24 additions & 0 deletions test/blackbox-tests/test-cases/bin-eager-deps/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Reproduces issue #3252

https://github.com/ocaml/dune/issues/3252

If a rule requires an expansion that introduces a failure, we should fail only
when the rule needs to be used to build a target.

$ cat >dune-project <<EOF
> (lang dune 2.0)
> (package (name randompackage))
> EOF
$ cat >dune <<EOF
> (rule
> (targets testfile)
> (deps %{bin:doesnotexistbinary})
> (action (echo "test")))
> EOF
$ dune build @install --display short
File "dune", line 3, characters 9-32:
3 | (deps %{bin:doesnotexistbinary})
^^^^^^^^^^^^^^^^^^^^^^^
Error: Program doesnotexistbinary not found in the tree or in PATH
(context: default)
[1]

0 comments on commit 666629f

Please sign in to comment.