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,19 @@
$ echo >dune <<EOF
> (alias
> (name default)
> (deps %{lib:foo:theories/a})
> (action (echo "deps: %{deps}\n")))
> EOF
$ echo "(lang dune 1.6)" > dune-project
$ touch foo.opam
$ mkdir foo && touch foo/a
$ cat >foo/dune <<EOF
> (library
> (public_name foo))
>
> (install
> (section lib)
> (package foo)
> (files (a as theories/a)))
> EOF
$ dune build

View file

@ -0,0 +1,16 @@
Deps in diff position. Used to work in 2.9.x
$ touch foo foo.diff
$ cat >dune <<EOF
> (rule
> (deps foo)
> (alias foo)
> (action (diff? %{deps} %{deps}.diff)))
> EOF
$ echo "(lang dune 2.9)" > dune-project
$ dune build @foo
File "dune", line 4, characters 24-31:
4 | (action (diff? %{deps} %{deps}.diff)))
^^^^^^^
Error: %{deps} isn't allowed in this position.
[1]

View file

@ -0,0 +1,18 @@
The following should fail saying that %{read:...} isn't allowed in this
position, because it was indeed not supported by older versions of Dune. Due to
improvements in the core of Dune, this is now supported. Because the error used
to be discovered dynamically as we were trying to evaluate the dependencies,
the new code simply doesn't detect it. We should add a proper version check for
this feature.
$ echo "(lang dune 1.6)" > dune-project
$ cat >dune <<EOF
> (rule (with-stdout-to foo (echo bar)))
> (alias
> (name default)
> (deps %{read:foo}))
> EOF
$ dune build
Error: No rule found for bar
-> required by alias default in dune:2
[1]

View file

@ -0,0 +1,15 @@
$ cat >dune <<EOF
> (alias
> (name default)
> (deps %{lib:foo:foo.cma})
> (action (echo "deps: %{deps}\n")))
> EOF
$ echo "(lang dune 1.6)" > dune-project
$ touch foo.opam
$ mkdir foo && touch foo/foo.ml
$ cat >foo/dune << EOF
> (library (public_name foo))
> EOF
$ dune build
deps: ../install/default/lib/foo/foo.cma