All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Cc: qemu-devel@nongnu.org, "Peter Xu" <peterx@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Thomas Huth" <th.huth+qemu@posteo.eu>,
	"Song Gao" <gaosong@loongson.cn>, "John Snow" <jsnow@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Kyle Evans" <kevans@freebsd.org>,
	"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
	"Cleber Rosa" <crosa@redhat.com>, "Warner Losh" <imp@bsdimp.com>,
	"Brad Smith" <brad@comstyle.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Max Filippov" <jcmvbkbc@gmail.com>,
	"Brian Cain" <brian.cain@oss.qualcomm.com>,
	"Fabiano Rosas" <farosas@suse.de>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	qemu-arm@nongnu.org
Subject: Re: [PATCH v2 03/16] tests/Makefile.include: add binary dependency to run-tcg-tests-% rules
Date: Tue, 26 May 2026 18:58:50 +0100	[thread overview]
Message-ID: <87fr3eyrvp.fsf@draig.linaro.org> (raw)
In-Reply-To: <06092208-1b56-4fea-8d92-bf035fbd0fa3@oss.qualcomm.com> (Pierrick Bouvier's message of "Tue, 26 May 2026 10:15:00 -0700")

Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> writes:

> On 5/26/2026 3:47 AM, Alex Bennée wrote:
>> Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> writes:
>> 
>>> On 5/25/2026 11:43 AM, Alex Bennée wrote:
>>>> Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> writes:
>>>>
>>>>> On 5/25/2026 8:46 AM, Pierrick Bouvier wrote:
>>>>>> On 5/23/2026 1:56 AM, Alex Bennée wrote:
>>>>>>> Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> writes:
>>>>>>>
>>>>>>>> On 5/22/2026 12:02 PM, Alex Bennée wrote:
>>>>>>>>> Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com> writes:
>>>>>>>>>
>>>>>>>>>> On 5/21/2026 6:17 AM, Alex Bennée wrote:
>>>>>>>>>>> Explicitly set the appropriate QEMU binary as a dependency so we can
>>>>>>>>>>> ensure they get built. This is especially important for MacOS which
>>>>>>>>>>> otherwise only builds the unsigned binaries on a normal "make all"
>>>>>>>>>>> run.
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> I'm not sure to see why it matters. tcg-tests don't make use of hvf, so
>>>>>>>>>> unsigned binaries are plenty for it.
>>>>>>>>>>
>>>>>>>>>> Which other binary is this building that is not built by default?
>>>>>>>>>>
>>>>>>>>>> In general, if something is not included in "all" target, let's make
>>>>>>>>>> sure it's included there (meson.build?) instead of adding a workaround
>>>>>>>>>> here. Not only tests benefit this, but anyone doing a build on a
>>>>>>>>>> platform that might have optional binaries not built by default.
>>>>>>>>>
>>>>>>>>> If you have a suggestion on how to make that work I'm all ears.
>>>>>>>>>
>>>>>>>>
>>>>>>>> I would be happy to help, but I don't understand what the goal is. I
>>>>>>>> have three questions that should help to provide a suggestion.
>>>>>>>>
>>>>>>>> Which exact test command do you run?
>>>>>>>
>>>>>>> make check-tcg
>>>>>>>
>>>>>>>>
>>>>>>>> ```
>>>>>>>> Explicitly set the appropriate QEMU binary as a dependency so we can
>>>>>>>> ensure they get built.
>>>>>>>> ```
>>>>>>>> Aren't they built by all?
>>>>>>>
>>>>>>> Apparently not.
>>>>>>>
>>>>>>>> It seems to be a dependency, at least for check-tcg:
>>>>>>>> .ninja-goals.check-tcg = all test-plugins
>>>>>>>>
>>>>>>>> ```
>>>>>>>> This is especially important for MacOS which otherwise only builds the
>>>>>>>> unsigned binaries on a normal "make all" run.
>>>>>>>> ```
>>>>>>>> Why do you need signed binaries for testing on MacOS (hvf?)?
>>>>>>>
>>>>>>> In a previous iteration I made configure spit out the unsigned binaries
>>>>>>> to config-target.mak but the request was to fix the dependencies
>>>>>>> instead.
>>>>>>>
>>>>>>> It all works on Linux so I'm not sure why MacOS is being so weird
>>>>>>> because the meson emulators target mechanism should be the same.
>>>>>>>
>>>>>>
>>>>>> Just tried now, and it does not work on Linux neither (make check-tcg
>>>>>> does not build any target beyond tests). Maybe you forgot to clean your
>>>>>> folder?
>>>>>>
>>>>>
>>>>> The root issue is that tests/Makefile.include is included *after*
>>>>> evaluation of ninja-targets in main Makefile. Thus,
>>>>> .ninja-goals.check-tcg is ignored.
>>>>
>>>> So this replaces patch 1/16 - I think we have a circular dependency here.
>>>>
>>>
>>> Indeed, I didn't notice the duplication. While it solves things under
>>> Linux, it doesn't trigger any build on MacOS, which is what you observed
>>> also. I wonder if it's a gmake vs whatever-make difference.
>>>
>>> Another solution that seems ok on both platforms is to use (harmful)
>>> recursive make:
>>>
>>>  .PHONY: check-tcg
>>> -.ninja-goals.check-tcg = all test-plugins
>>> -check-tcg: $(RUN_TCG_TARGET_RULES)
>>> +check-tcg:
>>> + $(MAKE) all test-plugins
>>> + $(MAKE) $(RUN_TCG_TARGET_RULES)
>>>
>>>  .PHONY: clean-tcg
>>>  clean-tcg: $(CLEAN_TCG_TARGET_RULES)
>>>
>>> Or maybe just leave it as it is? Doc already mentions build should be
>>> done before running any test to avoid missing binaries.
>>> Hopefully we'll completely move tcg tests to meson one day, so there is
>>> no need to deal with make idiosyncrasy anymore.
>> 
>> The blocker for that to happen would be meson knowing about anything
>> else than the host compiler and singular cross compiler.
>>
>
> Meson indeed supports a single compiler + cross compiler at a time.
> However, you can directly generate cross binaries using a custom_target
> or a generator object. This way, meson would generate programs without
> having to know it's a C compiler. Since all files are single source,

That is an incorrect assumption - the softmmu binaries especially have a
multiple objects which are linked together.

> it's not a problem, since we don't need to declare them.
> Generators have the advantage of being less verbose (you declare only
> once how to use them) than custom target when used several times.
>
> https://mesonbuild.com/Reference-manual_functions_generator.html
> https://mesonbuild.com/Generating-sources.html#using-generator
>
> See a full working example below:
> ```
> $ cat meson.build
> project('cross_compile_tests', 'c')
>
> cc_aarch64 = generator(
>                find_program('aarch64-linux-gnu-gcc'),
>                arguments: ['@INPUT@', '-o', '@OUTPUT@', '@EXTRA_ARGS@'],
>                output: '@BASENAME@')
>
> tests = [
>   cc_aarch64.process('test.c'),
>   cc_aarch64.process('test2.c', extra_args: '-lpthread')
> ]
> # we need a target that actually uses tests
> executable('test_aarch64', 'empty_main.c', tests)
>
> $ mkdir -p build && cd build
> $ meson && ninja -v
> [1/4] /usr/bin/aarch64-linux-gnu-gcc ../test.c -o test_aarch64.p/test
> [2/4] /usr/bin/aarch64-linux-gnu-gcc ../test2.c -o test_aarch64.p/test2
> -lpthread
> [3/4] ccache cc -Itest_aarch64.p -I. -I.. -fdiagnostics-color=always
> -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -g -MD -MQ
> test_aarch64.p/empty_main.c.o -MF test_aarch64.p/empty_main.c.o.d -o
> test_aarch64.p/empty_main.c.o -c ../empty_main.c
> [4/4] cc  -o test_aarch64 test_aarch64.p/empty_main.c.o -Wl,--as-needed
> -Wl,--no-undefined
> $ file test_aarch64.p/test*
> test_aarch64.p/test:  ELF 64-bit LSB pie executable, ARM aarch64,
> version 1 (SYSV), dynamically linked, interpreter
> /lib/ld-linux-aarch64.so.1,
> BuildID[sha1]=8162b8f045880c75118958ad46be78ed75bb708d, for GNU/Linux
> 3.7.0, not stripped
> test_aarch64.p/test2: ELF 64-bit LSB pie executable, ARM aarch64,
> version 1 (SYSV), dynamically linked, interpreter
> /lib/ld-linux-aarch64.so.1,
> BuildID[sha1]=eed48625e02cd436a2708f94e5dd9ce6d5c162a9, for GNU/Linux
> 3.7.0, not stripped
> ```
>
> We'll need to remove the mechanic to build cross compilers containers.
> In my experience, it's clunky anyway and fails when building several
> from scratch. Try it yourself after cleaning your docker/podman images.
> It's just better and simpler to expect user to install cross
> compilers.

That would loose a bunch of functionality and doesn't help users running
anything that isn't Debian.

> The only thing that prevented me to implement this before is that I
> didn't know if concerned maintainers would accept it, or just hold onto
> the precious handcrafted Makefiles, into which so much energy and time
> has been spent.

There is no desire to hold onto Makefiles, but I do want to keep the
same capabilities as the current system. The driver for containerising
the compilers was that setting up cross compilers is a barrier to
contributors who want to be able to add and build tests.

> If it's not the case, then we should definitely move into the direction
> of migrating all this to meson, and rely on meson tests infrastructure.
>
> Regards,
> Pierrick

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


  reply	other threads:[~2026-05-26 18:01 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-21 13:17 [PATCH v2 00/16] testing/next: various updates (MacOS, docker, gitlab) Alex Bennée
2026-05-21 13:17 ` [PATCH v2 01/16] Makefile: include tests/Makefile.include before ninja calculation Alex Bennée
2026-05-22 17:51   ` Pierrick Bouvier
2026-05-21 13:17 ` [PATCH v2 02/16] tests/Makefile.include: fix typo in comment Alex Bennée
2026-05-22 17:51   ` Pierrick Bouvier
2026-05-21 13:17 ` [PATCH v2 03/16] tests/Makefile.include: add binary dependency to run-tcg-tests-% rules Alex Bennée
2026-05-22 18:03   ` Pierrick Bouvier
2026-05-22 19:02     ` Alex Bennée
2026-05-22 19:44       ` Pierrick Bouvier
2026-05-23  8:56         ` Alex Bennée
2026-05-25 15:46           ` Pierrick Bouvier
2026-05-25 17:18             ` Pierrick Bouvier
2026-05-25 18:43               ` Alex Bennée
2026-05-25 19:22                 ` Pierrick Bouvier
2026-05-26 10:47                   ` Alex Bennée
2026-05-26 17:15                     ` Pierrick Bouvier
2026-05-26 17:58                       ` Alex Bennée [this message]
2026-05-26 18:07                         ` Pierrick Bouvier
2026-05-27  6:17                           ` Alex Bennée
2026-05-27 20:55                             ` Pierrick Bouvier
2026-05-28 10:13                               ` Alex Bennée
2026-05-28 16:41                                 ` Pierrick Bouvier
2026-05-28 18:03                                   ` Alex Bennée
2026-05-28 18:43                                     ` Pierrick Bouvier
2026-05-28 20:04                                       ` Alex Bennée
2026-05-28 20:19                                         ` Pierrick Bouvier
2026-06-03 19:03                                   ` Alex Bennée
2026-06-03 21:03                                     ` Pierrick Bouvier
2026-05-21 13:17 ` [PATCH v2 04/16] accel/tcg: move jit thread manipulation into do_tb_phys_invalidate Alex Bennée
2026-05-21 13:17 ` [PATCH v2 05/16] ci: drop cirrus MacOS build Alex Bennée
2026-05-22 17:51   ` Pierrick Bouvier
2026-05-21 13:17 ` [PATCH v2 06/16] gitlab: add initial MacOS 15 on gitlab runner Alex Bennée
2026-05-22 17:52   ` Pierrick Bouvier
2026-05-21 13:17 ` [PATCH v2 07/16] gitlab: add MacOS 26 job " Alex Bennée
2026-05-22 17:52   ` Pierrick Bouvier
2026-05-21 13:17 ` [PATCH v2 08/16] gitlab: update issue template for binary test cases Alex Bennée
2026-05-21 13:17 ` [PATCH v2 09/16] MAINTAINERS: add a section for AI agents Alex Bennée
2026-05-21 13:17 ` [PATCH v2 10/16] MAINTAINERS: Fix docker/dockerfiles/debian-hexagon-cross.docker path Alex Bennée
2026-05-21 13:17 ` [PATCH v2 11/16] MAINTAINERS: Cover debian-loongarch-cross.docker with LoongArch section Alex Bennée
2026-05-21 13:17 ` [PATCH v2 12/16] MAINTAINERS: Cover debian-xtensa-cross.docker with Xtensa section Alex Bennée
2026-05-21 13:17 ` [PATCH v2 13/16] MAINTAINERS: Cover debian-tricore-cross.docker with TriCore section Alex Bennée
2026-05-21 13:17 ` [PATCH v2 14/16] MAINTAINERS: Cover python.docker with Python library section Alex Bennée
2026-05-21 13:17 ` [PATCH v2 15/16] docker: Remove LegacyKeyValueFormat warnings in non-generated files Alex Bennée
2026-05-21 13:17 ` [PATCH v2 16/16] docker: Remove LegacyKeyValueFormat warnings in generated files Alex Bennée

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=87fr3eyrvp.fsf@draig.linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=brad@comstyle.com \
    --cc=brian.cain@oss.qualcomm.com \
    --cc=crosa@redhat.com \
    --cc=farosas@suse.de \
    --cc=gaosong@loongson.cn \
    --cc=imp@bsdimp.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=jsnow@redhat.com \
    --cc=kevans@freebsd.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=philmd@linaro.org \
    --cc=pierrick.bouvier@linaro.org \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=th.huth+qemu@posteo.eu \
    --cc=thuth@redhat.com \
    /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.