All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
To: "Alex Bennée" <alex.bennee@linaro.org>, qemu-devel@nongnu.org
Cc: "Ilya Leoshkevich" <iii@linux.ibm.com>,
	qemu-arm@nongnu.org, "Cornelia Huck" <cohuck@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@mailo.com>,
	"John Snow" <jsnow@redhat.com>,
	"David Hildenbrand" <david@kernel.org>,
	"Thomas Huth" <th.huth+qemu@posteo.eu>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Cleber Rosa" <crosa@redhat.com>, "Warner Losh" <imp@bsdimp.com>,
	"Song Gao" <gaosong@loongson.cn>,
	"Kyle Evans" <kevans@freebsd.org>,
	"Eric Farman" <farman@linux.ibm.com>,
	"Brad Smith" <brad@comstyle.com>,
	"Fabiano Rosas" <farosas@suse.de>, "Helge Deller" <deller@gmx.de>,
	"Laurent Vivier" <laurent@vivier.eu>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	qemu-s390x@nongnu.org, "Matthew Rosato" <mjrosato@linux.ibm.com>,
	"Brian Cain" <brian.cain@oss.qualcomm.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>
Subject: Re: [PATCH v4 17/19] scripts/make2mtest: add docker dependencies for check-tcg-% targets
Date: Wed, 16 Sep 2026 09:30:27 -0700	[thread overview]
Message-ID: <36cbf64f-e187-4d15-b710-7d4e6124ca07@oss.qualcomm.com> (raw)
In-Reply-To: <20260916153013.2134555-18-alex.bennee@linaro.org>

On 9/16/2026 8:30 AM, Alex Bennée wrote:
> This should trigger the building of the docker image when the user
> calls "make check-tcg" or one of the arch specific targets such as
> "make check-tcg-m68k-linux-user".
> 
> We still keep the internal meson dependency so individual tests can
> launched and the docker build verified.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  scripts/mtest2make.py | 35 +++++++++++++++++++++++++++++------
>  1 file changed, 29 insertions(+), 6 deletions(-)
> 
> diff --git a/scripts/mtest2make.py b/scripts/mtest2make.py
> index 383ea68b16d..ab894d90d47 100644
> --- a/scripts/mtest2make.py
> +++ b/scripts/mtest2make.py
> @@ -14,6 +14,7 @@ class Suite(object):
>      def __init__(self):
>          self.deps = set()
>          self.speeds = set()
> +        self.docker_deps = set()
>  
>      def names(self, base):
>          return [f'{base}-{speed}' for speed in self.speeds]
> @@ -40,7 +41,22 @@ def names(self, base):
>  
>  introspect = json.load(sys.stdin)
>  
> -def process_tests(test, targets, suites):
> +targets = {t['id']: [os.path.relpath(f) for f in t['filename']]
> +           for t in introspect['targets']}
> +
> +# collect the docker images uses by the tests. This is totally a hacky
> +# heuristic that fishes the images out of the test custom commands by
> +# looking for the qemu/image pattern.
> +targets_docker = {}
> +for t in introspect['targets']:
> +    for src in t.get('target_sources', []):
> +        for arg in src.get('compiler', []):
> +            if arg.startswith('qemu/'):
> +                img = arg.split('/', 1)[1]
> +                targets_docker[t['id']] = f'docker-image-{img}'
> +                break
> +
> +def process_tests(test, targets, targets_docker, suites):
>      executable = test['cmd'][0]
>      try:
>          executable = os.path.relpath(executable)
> @@ -51,6 +67,8 @@ def process_tests(test, targets, suites):
>      deps = itertools.chain.from_iterable(deps)
>      deps = list(deps)
>  
> +    docker_deps = [targets_docker[x] for x in test['depends'] if x in targets_docker]
> +
>      test_suites = test['suite'] or ['default']
>      for s in test_suites:
>          # The suite name in the introspection info is "PROJECT" or "PROJECT:SUITE"
> @@ -59,6 +77,7 @@ def process_tests(test, targets, suites):
>              if s == 'slow' or s == 'thorough':
>                  continue
>          suites[s].deps.update(deps)
> +        suites[s].docker_deps.update(docker_deps)
>          if s.endswith('-slow'):
>              s = s[:-5]
>              suites[s].speeds.add('slow')
> @@ -81,6 +100,9 @@ def emit_prolog(suites, prefix):
>      print(f'all-{prefix}-xml = {all_xml}')
>      print(f'.PHONY: {prefix} do-meson-{prefix} {prefix}-report.junit.xml $(all-{prefix}-targets) $(all-{prefix}-xml)')
>      print(f'ninja-cmd-goals += $(foreach s, $(.{prefix}.mtest-suites), $(.{prefix}-$s.deps))')
> +    print(f'docker-cmd-goals += $(foreach s, $(.{prefix}.mtest-suites), $(.{prefix}-$s.docker-deps))')
> +    print(f'docker-cmd-goals += $(foreach g, $(MAKECMDGOALS), $(.docker-goals.$g))')
> +    print(f'run-ninja: $(sort $(docker-cmd-goals))')
>      print(f'{prefix}-build: run-ninja')
>      print(f'{prefix} $(all-{prefix}-targets): do-meson-{prefix}')
>      print(f'do-meson-{prefix}: run-ninja; $(if $(MAKE.n),,+)$(MESON) test $(.{prefix}.mtestargs)')
> @@ -93,6 +115,10 @@ def emit_suite(name, suite, prefix):
>      print()
>      print(f'.{prefix}-{tgtname}.deps = {deps}')
>      print(f'.ninja-goals.check-build += $(.{prefix}-{tgtname}.deps)')
> +    if suite.docker_deps:
> +        docker_deps = ' '.join(sorted(suite.docker_deps))
> +        print(f'.{prefix}-{tgtname}.docker-deps = {docker_deps}')
> +        print(f'.docker-goals.check-build += $(.{prefix}-{tgtname}.docker-deps)')
>  
>      names = ' '.join(sorted(suite.names(name)))
>      targets = f'{prefix}-{tgtname} {prefix}-report-{tgtname}.junit.xml'
> @@ -105,19 +131,16 @@ def emit_suite(name, suite, prefix):
>      print(f".{prefix}.mtest-suites += {name} $(call .speed.$(SPEED), {names})")
>      print(f'endif')
>  
> -targets = {t['id']: [os.path.relpath(f) for f in t['filename']]
> -           for t in introspect['targets']}
> -
>  testsuites = defaultdict(Suite)
>  for test in introspect['tests']:
> -    process_tests(test, targets, testsuites)
> +    process_tests(test, targets, targets_docker, testsuites)
>  emit_prolog(testsuites, 'check')
>  for name, suite in testsuites.items():
>      emit_suite(name, suite, 'check')
>  
>  benchsuites = defaultdict(Suite)
>  for test in introspect['benchmarks']:
> -    process_tests(test, targets, benchsuites)
> +    process_tests(test, targets, targets_docker, benchsuites)
>  emit_prolog(benchsuites, 'bench')
>  for name, suite in benchsuites.items():
>      emit_suite(name, suite, 'bench')

From previous answer on v3, this patch does duplicate existing
dependencies. If we don't have a specific reason to repeat it on
Makefile side, it should not be included in this series.

Regards,
Pierrick


  reply	other threads:[~2026-09-16 16:31 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16 15:29 [PATCH v4 00/19] testing: various docker clean-ups post meson tcg conversion Alex Bennée
2026-09-16 15:29 ` [PATCH v4 01/19] Revert "configure: remove cross_cc and gdb detection logic" Alex Bennée
2026-09-16 15:29 ` [PATCH v4 02/19] Revert "tests/tcg/meson.build: implement ./configure -cross-cc-* options" Alex Bennée
2026-09-16 16:31   ` Pierrick Bouvier
2026-09-17 13:24     ` Alex Bennée
2026-09-17 16:57       ` Pierrick Bouvier
2026-09-16 15:29 ` [PATCH v4 03/19] Revert "tests/tcg/meson.build: implement ./configure containers options" Alex Bennée
2026-09-16 16:33   ` Pierrick Bouvier
2026-09-17  9:27     ` Alex Bennée
2026-09-17 16:58       ` Pierrick Bouvier
2026-09-16 15:29 ` [PATCH v4 04/19] configure: correctly honour --disable-containers Alex Bennée
2026-09-16 15:29 ` [PATCH v4 05/19] configure: re-purpose the tcg test compiler configs for vdso building Alex Bennée
2026-09-16 16:50   ` Pierrick Bouvier
2026-09-16 15:29 ` [PATCH v4 06/19] tests/tcg/s390x: Provide the libc bits needed by the system tests Alex Bennée
2026-09-16 15:30 ` [PATCH v4 07/19] tests/tcg: prefix meson built docker tags with qemu/ Alex Bennée
2026-09-16 20:15   ` Richard Henderson
2026-09-16 15:30 ` [PATCH v4 08/19] tests/tcg: use --add-current-user when building containers Alex Bennée
2026-09-16 16:35   ` Pierrick Bouvier
2026-09-16 15:30 ` [PATCH v4 09/19] tests/tcg: don't define tests when missing compilers Alex Bennée
2026-09-16 16:41   ` Pierrick Bouvier
2026-09-17  0:00     ` Richard Henderson
2026-09-17  6:53       ` Pierrick Bouvier
2026-09-16 15:30 ` [PATCH v4 10/19] tests/docker: add container registry to configure and use Alex Bennée
2026-09-16 16:41   ` Pierrick Bouvier
2026-09-16 15:30 ` [PATCH v4 11/19] tests/docker: remove used _read_qemu_dockerfile Alex Bennée
2026-09-16 15:30 ` [PATCH v4 12/19] tests/docker: strip remaining caching logic from docker.py Alex Bennée
2026-09-16 15:30 ` [PATCH v4 13/19] tests/docker: add specific command to parser Alex Bennée
2026-09-16 15:30 ` [PATCH v4 14/19] tests/docker: swap --quiet for --verbose Alex Bennée
2026-09-16 16:49   ` Pierrick Bouvier
2026-09-16 15:30 ` [PATCH v4 15/19] tests/docker: fix brown bag typo for docker-ccache Alex Bennée
2026-09-16 16:43   ` Pierrick Bouvier
2026-09-16 15:30 ` [PATCH v4 16/19] gitlab: update the @user id mapping file Alex Bennée
2026-09-16 16:12   ` Amit Machhiwal
2026-09-16 15:30 ` [PATCH v4 17/19] scripts/make2mtest: add docker dependencies for check-tcg-% targets Alex Bennée
2026-09-16 16:30   ` Pierrick Bouvier [this message]
2026-09-17  9:29     ` Alex Bennée
2026-09-17 16:59       ` Pierrick Bouvier
2026-09-16 15:30 ` [PATCH v4 18/19] tests/tcg: add console property to docker image custom target Alex Bennée
2026-09-16 16:53   ` Pierrick Bouvier
2026-09-16 15:30 ` [PATCH v4 19/19] tests/tcg: Fix building outside of the source tree Alex Bennée
2026-09-16 23:59 ` [PATCH v4 00/19] testing: various docker clean-ups post meson tcg conversion Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=36cbf64f-e187-4d15-b710-7d4e6124ca07@oss.qualcomm.com \
    --to=pierrick.bouvier@oss.qualcomm.com \
    --cc=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=brad@comstyle.com \
    --cc=brian.cain@oss.qualcomm.com \
    --cc=cohuck@redhat.com \
    --cc=crosa@redhat.com \
    --cc=david@kernel.org \
    --cc=deller@gmx.de \
    --cc=farman@linux.ibm.com \
    --cc=farosas@suse.de \
    --cc=gaosong@loongson.cn \
    --cc=iii@linux.ibm.com \
    --cc=imp@bsdimp.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=jsnow@redhat.com \
    --cc=kevans@freebsd.org \
    --cc=laurent@vivier.eu \
    --cc=marcandre.lureau@redhat.com \
    --cc=mjrosato@linux.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@mailo.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=th.huth+qemu@posteo.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.