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,8 @@
(env
(_
(env-vars
(DUNE_FOO PASS))))
(alias
(name default)
(deps (alias_rec runtest)))

View file

@ -0,0 +1,3 @@
env vars set in env should be visible to all subdirs
$ dune build
PASS

View file

@ -0,0 +1,3 @@
(alias
(name runtest)
(action (echo %{env:DUNE_FOO=FAIL})))

View file

@ -0,0 +1,15 @@
(env
(_
(env-vars
(DUNE_FOO -principal))))
(executable
(flags %{env:DUNE_FOO=-BREAK})
(name foo))
(alias
(name default)
(action
(progn
(echo "var visible from dune: %{env:DUNE_FOO=absent}\n")
(run ./foo.exe))))

View file

@ -0,0 +1,4 @@
Printf.printf "DUNE_FOO: %s\n%!"
(match Sys.getenv "DUNE_FOO" with
| s -> s
| exception Not_found -> "<not found>");;

View file

@ -0,0 +1,11 @@
env vars interpreted in various fields, such as flags
$ dune build --force
var visible from dune: -principal
DUNE_FOO: -principal
global vars are overridden
$ DUNE_FOO=blarg dune build --force
var visible from dune: -principal
DUNE_FOO: -principal

View file

@ -0,0 +1,9 @@
(env
(_
(env-vars
(DUNE_FOO foo-parent)
(DUNE_BAR bar-parent))))
(alias
(name default)
(deps (alias_rec runtest)))

View file

@ -0,0 +1,5 @@
proper inheritance chain of env stanzas
$ dune build
DUNE_FOO: foo-sub
DUNE_BAR: bar-parent

View file

@ -0,0 +1,9 @@
(env
(_
(env-vars
(DUNE_FOO foo-sub))))
(alias
(name runtest)
(action
(echo "DUNE_FOO: %{env:DUNE_FOO=unset}\nDUNE_BAR: %{env:DUNE_BAR=unset}")))