We created the MKVENV_ENSUREGROUP variable in commit 913e47cb6b6
("tests: respect --enable/--disable-download for Avocado") when
the tests/ directory was still processed as Makefile. However
later in commit 1aa22ffee20 ("meson, mkvenv: add functests custom
target") we converted the rule to meson, and in commit 5abfe61b402
("tests: replace check-venv with vm-venv target") we stopped using
it in Makefiles. Since pyvenv/meson.build is included via meson
'subdir()' function, we don't need to export the arguments in
Makefile format ant re-import / parse them: directly re-use the
'mkvenv' variable resolved in the main meson.build file.

This is particularly helpful on Windows, otherwise the Makefile
indirection triggers this error:

  $ ninja pyvenv/functests.group
  [1/1] Generating pyvenv/pyvenv_functests_group with a custom command
  FAILED: [code=2] pyvenv/functests.group
  "C:/msys64/home/user/qemu/build/pyvenv/bin/python.exe" "-B" 
"/home/user/qemu/python/scripts/mkvenv.py" "ensuregroup" "--online" "--online" 
"--dir" "C:/msys64/home/user/qemu/python/wheels" 
"C:/msys64/home/user/qemu/pythondeps.toml" "functests"
  C:/msys64/clangarm64/bin/python3.14.exe: can't open file 
'C:/home/user/qemu/python/scripts/mkvenv.py': [Errno 2] No such file or 
directory
  ninja: build stopped: subcommand failed.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
 configure          | 1 -
 pyvenv/meson.build | 7 +++----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/configure b/configure
index d8bc10060e1..851b6ceeeb5 100755
--- a/configure
+++ b/configure
@@ -1745,7 +1745,6 @@ if test "$rust" != disabled; then
   echo "RUST_TARGET_TRIPLE=$rust_target_triple" >> $config_host_mak
 fi
 echo "PYTHON=$python" >> $config_host_mak
-echo "MKVENV_ENSUREGROUP=$mkvenv ensuregroup $mkvenv_online_flag" >> 
$config_host_mak
 echo "GENISOIMAGE=$genisoimage" >> $config_host_mak
 echo "MESON=$meson" >> $config_host_mak
 echo "NINJA=$ninja" >> $config_host_mak
diff --git a/pyvenv/meson.build b/pyvenv/meson.build
index 4e7d8d9fcc4..c2a3411cf76 100644
--- a/pyvenv/meson.build
+++ b/pyvenv/meson.build
@@ -2,13 +2,12 @@
 # unconditionally installed at configure time are handled in configure
 # instead; namely: meson, sphinx, and the tooling groups.
 
-# Note that this command may or may not include the "--online" flag
-# based on configuration.
-ensuregroup_cmd = config_host['MKVENV_ENSUREGROUP'].split()
+mkvenv = meson.project_source_root() / 'python/scripts/mkvenv.py'
+ensuregroup_cmd = [python, mkvenv, 'ensuregroup']
 
 pyvenv_common_deps = files(
     meson.project_source_root() + '/pythondeps.toml',
-    meson.project_source_root() + '/python/scripts/mkvenv.py'
+    mkvenv,
 )
 pyvenv_wheel_dir = meson.project_source_root() + '/python/wheels'
 
-- 
2.53.0


Reply via email to