Skip to contentSkip to conversation

tests/docker: fix docker-all-test-cross

PATCH In review Alex Bennée 3 participants 3 messages Aug 4, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/docker: fix docker-all-test-cross

It turns out you can't easily expand an ENV var across multiple steps in a dockerfile. This meant we silently dropped the architectures we should have even on amd64 hosts. As the updated AVAILABLE_COMPILERS is only needed for the following apt install line just merge them.

Fixes 6da616bb170 (tests/docker: handle host-arch selection for all-test-cross)
---
 tests/docker/dockerfiles/debian-all-test-cross.docker | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
tests/docker/dockerfiles/debian-all-test-cross.docker +1 -3
index ef69bbc8a51..420a4e33e60 100644
@@ -62,9 +62,7 @@ RUN if dpkg-architecture -e amd64; then \
   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 \
+  DEBIAN_FRONTEND=noninteractive eatmydata \
         apt install -y --no-install-recommends \
         ${AVAILABLE_COMPILERS} && \
         dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt
Signature · 1 line
2.47.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 17 lines · Alex Bennée

It turns out you can't easily expand an ENV var across multiple steps in a dockerfile. This meant we silently dropped the architectures we should have even on amd64 hosts. As the updated AVAILABLE_COMPILERS is only needed for the following apt install line just merge them.

Fixes 6da616bb170 (tests/docker: handle host-arch selection for all-test-cross)
---
  tests/docker/dockerfiles/debian-all-test-cross.docker | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
tests/docker/dockerfiles/debian-all-test-cross.docker +0 -0
index ef69bbc8a51..420a4e33e60 100644

tests/docker/dockerfiles/debian-all-test-cross.docker RUN if dpkg-architecture -e amd64; then \ · line 68

Quoted 10 lines
tests/docker/dockerfiles/debian-all-test-cross.docker +1 -3
@@ -62,9 +62,7 @@ RUN if dpkg-architecture -e amd64; then \
    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 \
+  DEBIAN_FRONTEND=noninteractive eatmydata \
          apt install -y --no-install-recommends \
          ${AVAILABLE_COMPILERS} && \
          dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt

r~

Reviewed-by on v1 1/1
#2 lore raw
In reply to Alex Bennée
Quoted 29 lines · Alex Bennée

It turns out you can't easily expand an ENV var across multiple steps in a dockerfile. This meant we silently dropped the architectures we should have even on amd64 hosts. As the updated AVAILABLE_COMPILERS is only needed for the following apt install line just merge them.

Fixes 6da616bb170 (tests/docker: handle host-arch selection for all-test-cross)
---
 tests/docker/dockerfiles/debian-all-test-cross.docker | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
tests/docker/dockerfiles/debian-all-test-cross.docker +1 -4
index ef69bbc8a51..420a4e33e60 100644
@@ -62,9 +62,7 @@ RUN if dpkg-architecture -e amd64; then \
   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 \
+  DEBIAN_FRONTEND=noninteractive eatmydata \
         apt install -y --no-install-recommends \
         ${AVAILABLE_COMPILERS} && \
         dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt
--
Quoted 2 lines

2.47.2