This commit is contained in:
swrup 2025-11-11 02:07:51 +01:00
parent aa2ff7b2f0
commit 2f3113f55d
11742 changed files with 1223940 additions and 0 deletions

View file

@ -0,0 +1,4 @@
(rule
(fallback)
(targets)
(action (with-stdout-to foo.txt (echo "testing"))))

View file

@ -0,0 +1,9 @@
fallback isn't allowed in dune
$ dune build
File "dune", line 2, characters 1-11:
2 | (fallback)
^^^^^^^^^^
Error: 'fallback' was renamed to '(mode fallback)' in the 1.0 version of the
dune language
[1]

View file

@ -0,0 +1,4 @@
(rule
(fallback false)
(targets)
(action (with-stdout-to foo.txt (echo "testing"))))

View file

@ -0,0 +1,9 @@
2nd fallback form isn't allowed either
$ dune build
File "dune", line 2, characters 1-17:
2 | (fallback false)
^^^^^^^^^^^^^^^^
Error: 'fallback' was renamed to '(mode fallback)' in the 1.0 version of the
dune language
[1]

View file

@ -0,0 +1,47 @@
Fallback rules must either have:
* all their targets in the source
* no targets in the source
Here we me makes sure that having some targets in the source and some not is
impossible.
$ cat>dune-project <<EOF
> (lang dune 3.10)
> EOF
$ cat >dune <<EOF
> (rule
> (action
> (progn
> (with-stdout-to x (echo ""))
> (with-stdout-to y (echo ""))))
> (mode fallback)
> (targets x y))
> EOF
$ build() { dune build x y; }
$ build
$ touch x
$ build
File "dune", lines 1-7, characters 0-122:
1 | (rule
2 | (action
3 | (progn
4 | (with-stdout-to x (echo ""))
5 | (with-stdout-to y (echo ""))))
6 | (mode fallback)
7 | (targets x y))
Error: Some of the targets of this fallback rule are present in the source
tree, and some are not. This is not allowed. Either none of the targets must
be present in the source tree, either they must all be.
The following targets are present:
- x
The following targets are not:
- y
[1]