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 @@
let print_var k =
match Sys.getenv k with
| v -> Printf.printf "%s = %S\n" k v
| exception Not_found -> Printf.printf "%s is not set\n" k
let () =
print_var "X";
print_var "Y"

View file

@ -0,0 +1,11 @@
(executable
(name a))
(alias
(name without_dep)
(action (run ./a.exe)))
(alias
(name with_dep)
(deps (env_var X))
(action (run ./a.exe)))

View file

@ -0,0 +1 @@
(lang dune 1.1)

View file

@ -0,0 +1,21 @@
Aliases without a (env) dependency are not rebuilt when the environment
changes:
$ dune build @without_dep
X is not set
Y is not set
$ X=x dune build @without_dep
But if there is a dependency, the alias gets rebuilt:
$ dune build @with_dep
X is not set
Y is not set
$ X=x dune build @with_dep
X = "x"
Y is not set
This only happens for tracked variables:
$ dune build @with_dep
$ Y=y dune build @with_dep