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.

It's totally ok to build all binaries (even for other targets than one
tested), people have configure --target-list to restrict what is
globally built. Better to catch something broken elsewhere instead of
"oh sorry, my custom test command didn't build this at the time".

> Signed-off-by: Alex Bennée <[email protected]>
> ---
>  tests/Makefile.include | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/tests/Makefile.include b/tests/Makefile.include
> index ce6a0dccaf4..cf6f9e68245 100644
> --- a/tests/Makefile.include
> +++ b/tests/Makefile.include
> @@ -57,6 +57,12 @@ RUN_TCG_TARGET_RULES=$(patsubst %,run-tcg-tests-%, 
> $(TCG_TESTS_TARGETS))
>  $(foreach TARGET,$(TCG_TESTS_TARGETS), \
>          $(eval $(BUILD_DIR)/tests/tcg/config-$(TARGET).mak: config-host.mak))
>  
> +# $1 = the stem (e.g., arm-softmmu or x86_64-linux-user)
> +get-qemu-bin = $(if $(findstring softmmu,$1),qemu-system-$(subst 
> -softmmu,,$1),qemu-$(subst -linux-user,,$1))
> +
> +$(foreach TARGET,$(TCG_TESTS_TARGETS), \
> +        $(eval .ninja-goals.run-tcg-tests-$(TARGET) += $(call 
> get-qemu-bin,$(TARGET))))
> +
>  .PHONY: $(TCG_TESTS_TARGETS:%=build-tcg-tests-%)
>  $(TCG_TESTS_TARGETS:%=build-tcg-tests-%): build-tcg-tests-%: 
> $(BUILD_DIR)/tests/tcg/config-%.mak
>       $(call quiet-command, \

Regards,
Pierrick

Reply via email to