From 00fc5ccf762802241fd5bb3dbc5b42eea3db0507 Mon Sep 17 00:00:00 2001 From: Alpha DIALLO Date: Fri, 20 Sep 2024 13:16:46 +0200 Subject: [PATCH] Apply a suggestion Signed-off-by: Alpha DIALLO --- src/dune_rules/enabled_if.ml | 2 +- .../test-cases/enabled_if/eif-env-vars.t | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/dune_rules/enabled_if.ml b/src/dune_rules/enabled_if.ml index 629edae9a218..2919b23fe987 100644 --- a/src/dune_rules/enabled_if.ml +++ b/src/dune_rules/enabled_if.ml @@ -30,7 +30,7 @@ let common_vars ~since = match var with | "context_name" -> var, (2, 7) | "arch_sixtyfour" -> var, (3, 11) - | "env" -> var, (1, 14) + | "env" -> var, (3, 17) | _ -> var, since) common_vars_list) ;; diff --git a/test/blackbox-tests/test-cases/enabled_if/eif-env-vars.t b/test/blackbox-tests/test-cases/enabled_if/eif-env-vars.t index 52ef2be6f933..f90cee1f1dcd 100644 --- a/test/blackbox-tests/test-cases/enabled_if/eif-env-vars.t +++ b/test/blackbox-tests/test-cases/enabled_if/eif-env-vars.t @@ -23,6 +23,21 @@ Test enabled_if with 'env' variable. > (modes exe)) > EOF + $ MYVAR=disabled dune exec -- dune_test + File "dune", line 10, characters 24-45: + 10 | (enabled_if (= enabled %{env:MYVAR=disabled})) + ^^^^^^^^^^^^^^^^^^^^^ + Error: %{env:..} is only available since version 3.17 of the dune language. + Please update your dune-project file to have (lang dune 3.17). + [1] + + $ cat > dune-project < (lang dune 3.17) + > (name dune-test) + > (package + > (name dune-test)) + > EOF + $ cat > main.ml < let () = print_string "Hello world" > EOF