Commit 157d678c2c for qemu.org

commit 157d678c2ca04eadc157b8ab39e196eedf7d6ceb
Author: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Date:   Thu Aug 27 22:15:04 2026 +0000

    meson.build: add summary for TCG tests

    Replacing existing summary that only contained information about
    existing cross compilers with a full summary for all targets.
    We add gdb and container information.
    We specify cc for each target (softmmu + linux-user) independently
    in case we would use different cc for bare metal vs user binaries.

    Users can query full command line for tests by building tests with
    tcg-tests target, so no need to repeat it here.

    Output before change:

    $ ./configure
      Cross compilers
        aarch64                         : /path/to/qemu/build/pyvenv/bin/python3 -B /path/to/qemu/tests/docker/docker.py --engine auto cc --cc aarch64-linux-gnu-gcc -i qemu/debian-arm64-cross -s /path/to/qemu --
        aarch64_be                      : /path/to/qemu/build/pyvenv/bin/python3 -B /path/to/qemu/tests/docker/docker.py --engine auto cc --cc aarch64-linux-gnu-gcc -i qemu/debian-all-test-cross -s /path/to/qemu --
        alpha                           : alpha-linux-gnu-gcc
        ...

    Output after change:

    $ ./configure --disable-containers
      TCG tests
        gdb                             : /usr/bin/gdb-multiarch
        container command               : NO
        cc for aarch64-softmmu          : NO
        cc for aarch64-linux-user       : NO
        cc for aarch64_be-linux-user    : NO
        cc for alpha-softmmu            : alpha-linux-gnu-gcc

    $ ./configure --gdb=gdb --container-command=podman
      TCG tests
        gdb                             : /usr/bin/gdb
        container command               : podman
        cc for aarch64-softmmu          : aarch64-linux-gnu-gcc (from 'debian-all-test-cross' container)
        cc for aarch64-linux-user       : aarch64-linux-gnu-gcc (from 'debian-all-test-cross' container)
        cc for aarch64_be-linux-user    : aarch64-linux-gnu-gcc (from 'debian-all-test-cross' container)
        cc for alpha-softmmu            : alpha-linux-gnu-gcc
        ...

    Tested-by: Aniket Sahu <asahu1x@linux.ibm.com>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
    Message-ID: <20260827221506.91574-104-pierrick.bouvier@oss.qualcomm.com>
    Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

diff --git a/meson.build b/meson.build
index 0a64bcfc6e..2a022c4d85 100644
--- a/meson.build
+++ b/meson.build
@@ -4610,6 +4610,7 @@ subdir('docs')
 subdir('pyvenv')
 # Tests are disabled on emscripten because they rely on host features that aren't
 # supported by emscripten (e.g. fork and unix socket).
+tcg_tests_summary = {}
 if host_os != 'emscripten'
   subdir('tests')
 endif
@@ -4797,21 +4798,9 @@ summary_info += {'sparse':            sparse}
 summary_info += {'mingw32 support':   host_os == 'windows'}
 summary(summary_info, bool_yn: true, section: 'Compilation')

-# snarf the cross-compilation information for tests
-summary_info = {}
-have_cross = false
-foreach target: target_dirs
-  tcg_mak = meson.current_build_dir() / 'tests/tcg' / target / 'config-target.mak'
-  if fs.exists(tcg_mak)
-    config_cross_tcg = keyval.load(tcg_mak)
-    if 'CC' in config_cross_tcg
-      summary_info += {config_cross_tcg['TARGET_NAME']: config_cross_tcg['CC']}
-      have_cross = true
-    endif
-  endif
-endforeach
-if have_cross
-  summary(summary_info, bool_yn: true, section: 'Cross compilers')
+# TCG tests configuration
+if tcg_tests_summary != {}
+  summary(tcg_tests_summary, bool_yn: true, section: 'TCG tests')
 endif

 # Targets and accelerators
diff --git a/tests/tcg/meson.build b/tests/tcg/meson.build
index 9cf632d271..243cdb5fc8 100644
--- a/tests/tcg/meson.build
+++ b/tests/tcg/meson.build
@@ -77,25 +77,30 @@ if gdb.found()
     gdb_arch_supported += {arch: true}
   endforeach
 endif
+tcg_tests_summary += {'gdb': gdb}

 docker_supported = false
+container_command = false
 if get_option('containers')
   if get_option('container_command') != ''
     # make sure command is working
-    cmd = get_option('container_command').split()
+    container_command = get_option('container_command')
+    cmd = container_command.split()
     run_command([cmd, 'info'], check: true)
     docker_supported = true
     docker_wrapper = [docker_wrapper, '--command',
-                      get_option('container_command')]
+                      container_command]
   else
     docker_probe = run_command(docker_wrapper, 'probe', check: false)
     docker_supported = docker_probe.returncode() == 0
     if docker_supported
+      container_command = docker_probe.stdout().strip()
       docker_wrapper = [docker_wrapper, '--command',
-                        docker_probe.stdout().strip()]
+                        container_command]
     endif
   endif
 endif
+tcg_tests_summary += {'container command': container_command}

 # plugins come first, as we need to build the list
 test_plugins = {}
@@ -270,6 +275,15 @@ foreach target, plan: tcg_tests
     endif
   endif

+  summary_cc = false
+  if has_cc
+    summary_cc = plan['cc']
+    if not cc_from_system
+      summary_cc += ' (from \'' + plan['cc_dockerfile'] + '\' container)'
+    endif
+  endif
+  tcg_tests_summary += {'cc for ' + target: summary_cc}
+
   folder = plan['folder']
   gdb_arch = plan['gdb_arch']
   qemu = plan['qemu']