qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Cc: qemu-devel@nongnu.org,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>
Subject: Re: [PATCH for 10.1 13/13] tests/docker: handle host-arch selection for all-test-cross
Date: Fri, 25 Jul 2025 12:57:55 +0100	[thread overview]
Message-ID: <87v7ngscsc.fsf@draig.linaro.org> (raw)
In-Reply-To: <CAAjaMXaUefn-3tYXgV5itg_=rg4_hwqRAugO_nHHM7RD3v1Nsw@mail.gmail.com> (Manos Pitsidianakis's message of "Thu, 24 Jul 2025 15:49:24 +0300")

Manos Pitsidianakis <manos.pitsidianakis@linaro.org> writes:

> On Thu, Jul 24, 2025 at 3:36 PM Alex Bennée <alex.bennee@linaro.org> wrote:
>>
>> Manos Pitsidianakis <manos.pitsidianakis@linaro.org> writes:
>>
>> > On Thu, Jul 24, 2025 at 2:00 PM Alex Bennée <alex.bennee@linaro.org> wrote:
>> >>
>> >> When building on non-x86 we get a bunch but not all of the compilers.
>> >> Handle this in the Dockerfile by probing the arch and expanding the
>> >> list available.
>> >>
>> >> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> >> ---
>> >>  .../dockerfiles/debian-all-test-cross.docker  | 31 ++++++++++---------
>> >>  1 file changed, 17 insertions(+), 14 deletions(-)
>> >>
>> >> diff --git a/tests/docker/dockerfiles/debian-all-test-cross.docker b/tests/docker/dockerfiles/debian-all-test-cross.docker
>> >> index 5aa43749ebe..16a83241270 100644
>> >> --- a/tests/docker/dockerfiles/debian-all-test-cross.docker
>> >> +++ b/tests/docker/dockerfiles/debian-all-test-cross.docker
>> >> @@ -23,7 +23,9 @@ RUN DEBIAN_FRONTEND=noninteractive eatmydata \
>> >>          bison \
>> >>          ccache \
>> >>          clang  \
>> >> +        dpkg-dev \
>> >>          flex \
>> >> +        gcc \
>> >>          git \
>> >>          libclang-rt-dev \
>> >>          ninja-build \
>> >> @@ -33,16 +35,11 @@ RUN DEBIAN_FRONTEND=noninteractive eatmydata \
>> >>          python3-venv \
>> >>          python3-wheel
>> >>
>> >> -RUN DEBIAN_FRONTEND=noninteractive eatmydata \
>> >> -        apt install -y --no-install-recommends \
>> >> -        gcc-aarch64-linux-gnu \
>> >> +# All the generally available compilers
>> >> +ENV AVAILABLE_COMPILERS gcc-aarch64-linux-gnu \
>> >>          libc6-dev-arm64-cross \
>> >>          gcc-arm-linux-gnueabihf \
>> >>          libc6-dev-armhf-cross \
>> >> -        gcc-hppa-linux-gnu \
>> >> -        libc6-dev-hppa-cross \
>> >> -        gcc-m68k-linux-gnu \
>> >> -        libc6-dev-m68k-cross \
>> >>          gcc-mips-linux-gnu \
>> >>          libc6-dev-mips-cross \
>> >>          gcc-mips64-linux-gnuabi64 \
>> >> @@ -51,18 +48,24 @@ RUN DEBIAN_FRONTEND=noninteractive eatmydata \
>> >>          libc6-dev-mips64el-cross \
>> >>          gcc-mipsel-linux-gnu \
>> >>          libc6-dev-mipsel-cross \
>> >> -        gcc-powerpc-linux-gnu \
>> >> -        libc6-dev-powerpc-cross \
>> >> -        gcc-powerpc64-linux-gnu \
>> >> -        libc6-dev-ppc64-cross \
>> >>          gcc-powerpc64le-linux-gnu \
>> >>          libc6-dev-ppc64el-cross \
>> >>          gcc-riscv64-linux-gnu \
>> >>          libc6-dev-riscv64-cross \
>> >>          gcc-s390x-linux-gnu \
>> >> -        libc6-dev-s390x-cross \
>> >> -        gcc-sparc64-linux-gnu \
>> >> -        libc6-dev-sparc64-cross && \
>> >> +        libc6-dev-s390x-cross
>> >> +
>> >> +RUN if dpkg-architecture -e amd64; then export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS} gcc-hppa-linux-gnu libc6-dev-hppa-cross"; fi
>> >> +RUN if dpkg-architecture -e amd64; then export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS} gcc-m68k-linux-gnu libc6-dev-m68k-cross"; fi
>> >> +RUN if dpkg-architecture -e amd64; then export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS} gcc-powerpc-linux-gnu libc6-dev-powerpc-cross"; fi
>> >> +RUN if dpkg-architecture -e amd64; then export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS} gcc-powerpc64-linux-gnu libc6-dev-ppc64-cross"; fi
>> >> +RUN if dpkg-architecture -e amd64; then export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS} gcc-sparc64-linux-gnu libc6-dev-sparc64-cross"; fi
>> >> +
>> >> +RUN echo "compilers: ${AVAILABLE_COMPILERS}"
>> >
>> > Nitpick, each `RUN` command will create a new cached layer for the
>> > container build. It makes more sense to fold them in a single `RUN`
>> > step to avoid unnecessary layers. Does not make a big difference so
>> > feel free to ignore.
>>
>> I did try to figure out how to do a multi-line shell with an env
>> expansion but wasn't able to get the escaping right. If you can suggest
>> the right runes please do ;-)
>
> Like this?
>
> RUN if dpkg-architecture -e amd64; then \
>   export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS}
> gcc-hppa-linux-gnu libc6-dev-hppa-cross"; \
>   export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS}
> gcc-m68k-linux-gnu libc6-dev-m68k-cross"; \
>   export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS}
> gcc-powerpc-linux-gnu libc6-dev-powerpc-cross"; \
>   export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS}
> gcc-powerpc64-linux-gnu libc6-dev-ppc64-cross"; \
>   export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS}
> gcc-sparc64-linux-gnu libc6-dev-sparc64-cross"; \
>   fi && \
>   echo "compilers: ${AVAILABLE_COMPILERS}"
>

Nope, the continuation has to run for all the lines of the RUN
statement.

  Processing triggers for libc-bin (2.36-9+deb12u10) ...
  --> 703d5c21c6e4
  STEP 5/18: ENV AVAILABLE_COMPILERS gcc-aarch64-linux-gnu         libc6-dev-arm64-cross         gcc-arm-linux-gnueabihf         libc6-dev-armhf-cross         gcc-mips-linux-gnu         libc6-dev-mips-cross         gcc-mips64-linux-gnuabi64         libc6-dev-mips64-cross         gcc-mips64el-linux-gnuabi64         libc6-dev-mips64el-cross         gcc-mipsel-linux-gnu         libc6-dev-mipsel-cross         gcc-powerpc64le-linux-gnu         libc6-dev-ppc64el-cross         gcc-riscv64-linux-gnu         libc6-dev-riscv64-cross         gcc-s390x-linux-gnu         libc6-dev-s390x-cross
  --> e6fa99881c94
  STEP 6/18: RUN if dpkg-architecture -e amd64; then   export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS}
  /bin/sh: 1: Syntax error: Unterminated quoted string
  Error: building at STEP "RUN if dpkg-architecture -e amd64; then   export AVAILABLE_COMPILERS="${AVAILABLE_COMPILERS}": while running runtime: exit status 2
  make: *** [tests/docker/Makefile.include:40: docker-image-debian-all-test-cross] Error 2

>
>>
>> >
>> > Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
>> >
>> >> +
>> >> +RUN DEBIAN_FRONTEND=noninteractive eatmydata \
>> >> +        apt install -y --no-install-recommends \
>> >> +        ${AVAILABLE_COMPILERS} && \
>> >>          dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt
>> >>
>> >>
>> >> --
>> >> 2.47.2
>> >>
>> >>
>>
>> --
>> Alex Bennée
>> Virtualisation Tech Lead @ Linaro

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


  reply	other threads:[~2025-07-25 11:59 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-24 10:59 [PATCH for 10.1 00/13] documentation updates and test tweaks Alex Bennée
2025-07-24 10:59 ` [PATCH for 10.1 01/13] docs/user: clarify user-mode expects the same OS Alex Bennée
2025-07-24 11:02   ` Manos Pitsidianakis
2025-07-24 10:59 ` [PATCH for 10.1 02/13] docs/system: reword the TAP notes to remove tarball ref Alex Bennée
2025-07-24 11:07   ` Manos Pitsidianakis
2025-07-24 10:59 ` [PATCH for 10.1 03/13] docs/user: clean up headings Alex Bennée
2025-07-24 11:09   ` Manos Pitsidianakis
2025-07-25  1:13   ` Richard Henderson
2025-07-25  1:14     ` Richard Henderson
2025-07-24 10:59 ` [PATCH for 10.1 04/13] docs/user: slightly reword section on system calls Alex Bennée
2025-07-24 11:10   ` Manos Pitsidianakis
2025-07-24 10:59 ` [PATCH for 10.1 05/13] docs/user: expand section on threading Alex Bennée
2025-07-24 11:13   ` Manos Pitsidianakis
2025-07-24 10:59 ` [PATCH for 10.1 06/13] tests/functional: add hypervisor test for aarch64 Alex Bennée
2025-07-24 13:38   ` Thomas Huth
2025-07-24 10:59 ` [PATCH for 10.1 07/13] tests/tcg: skip libsyscall.so on softmmu tests Alex Bennée
2025-07-24 11:14   ` Manos Pitsidianakis
2025-07-24 10:59 ` [PATCH for 10.1 08/13] tests/tcg: remove ADDITIONAL_PLUGINS_TESTS Alex Bennée
2025-07-24 11:15   ` Manos Pitsidianakis
2025-07-24 10:59 ` [PATCH for 10.1 09/13] tests/tcg: don't include multiarch tests if not supported Alex Bennée
2025-07-24 11:17   ` Manos Pitsidianakis
2025-07-24 10:59 ` [PATCH for 10.1 10/13] configure: expose PYTHON to test/tcg/config-host.mak Alex Bennée
2025-07-24 11:18   ` Manos Pitsidianakis
2025-07-24 10:59 ` [PATCH for 10.1 11/13] tests/tcg: reduce the number of plugin tests combinations Alex Bennée
2025-07-24 11:25   ` Manos Pitsidianakis
2025-07-24 11:59     ` Alex Bennée
2025-07-24 12:05       ` Manos Pitsidianakis
2025-07-24 12:48         ` Alex Bennée
2025-07-24 12:53           ` Manos Pitsidianakis
2025-07-24 10:59 ` [PATCH for 10.1 12/13] tests/docker: add --arch-only to qemu deps for all-test-cross Alex Bennée
2025-07-24 11:30   ` Manos Pitsidianakis
2025-07-24 10:59 ` [PATCH for 10.1 13/13] tests/docker: handle host-arch selection " Alex Bennée
2025-07-24 11:29   ` Manos Pitsidianakis
2025-07-24 12:36     ` Alex Bennée
2025-07-24 12:49       ` Manos Pitsidianakis
2025-07-25 11:57         ` Alex Bennée [this message]
2025-07-25 12:46           ` Manos Pitsidianakis

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=87v7ngscsc.fsf@draig.linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=manos.pitsidianakis@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).