From 772afb553e4fc8bb2870dbd493e64e742c4b4e0c Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Fri, 20 Sep 2024 14:48:39 +0100 Subject: [PATCH] test(pkg): reproduce depext crash (#10939) Signed-off-by: Rudi Grinberg --- .../test-cases/pkg/depexts/unknown-variable.t | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/blackbox-tests/test-cases/pkg/depexts/unknown-variable.t diff --git a/test/blackbox-tests/test-cases/pkg/depexts/unknown-variable.t b/test/blackbox-tests/test-cases/pkg/depexts/unknown-variable.t new file mode 100644 index 00000000000..b2ab2ad1d85 --- /dev/null +++ b/test/blackbox-tests/test-cases/pkg/depexts/unknown-variable.t @@ -0,0 +1,25 @@ +Solving with an unknown variable on depexts: + + $ . ../helpers.sh + $ mkrepo + $ add_mock_repo_if_needed + +The "foobar" variable is not defined: + $ mkpkg foo < depexts: [[ "unzip" ] {foobar}] + > EOF + +Make a project that uses the foo library: + $ cat > dune-project < (lang dune 3.13) + > (package + > (name bar) + > (depends foo)) + > EOF + +Locking should succeed and not include the "unzip" package + $ dune pkg lock 2>&1 | head -n 1 + Error: exception Failure("Undefined boolean filter value: foobar") + + $ [ -e dune.lock/foo.pkg ] && cat dune.lock/foo.pkg + [1]