This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
$ cat >dune-project <<EOF
|
||||
> (lang dune 3.14)
|
||||
> EOF
|
||||
|
||||
$ mkdir a b
|
||||
|
||||
$ cat >a/dune<<EOF
|
||||
> (dynamic_include ../b/dune)
|
||||
> EOF
|
||||
|
||||
$ cat >b/dune<<EOF
|
||||
> (dynamic_include ../a/dune)
|
||||
> EOF
|
||||
|
||||
$ dune build
|
||||
Error: Dependency cycle between:
|
||||
dynamic_include b/dune in directory a
|
||||
-> dynamic_include a/dune in directory b
|
||||
-> dynamic_include b/dune in directory a
|
||||
-> required by alias default
|
||||
[1]
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
Demonstrate that we can load dynamically generated rules
|
||||
|
||||
$ cat >dune-project <<EOF
|
||||
> (lang dune 3.14)
|
||||
> EOF
|
||||
|
||||
$ mkdir a b
|
||||
|
||||
$ cat >a/dune <<EOF
|
||||
> (rule
|
||||
> (with-stdout-to dune.inc
|
||||
> (echo "(rule (with-stdout-to foo (echo dynamic)))")))
|
||||
> EOF
|
||||
|
||||
$ dune build a/dune.inc
|
||||
|
||||
$ cat >b/dune <<EOF
|
||||
> (dynamic_include ../a/dune.inc)
|
||||
> EOF
|
||||
|
||||
$ dune build b/foo
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
Some stanzas aren't allowed to be generated:
|
||||
|
||||
$ cat >dune-project <<EOF
|
||||
> (lang dune 3.14)
|
||||
> (using dune_site 0.1)
|
||||
> (package (name foo))
|
||||
> EOF
|
||||
|
||||
$ mkdir a b
|
||||
|
||||
$ cat >b/dune <<EOF
|
||||
> (dynamic_include ../a/dune.inc)
|
||||
> (rule (with-stdout-to x (echo "")))
|
||||
> EOF
|
||||
|
||||
$ cat >a/dune <<EOF
|
||||
> (copy_files ../dune.inc)
|
||||
> EOF
|
||||
|
||||
$ runtest() {
|
||||
> cat >dune.inc
|
||||
> dune build b/x
|
||||
> }
|
||||
|
||||
$ runtest <<EOF
|
||||
> (library (name foo))
|
||||
> EOF
|
||||
File "_build/default/a/dune.inc", line 1, characters 0-20:
|
||||
1 | (library (name foo))
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
Error: This stanza cannot be generated dynamically
|
||||
[1]
|
||||
|
||||
$ runtest <<EOF
|
||||
> (install
|
||||
> (section bin)
|
||||
> (files foo as bar))
|
||||
> EOF
|
||||
File "_build/default/a/dune.inc", line 2, characters 10-13:
|
||||
2 | (section bin)
|
||||
^^^
|
||||
Error: binary section cannot be generated dynamically
|
||||
[1]
|
||||
|
||||
$ runtest <<EOF
|
||||
> (executable
|
||||
> (public_name foo))
|
||||
> EOF
|
||||
File "_build/default/a/dune.inc", lines 1-2, characters 0-31:
|
||||
1 | (executable
|
||||
2 | (public_name foo))
|
||||
Error: This stanza cannot be generated dynamically
|
||||
[1]
|
||||
|
||||
$ runtest <<EOF
|
||||
> (plugin
|
||||
> (libraries)
|
||||
> (name foo)
|
||||
> (site (foo bar)))
|
||||
> EOF
|
||||
File "_build/default/a/dune.inc", line 4, characters 7-16:
|
||||
4 | (site (foo bar)))
|
||||
^^^^^^^^^
|
||||
Error: This stanza cannot be generated dynamically
|
||||
[1]
|
||||
|
||||
$ runtest <<EOF
|
||||
> (deprecated_library_name
|
||||
> (old_public_name foo)
|
||||
> (new_public_name y))
|
||||
> EOF
|
||||
File "_build/default/a/dune.inc", lines 1-3, characters 0-69:
|
||||
1 | (deprecated_library_name
|
||||
2 | (old_public_name foo)
|
||||
3 | (new_public_name y))
|
||||
Error: This stanza cannot be generated dynamically
|
||||
[1]
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
Nesting of dynamic_include stanzas
|
||||
|
||||
$ mkdir a b c
|
||||
|
||||
$ cat >dune-project <<EOF
|
||||
> (lang dune 3.14)
|
||||
> EOF
|
||||
|
||||
$ cat >a/dune <<EOF
|
||||
> (dynamic_include ../b/dune.inc)
|
||||
> EOF
|
||||
|
||||
$ cat >b/dune <<EOF
|
||||
> (rule
|
||||
> (with-stdout-to dune.inc
|
||||
> (echo "(dynamic_include ../c/dune.inc)")))
|
||||
> EOF
|
||||
|
||||
$ cat >c/dune <<EOF
|
||||
> (rule
|
||||
> (with-stdout-to dune.inc
|
||||
> (echo "(rule (with-stdout-to foo (echo bar)))")))
|
||||
> EOF
|
||||
|
||||
$ dune build a/foo
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
Normal include from a dynamic include
|
||||
|
||||
$ cat >dune-project <<EOF
|
||||
> (lang dune 3.14)
|
||||
> EOF
|
||||
|
||||
$ mkdir a b
|
||||
$ cat >a/dune <<EOF
|
||||
> (dynamic_include ../b/dune.inc)
|
||||
> EOF
|
||||
|
||||
$ cat >b/dune.inc <<EOF
|
||||
> (include ../b/dune2.inc)
|
||||
> EOF
|
||||
|
||||
$ cat >b/dune2.inc <<EOF
|
||||
> (rule (with-stdout-to foo (echo bar)))
|
||||
> EOF
|
||||
|
||||
$ dune build a/foo
|
||||
Loading…
Add table
Add a link
Reference in a new issue