tests/docker: handle host-arch selection for all-test-cross

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.

Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-ID: <20250725154517.3523095-14-alex.bennee@linaro.org>
This commit is contained in:
Alex Bennée 2025-07-25 16:45:16 +01:00
parent 408c862910
commit 6da616bb17

View File

@ -23,7 +23,9 @@ RUN DEBIAN_FRONTEND=noninteractive eatmydata \
bison \ bison \
ccache \ ccache \
clang \ clang \
dpkg-dev \
flex \ flex \
gcc \
git \ git \
libclang-rt-dev \ libclang-rt-dev \
ninja-build \ ninja-build \
@ -33,16 +35,11 @@ RUN DEBIAN_FRONTEND=noninteractive eatmydata \
python3-venv \ python3-venv \
python3-wheel python3-wheel
RUN DEBIAN_FRONTEND=noninteractive eatmydata \ # All the generally available compilers
apt install -y --no-install-recommends \ ENV AVAILABLE_COMPILERS gcc-aarch64-linux-gnu \
gcc-aarch64-linux-gnu \
libc6-dev-arm64-cross \ libc6-dev-arm64-cross \
gcc-arm-linux-gnueabihf \ gcc-arm-linux-gnueabihf \
libc6-dev-armhf-cross \ libc6-dev-armhf-cross \
gcc-hppa-linux-gnu \
libc6-dev-hppa-cross \
gcc-m68k-linux-gnu \
libc6-dev-m68k-cross \
gcc-mips-linux-gnu \ gcc-mips-linux-gnu \
libc6-dev-mips-cross \ libc6-dev-mips-cross \
gcc-mips64-linux-gnuabi64 \ gcc-mips64-linux-gnuabi64 \
@ -51,18 +48,25 @@ RUN DEBIAN_FRONTEND=noninteractive eatmydata \
libc6-dev-mips64el-cross \ libc6-dev-mips64el-cross \
gcc-mipsel-linux-gnu \ gcc-mipsel-linux-gnu \
libc6-dev-mipsel-cross \ libc6-dev-mipsel-cross \
gcc-powerpc-linux-gnu \
libc6-dev-powerpc-cross \
gcc-powerpc64-linux-gnu \
libc6-dev-ppc64-cross \
gcc-powerpc64le-linux-gnu \ gcc-powerpc64le-linux-gnu \
libc6-dev-ppc64el-cross \ libc6-dev-ppc64el-cross \
gcc-riscv64-linux-gnu \ gcc-riscv64-linux-gnu \
libc6-dev-riscv64-cross \ libc6-dev-riscv64-cross \
gcc-s390x-linux-gnu \ gcc-s390x-linux-gnu \
libc6-dev-s390x-cross \ libc6-dev-s390x-cross
gcc-sparc64-linux-gnu \
libc6-dev-sparc64-cross && \ 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}"
RUN DEBIAN_FRONTEND=noninteractive eatmydata \
apt install -y --no-install-recommends \
${AVAILABLE_COMPILERS} && \
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt