qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] tests: docker images for hexagon, nios2, microblaze
@ 2021-10-14 22:44 Richard Henderson
  2021-10-14 22:44 ` [PATCH 1/7] tests/docker: Use apt build-dep in debian10 Richard Henderson
                   ` (7 more replies)
  0 siblings, 8 replies; 16+ messages in thread
From: Richard Henderson @ 2021-10-14 22:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

I've refined Brian's outline [1] into a proper patch.
I've updated my nios2 docker toolchain build based on Alex's feedback,
then added another toolchain build for microblaze.

I'll keep the other nios2 changes in another patch set.


r~


[1] https://lore.kernel.org/qemu-devel/SN6PR02MB42057F473618E661B72E1FF3B8AB9@SN6PR02MB4205.namprd02.prod.outlook.com/

Brian Cain (1):
  tests/docker: Update debian-hexagon-cross to a newer toolchain

Richard Henderson (6):
  tests/docker: Use apt build-dep in debian10
  tests/docker: Simplify debian-all-test-cross
  gitlab-ci: Remove special casing for hexagon testing
  tests/docker: Add debian-nios2-cross image
  tests/docker: Add debian-microblaze-cross image
  tests/tcg: Enable container_cross_cc for microblaze

 .gitlab-ci.d/buildtest.yml                    |   4 -
 .gitlab-ci.d/container-cross.yml              |  27 +---
 tests/docker/Makefile.include                 |  50 ++++---
 .../dockerfiles/debian-all-test-cross.docker  |   5 -
 .../dockerfiles/debian-hexagon-cross.docker   |  45 +-----
 .../build-toolchain.sh                        | 141 ------------------
 .../build-toolchain.sh                        |  88 +++++++++++
 .../debian-nios2-cross.d/build-toolchain.sh   |  87 +++++++++++
 .../dockerfiles/debian-toolchain.docker       |  36 +++++
 tests/docker/dockerfiles/debian10.docker      |   9 +-
 tests/tcg/configure.sh                        |   6 +
 11 files changed, 263 insertions(+), 235 deletions(-)
 delete mode 100755 tests/docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh
 create mode 100755 tests/docker/dockerfiles/debian-microblaze-cross.d/build-toolchain.sh
 create mode 100755 tests/docker/dockerfiles/debian-nios2-cross.d/build-toolchain.sh
 create mode 100644 tests/docker/dockerfiles/debian-toolchain.docker

-- 
2.25.1



^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 1/7] tests/docker: Use apt build-dep in debian10
  2021-10-14 22:44 [PATCH 0/7] tests: docker images for hexagon, nios2, microblaze Richard Henderson
@ 2021-10-14 22:44 ` Richard Henderson
  2021-10-18 10:53   ` Alex Bennée
  2021-10-14 22:44 ` [PATCH 2/7] tests/docker: Simplify debian-all-test-cross Richard Henderson
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 16+ messages in thread
From: Richard Henderson @ 2021-10-14 22:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

Replace the complex apt-get subshell with apt build-dep.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tests/docker/dockerfiles/debian10.docker | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/docker/dockerfiles/debian10.docker b/tests/docker/dockerfiles/debian10.docker
index b414af1b9f..d3bbb90c64 100644
--- a/tests/docker/dockerfiles/debian10.docker
+++ b/tests/docker/dockerfiles/debian10.docker
@@ -14,7 +14,8 @@ RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sources.lis
 
 # Install common build utilities
 RUN apt update && \
-    DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
+    DEBIAN_FRONTEND=noninteractive \
+    apt install -yy eatmydata && \
     DEBIAN_FRONTEND=noninteractive eatmydata \
     apt install -y --no-install-recommends \
         bc \
@@ -33,5 +34,7 @@ RUN apt update && \
         psmisc \
         python3 \
         python3-sphinx \
-        python3-sphinx-rtd-theme \
-        $(apt-get -s build-dep --arch-only qemu | egrep ^Inst | fgrep '[all]' | cut -d\  -f2)
+        python3-sphinx-rtd-theme
+
+RUN DEBIAN_FRONTEND=noninteractive eatmydata \
+    apt build-dep -yy qemu
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 2/7] tests/docker: Simplify debian-all-test-cross
  2021-10-14 22:44 [PATCH 0/7] tests: docker images for hexagon, nios2, microblaze Richard Henderson
  2021-10-14 22:44 ` [PATCH 1/7] tests/docker: Use apt build-dep in debian10 Richard Henderson
@ 2021-10-14 22:44 ` Richard Henderson
  2021-10-18 10:54   ` Alex Bennée
  2021-10-14 22:44 ` [PATCH 3/7] tests/docker: Update debian-hexagon-cross to a newer toolchain Richard Henderson
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 16+ messages in thread
From: Richard Henderson @ 2021-10-14 22:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

The base debian10 image contains enough to build qemu;
we do not need to repeat that within the new image.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tests/docker/dockerfiles/debian-all-test-cross.docker | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/tests/docker/dockerfiles/debian-all-test-cross.docker b/tests/docker/dockerfiles/debian-all-test-cross.docker
index dedcea58b4..b185b7c15a 100644
--- a/tests/docker/dockerfiles/debian-all-test-cross.docker
+++ b/tests/docker/dockerfiles/debian-all-test-cross.docker
@@ -8,11 +8,6 @@
 #
 FROM qemu/debian10
 
-# What we need to build QEMU itself
-RUN apt update && \
-    DEBIAN_FRONTEND=noninteractive eatmydata \
-    apt build-dep -yy qemu
-
 # Add the foreign architecture we want and install dependencies
 RUN DEBIAN_FRONTEND=noninteractive eatmydata \
         apt install -y --no-install-recommends \
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 3/7] tests/docker: Update debian-hexagon-cross to a newer toolchain
  2021-10-14 22:44 [PATCH 0/7] tests: docker images for hexagon, nios2, microblaze Richard Henderson
  2021-10-14 22:44 ` [PATCH 1/7] tests/docker: Use apt build-dep in debian10 Richard Henderson
  2021-10-14 22:44 ` [PATCH 2/7] tests/docker: Simplify debian-all-test-cross Richard Henderson
@ 2021-10-14 22:44 ` Richard Henderson
  2021-10-14 22:44 ` [PATCH 4/7] gitlab-ci: Remove special casing for hexagon testing Richard Henderson
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 16+ messages in thread
From: Richard Henderson @ 2021-10-14 22:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: Brian Cain, alex.bennee, Brian Cain

From: Brian Cain <brian.cain@gmail.com>

The new dockerfile uses a complete toolchain built by CodeLinaro.
Remove the special casing that was necessary when the dockerfile
built the toolchain from source.

Suggested-by: Brian Cain <bcain@quicinc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tests/docker/Makefile.include                 |  24 +--
 .../dockerfiles/debian-hexagon-cross.docker   |  45 +-----
 .../build-toolchain.sh                        | 141 ------------------
 3 files changed, 9 insertions(+), 201 deletions(-)
 delete mode 100755 tests/docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh

diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index b9d4094c2e..d223100dff 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -148,33 +148,11 @@ docker-image-debian-sparc64-cross: docker-image-debian10
 # The native build should never use the registry
 docker-image-debian-native: DOCKER_REGISTRY=
 
-
-#
-# The build rule for hexagon-cross is special in so far for most of
-# the time we don't want to build it. While dockers caching does avoid
-# this most of the time sometimes we want to force the issue.
-#
-docker-image-debian-hexagon-cross: $(DOCKER_FILES_DIR)/debian-hexagon-cross.docker
-	$(if $(NOCACHE), 								\
-		$(call quiet-command,							\
-			$(DOCKER_SCRIPT) build -t qemu/debian-hexagon-cross -f $< 	\
-			$(if $V,,--quiet) --no-cache 					\
-			--registry $(DOCKER_REGISTRY) --extra-files			\
-			$(DOCKER_FILES_DIR)/debian-hexagon-cross.docker.d/build-toolchain.sh, \
-			"BUILD", "debian-hexagon-cross"),				\
-		$(call quiet-command,							\
-			$(DOCKER_SCRIPT) fetch $(if $V,,--quiet)			\
-				qemu/debian-hexagon-cross $(DOCKER_REGISTRY),		\
-			"FETCH", "debian-hexagon-cross")				\
-		$(call quiet-command,							\
-			$(DOCKER_SCRIPT) update $(if $V,,--quiet) 			\
-				qemu/debian-hexagon-cross --add-current-user,		\
-			"PREPARE", "debian-hexagon-cross"))
-
 # Specialist build images, sometimes very limited tools
 docker-image-debian-tricore-cross: docker-image-debian10
 docker-image-debian-all-test-cross: docker-image-debian10
 docker-image-debian-arm64-test-cross: docker-image-debian11
+docker-image-debian-hexagon-cross: docker-image-debian10
 docker-image-debian-powerpc-test-cross: docker-image-debian11
 
 # These images may be good enough for building tests but not for test builds
diff --git a/tests/docker/dockerfiles/debian-hexagon-cross.docker b/tests/docker/dockerfiles/debian-hexagon-cross.docker
index d5dc299dc1..f3d7110814 100644
--- a/tests/docker/dockerfiles/debian-hexagon-cross.docker
+++ b/tests/docker/dockerfiles/debian-hexagon-cross.docker
@@ -1,45 +1,16 @@
 #
 # Docker Hexagon cross-compiler target
 #
-# This docker target is used for building hexagon tests. As it also
-# needs to be able to build QEMU itself in CI we include it's
-# build-deps. It is also a "stand-alone" image so as not to be
-# triggered by re-builds on other base images given it takes a long
-# time to build.
-#
 FROM qemu/debian10
 
-# Install common build utilities
-RUN apt update && \
-    DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
-    DEBIAN_FRONTEND=noninteractive eatmydata \
+RUN DEBIAN_FRONTEND=noninteractive eatmydata \
     apt install -y --no-install-recommends \
-        bison \
-        cmake \
-        flex \
-        lld \
-        rsync \
-        wget
+        curl \
+        xz-utils
 
-ENV TOOLCHAIN_INSTALL /usr/local
-ENV ROOTFS /usr/local
+RUN curl -#SL https://codelinaro.jfrog.io/artifactory/codelinaro-toolchain-for-hexagon/v2021.09.10/clang+llvm-Sept-2021-cross-hexagon-unknown-linux-musl.tar.xz \
+  | tar -xJC /opt
 
-ENV LLVM_URL https://github.com/llvm/llvm-project/archive/bfcd21876adc3498065e4da92799f613e730d475.tar.gz
-ENV MUSL_URL https://github.com/quic/musl/archive/aff74b395fbf59cd7e93b3691905aa1af6c0778c.tar.gz
-ENV LINUX_URL https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.6.18.tar.xz
-
-ADD build-toolchain.sh /root/hexagon-toolchain/build-toolchain.sh
-
-RUN cd /root/hexagon-toolchain && ./build-toolchain.sh
-
-FROM debian:buster-slim
-# Duplicate deb line as deb-src
-RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sources.list
-# Install QEMU build deps for use in CI
-RUN apt update && \
-    DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
-    DEBIAN_FRONTEND=noninteractive eatmydata apt install -yy git ninja-build && \
-    DEBIAN_FRONTEND=noninteractive eatmydata \
-    apt build-dep -yy --arch-only qemu
-COPY --from=0 /usr/local /usr/local
-ENV PATH $PATH:/usr/local/bin/
+ENV PATH $PATH:/opt/clang+llvm-Sept-2021-cross-hexagon-unknown-linux-musl/x86_64-linux-gnu/bin
+ENV DEF_TARGET_LIST hexagon-linux-user
+ENV QEMU_CONFIGURE_OPTS --disable-docs --disable-tools --cross-cc-hexagon=hexagon-unknown-linux-musl-clang
diff --git a/tests/docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh b/tests/docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh
deleted file mode 100755
index 19b1c9f83e..0000000000
--- a/tests/docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh
+++ /dev/null
@@ -1,141 +0,0 @@
-#!/bin/bash
-
-set -e
-
-BASE=$(readlink -f ${PWD})
-
-TOOLCHAIN_INSTALL=$(readlink -f "$TOOLCHAIN_INSTALL")
-ROOTFS=$(readlink -f "$ROOTFS")
-
-TOOLCHAIN_BIN=${TOOLCHAIN_INSTALL}/bin
-HEX_SYSROOT=${TOOLCHAIN_INSTALL}/hexagon-unknown-linux-musl
-HEX_TOOLS_TARGET_BASE=${HEX_SYSROOT}/usr
-
-function cdp() {
-  DIR="$1"
-  mkdir -p "$DIR"
-  cd "$DIR"
-}
-
-function fetch() {
-  DIR="$1"
-  URL="$2"
-  TEMP="$(readlink -f "$PWD/tmp.tar.gz")"
-  wget --quiet "$URL" -O "$TEMP"
-  cdp "$DIR"
-  tar xaf "$TEMP" --strip-components=1
-  rm "$TEMP"
-  cd -
-}
-
-build_llvm_clang() {
-  fetch "$BASE/llvm-project" "$LLVM_URL"
-  cdp "$BASE/build-llvm"
-
-  cmake -G Ninja \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DCMAKE_INSTALL_PREFIX=${TOOLCHAIN_INSTALL} \
-    -DLLVM_ENABLE_LLD=ON \
-    -DLLVM_TARGETS_TO_BUILD="Hexagon" \
-    -DLLVM_ENABLE_PROJECTS="clang;lld" \
-    "$BASE/llvm-project/llvm"
-  ninja all install
-  cd ${TOOLCHAIN_BIN}
-  ln -sf clang hexagon-unknown-linux-musl-clang
-  ln -sf clang++ hexagon-unknown-linux-musl-clang++
-  ln -sf llvm-ar hexagon-unknown-linux-musl-ar
-  ln -sf llvm-objdump hexagon-unknown-linux-musl-objdump
-  ln -sf llvm-objcopy hexagon-unknown-linux-musl-objcopy
-  ln -sf llvm-readelf hexagon-unknown-linux-musl-readelf
-  ln -sf llvm-ranlib hexagon-unknown-linux-musl-ranlib
-
-  # workaround for now:
-  cat <<EOF > hexagon-unknown-linux-musl.cfg
--G0 --sysroot=${HEX_SYSROOT}
-EOF
-}
-
-build_clang_rt() {
-  cdp "$BASE/build-clang_rt"
-  cmake -G Ninja \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DLLVM_CONFIG_PATH="$BASE/build-llvm/bin/llvm-config" \
-    -DCMAKE_ASM_FLAGS="-G0 -mlong-calls -fno-pic --target=hexagon-unknown-linux-musl " \
-    -DCMAKE_SYSTEM_NAME=Linux \
-    -DCMAKE_C_COMPILER="${TOOLCHAIN_BIN}/hexagon-unknown-linux-musl-clang" \
-    -DCMAKE_ASM_COMPILER="${TOOLCHAIN_BIN}/hexagon-unknown-linux-musl-clang" \
-    -DCMAKE_INSTALL_PREFIX=${HEX_TOOLS_TARGET_BASE} \
-    -DCMAKE_CROSSCOMPILING=ON \
-    -DCMAKE_C_COMPILER_FORCED=ON \
-    -DCMAKE_CXX_COMPILER_FORCED=ON \
-    -DCOMPILER_RT_BUILD_BUILTINS=ON \
-    -DCOMPILER_RT_BUILTINS_ENABLE_PIC=OFF \
-    -DCMAKE_SIZEOF_VOID_P=4 \
-    -DCOMPILER_RT_OS_DIR= \
-    -DCAN_TARGET_hexagon=1 \
-    -DCAN_TARGET_x86_64=0 \
-    -DCOMPILER_RT_SUPPORTED_ARCH=hexagon \
-    -DLLVM_ENABLE_PROJECTS="compiler-rt" \
-    "$BASE/llvm-project/compiler-rt"
-  ninja install-compiler-rt
-}
-
-build_musl_headers() {
-  fetch "$BASE/musl" "$MUSL_URL"
-  cd "$BASE/musl"
-  make clean
-  CC=${TOOLCHAIN_BIN}/hexagon-unknown-linux-musl-clang \
-    CROSS_COMPILE=hexagon-unknown-linux-musl \
-    LIBCC=${HEX_TOOLS_TARGET_BASE}/lib/libclang_rt.builtins-hexagon.a \
-    CROSS_CFLAGS="-G0 -O0 -mv65 -fno-builtin -fno-rounding-math --target=hexagon-unknown-linux-musl" \
-    ./configure --target=hexagon --prefix=${HEX_TOOLS_TARGET_BASE}
-  PATH=${TOOLCHAIN_BIN}:$PATH make CROSS_COMPILE= install-headers
-
-  cd ${HEX_SYSROOT}/..
-  ln -sf hexagon-unknown-linux-musl hexagon
-}
-
-build_kernel_headers() {
-  fetch "$BASE/linux" "$LINUX_URL"
-  mkdir -p "$BASE/build-linux"
-  cd "$BASE/linux"
-  make O=../build-linux ARCH=hexagon \
-   KBUILD_CFLAGS_KERNEL="-mlong-calls" \
-   CC=${TOOLCHAIN_BIN}/hexagon-unknown-linux-musl-clang \
-   LD=${TOOLCHAIN_BIN}/ld.lld \
-   KBUILD_VERBOSE=1 comet_defconfig
-  make mrproper
-
-  cd "$BASE/build-linux"
-  make \
-    ARCH=hexagon \
-    CC=${TOOLCHAIN_BIN}/clang \
-    INSTALL_HDR_PATH=${HEX_TOOLS_TARGET_BASE} \
-    V=1 \
-    headers_install
-}
-
-build_musl() {
-  cd "$BASE/musl"
-  make clean
-  CROSS_COMPILE=hexagon-unknown-linux-musl- \
-    AR=llvm-ar \
-    RANLIB=llvm-ranlib \
-    STRIP=llvm-strip \
-    CC=clang \
-    LIBCC=${HEX_TOOLS_TARGET_BASE}/lib/libclang_rt.builtins-hexagon.a \
-    CFLAGS="-G0 -O0 -mv65 -fno-builtin -fno-rounding-math --target=hexagon-unknown-linux-musl" \
-    ./configure --target=hexagon --prefix=${HEX_TOOLS_TARGET_BASE}
-  PATH=${TOOLCHAIN_BIN}/:$PATH make CROSS_COMPILE= install
-  cd ${HEX_TOOLS_TARGET_BASE}/lib
-  ln -sf libc.so ld-musl-hexagon.so
-  ln -sf ld-musl-hexagon.so ld-musl-hexagon.so.1
-  cdp ${HEX_TOOLS_TARGET_BASE}/../lib
-  ln -sf ../usr/lib/ld-musl-hexagon.so.1
-}
-
-build_llvm_clang
-build_kernel_headers
-build_musl_headers
-build_clang_rt
-build_musl
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 4/7] gitlab-ci: Remove special casing for hexagon testing
  2021-10-14 22:44 [PATCH 0/7] tests: docker images for hexagon, nios2, microblaze Richard Henderson
                   ` (2 preceding siblings ...)
  2021-10-14 22:44 ` [PATCH 3/7] tests/docker: Update debian-hexagon-cross to a newer toolchain Richard Henderson
@ 2021-10-14 22:44 ` Richard Henderson
  2021-10-14 22:44 ` [PATCH 5/7] tests/docker: Add debian-nios2-cross image Richard Henderson
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 16+ messages in thread
From: Richard Henderson @ 2021-10-14 22:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

Now that the hexagon container is using a pre-built
toolchain, we do not need to make the build optional.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 .gitlab-ci.d/buildtest.yml       |  4 ----
 .gitlab-ci.d/container-cross.yml | 27 +++------------------------
 2 files changed, 3 insertions(+), 28 deletions(-)

diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml
index 5c378e35f9..27b9b6be6b 100644
--- a/.gitlab-ci.d/buildtest.yml
+++ b/.gitlab-ci.d/buildtest.yml
@@ -249,14 +249,10 @@ build-user-static:
     CONFIGURE_ARGS: --disable-tools --disable-system --static
     MAKE_CHECK_ARGS: check-tcg
 
-# Because the hexagon cross-compiler takes so long to build we don't rely
-# on the CI system to build it and hence this job has an optional dependency
-# declared. The image is manually uploaded.
 build-user-hexagon:
   extends: .native_build_job_template
   needs:
     job: hexagon-cross-container
-    optional: true
   variables:
     IMAGE: debian-hexagon-cross
     TARGETS: hexagon-linux-user
diff --git a/.gitlab-ci.d/container-cross.yml b/.gitlab-ci.d/container-cross.yml
index a3b5b90552..ed7a849a69 100644
--- a/.gitlab-ci.d/container-cross.yml
+++ b/.gitlab-ci.d/container-cross.yml
@@ -47,33 +47,12 @@ armhf-debian-cross-container:
   variables:
     NAME: debian-armhf-cross
 
-# We never want to build hexagon in the CI system and by default we
-# always want to refer to the master registry where it lives.
 hexagon-cross-container:
-  image: docker:stable
-  stage: containers
-  rules:
-    - if: '$CI_PROJECT_NAMESPACE == "qemu-project"'
-      when: never
-    - when: always
+  extends: .container_job_template
+  stage: containers-layer2
+  needs: ['amd64-debian10-container']
   variables:
     NAME: debian-hexagon-cross
-    GIT_DEPTH: 1
-  services:
-    - docker:dind
-  before_script:
-    - export TAG="$CI_REGISTRY_IMAGE/qemu/$NAME:latest"
-    - export COMMON_TAG="$CI_REGISTRY/qemu-project/qemu/qemu/$NAME:latest"
-    - docker info
-    - docker login $CI_REGISTRY -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
-  script:
-    - echo "TAG:$TAG"
-    - echo "COMMON_TAG:$COMMON_TAG"
-    - docker pull $COMMON_TAG
-    - docker tag $COMMON_TAG $TAG
-    - docker push "$TAG"
-  after_script:
-    - docker logout
 
 hppa-debian-cross-container:
   extends: .container_job_template
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 5/7] tests/docker: Add debian-nios2-cross image
  2021-10-14 22:44 [PATCH 0/7] tests: docker images for hexagon, nios2, microblaze Richard Henderson
                   ` (3 preceding siblings ...)
  2021-10-14 22:44 ` [PATCH 4/7] gitlab-ci: Remove special casing for hexagon testing Richard Henderson
@ 2021-10-14 22:44 ` Richard Henderson
  2021-10-14 22:44 ` [PATCH 6/7] tests/docker: Add debian-microblaze-cross image Richard Henderson
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 16+ messages in thread
From: Richard Henderson @ 2021-10-14 22:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

Build the entire cross tool chain from source.
For this reason, default to caching.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tests/docker/Makefile.include                 | 24 +++++
 .../debian-nios2-cross.d/build-toolchain.sh   | 87 +++++++++++++++++++
 .../dockerfiles/debian-toolchain.docker       | 36 ++++++++
 3 files changed, 147 insertions(+)
 create mode 100755 tests/docker/dockerfiles/debian-nios2-cross.d/build-toolchain.sh
 create mode 100644 tests/docker/dockerfiles/debian-toolchain.docker

diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index d223100dff..772e0968aa 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -148,11 +148,34 @@ docker-image-debian-sparc64-cross: docker-image-debian10
 # The native build should never use the registry
 docker-image-debian-native: DOCKER_REGISTRY=
 
+debian-toolchain-run = \
+	$(if $(NOCACHE), 						\
+		$(call quiet-command,					\
+			$(DOCKER_SCRIPT) build -t qemu/$1 -f $< 	\
+			$(if $V,,--quiet) --no-cache 			\
+			--registry $(DOCKER_REGISTRY) --extra-files	\
+			$(DOCKER_FILES_DIR)/$1.d/build-toolchain.sh,	\
+			"BUILD", $1),				        \
+		$(call quiet-command,					\
+			$(DOCKER_SCRIPT) fetch $(if $V,,--quiet)	\
+				qemu/$1 $(DOCKER_REGISTRY),		\
+			"FETCH", $1)					\
+		$(call quiet-command,					\
+			$(DOCKER_SCRIPT) update $(if $V,,--quiet) 	\
+				qemu/$1 --add-current-user,		\
+			"PREPARE", $1))
+debian-toolchain = $(call debian-toolchain-run,$(patsubst docker-image-%,%,$1))
+
+docker-image-debian-nios2-cross: $(DOCKER_FILES_DIR)/debian-toolchain.docker \
+    $(DOCKER_FILES_DIR)/debian-nios2-cross.d/build-toolchain.sh
+	$(call debian-toolchain, $@)
+
 # Specialist build images, sometimes very limited tools
 docker-image-debian-tricore-cross: docker-image-debian10
 docker-image-debian-all-test-cross: docker-image-debian10
 docker-image-debian-arm64-test-cross: docker-image-debian11
 docker-image-debian-hexagon-cross: docker-image-debian10
+docker-image-debian-nios2-cross: docker-image-debian10
 docker-image-debian-powerpc-test-cross: docker-image-debian11
 
 # These images may be good enough for building tests but not for test builds
@@ -161,6 +184,7 @@ DOCKER_PARTIAL_IMAGES += debian-arm64-test-cross
 DOCKER_PARTIAL_IMAGES += debian-powerpc-test-cross
 DOCKER_PARTIAL_IMAGES += debian-hppa-cross
 DOCKER_PARTIAL_IMAGES += debian-m68k-cross debian-mips64-cross
+DOCKER_PARTIAL_IMAGES += debian-nios2-cross
 DOCKER_PARTIAL_IMAGES += debian-sh4-cross debian-sparc64-cross
 DOCKER_PARTIAL_IMAGES += debian-tricore-cross
 DOCKER_PARTIAL_IMAGES += debian-xtensa-cross
diff --git a/tests/docker/dockerfiles/debian-nios2-cross.d/build-toolchain.sh b/tests/docker/dockerfiles/debian-nios2-cross.d/build-toolchain.sh
new file mode 100755
index 0000000000..ba3c9d8aff
--- /dev/null
+++ b/tests/docker/dockerfiles/debian-nios2-cross.d/build-toolchain.sh
@@ -0,0 +1,87 @@
+#!/bin/bash
+
+set -e
+
+TARGET=nios2-linux-gnu
+LINUX_ARCH=nios2
+
+J=$(expr $(nproc) / 2)
+TOOLCHAIN_INSTALL=/usr/local
+TOOLCHAIN_BIN=${TOOLCHAIN_INSTALL}/bin
+CROSS_SYSROOT=${TOOLCHAIN_INSTALL}/$TARGET/sys-root
+
+export PATH=${TOOLCHAIN_BIN}:$PATH
+
+#
+# Grab all of the source for the toolchain bootstrap.
+#
+
+wget https://ftp.gnu.org/gnu/binutils/binutils-2.37.tar.xz
+wget https://ftp.gnu.org/gnu/gcc/gcc-11.2.0/gcc-11.2.0.tar.xz
+wget https://ftp.gnu.org/gnu/glibc/glibc-2.34.tar.xz
+wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.10.70.tar.xz
+
+tar axf binutils-2.37.tar.xz
+tar axf gcc-11.2.0.tar.xz
+tar axf glibc-2.34.tar.xz
+tar axf linux-5.10.70.tar.xz
+
+mv binutils-2.37 src-binu
+mv gcc-11.2.0 src-gcc
+mv glibc-2.34 src-glibc
+mv linux-5.10.70 src-linux
+
+mkdir -p bld-hdr bld-binu bld-gcc bld-glibc
+mkdir -p ${CROSS_SYSROOT}/usr/include
+
+#
+# Install kernel and glibc headers
+#
+
+cd src-linux
+make headers_install ARCH=${LINUX_ARCH} INSTALL_HDR_PATH=${CROSS_SYSROOT}/usr
+cd ..
+
+cd bld-hdr
+../src-glibc/configure --prefix=/usr --host=${TARGET}
+make install-headers DESTDIR=${CROSS_SYSROOT}
+touch ${CROSS_SYSROOT}/usr/include/gnu/stubs.h
+cd ..
+
+#
+# Build binutils
+#
+
+cd bld-binu
+../src-binu/configure --disable-werror \
+  --prefix=${TOOLCHAIN_INSTALL} --with-sysroot --target=${TARGET}
+make -j${J}
+make install
+cd ..
+
+#
+# Build gcc, without shared libraries, because we do not yet
+# have a shared libc against which to link.
+#
+
+cd bld-gcc
+../src-gcc/configure --disable-werror --disable-shared \
+  --prefix=${TOOLCHAIN_INSTALL} --with-sysroot --target=${TARGET} \
+  --enable-languages=c --disable-libssp --disable-libsanitizer \
+  --disable-libatomic --disable-libgomp --disable-libquadmath
+make -j${J}
+make install
+cd ..
+
+#
+# Build glibc
+# There are a few random things that use c++ but we didn't build that
+# cross-compiler.  We can get away without them.  Disable CXX so that
+# glibc doesn't try to use the host c++ compiler.
+#
+
+cd bld-glibc
+CXX=false ../src-glibc/configure --prefix=/usr --host=${TARGET}
+make -j${j}
+make install DESTDIR=${CROSS_SYSROOT}
+cd ..
diff --git a/tests/docker/dockerfiles/debian-toolchain.docker b/tests/docker/dockerfiles/debian-toolchain.docker
new file mode 100644
index 0000000000..738d808aa6
--- /dev/null
+++ b/tests/docker/dockerfiles/debian-toolchain.docker
@@ -0,0 +1,36 @@
+#
+# Docker toolchain cross-compiler
+#
+# This dockerfile is used for building a cross-compiler toolchain.
+# The script for building the toolchain is supplied via extra-files.
+#
+FROM qemu/debian10
+
+# Install build utilities for building gcc and glibc.
+# ??? The build-dep isn't working, missing a number of
+# minimal build dependiencies, e.g. libmpc.
+
+RUN apt update && \
+    DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
+    DEBIAN_FRONTEND=noninteractive eatmydata \
+    apt install -y --no-install-recommends \
+        bison \
+        flex \
+        gawk \
+        libmpc-dev \
+        libmpfr-dev \
+        rsync \
+        texinfo \
+        wget && \
+    DEBIAN_FRONTEND=noninteractive eatmydata \
+    apt build-dep -yy --arch-only gcc glibc
+
+ADD build-toolchain.sh /root/build-toolchain.sh
+
+RUN cd /root && ./build-toolchain.sh
+
+# Throw away the extra toolchain build deps, the downloaded source,
+# and the build trees by restoring the original debian10 image,
+# then copying the built toolchain from stage 0.
+FROM qemu/debian10
+COPY --from=0 /usr/local /usr/local
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 6/7] tests/docker: Add debian-microblaze-cross image
  2021-10-14 22:44 [PATCH 0/7] tests: docker images for hexagon, nios2, microblaze Richard Henderson
                   ` (4 preceding siblings ...)
  2021-10-14 22:44 ` [PATCH 5/7] tests/docker: Add debian-nios2-cross image Richard Henderson
@ 2021-10-14 22:44 ` Richard Henderson
  2021-10-14 22:44 ` [PATCH 7/7] tests/tcg: Enable container_cross_cc for microblaze Richard Henderson
  2021-10-19 14:46 ` [PATCH 0/7] tests: docker images for hexagon, nios2, microblaze Alex Bennée
  7 siblings, 0 replies; 16+ messages in thread
From: Richard Henderson @ 2021-10-14 22:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

Build the entire cross tool chain from source.
For this reason, default to caching.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tests/docker/Makefile.include                 |  6 ++
 .../build-toolchain.sh                        | 88 +++++++++++++++++++
 2 files changed, 94 insertions(+)
 create mode 100755 tests/docker/dockerfiles/debian-microblaze-cross.d/build-toolchain.sh

diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index 772e0968aa..3594290b7f 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -166,6 +166,10 @@ debian-toolchain-run = \
 			"PREPARE", $1))
 debian-toolchain = $(call debian-toolchain-run,$(patsubst docker-image-%,%,$1))
 
+docker-image-debian-microblaze-cross: $(DOCKER_FILES_DIR)/debian-toolchain.docker \
+    $(DOCKER_FILES_DIR)/debian-microblaze-cross.d/build-toolchain.sh
+	$(call debian-toolchain, $@)
+
 docker-image-debian-nios2-cross: $(DOCKER_FILES_DIR)/debian-toolchain.docker \
     $(DOCKER_FILES_DIR)/debian-nios2-cross.d/build-toolchain.sh
 	$(call debian-toolchain, $@)
@@ -175,6 +179,7 @@ docker-image-debian-tricore-cross: docker-image-debian10
 docker-image-debian-all-test-cross: docker-image-debian10
 docker-image-debian-arm64-test-cross: docker-image-debian11
 docker-image-debian-hexagon-cross: docker-image-debian10
+docker-image-debian-microblaze-cross: docker-image-debian10
 docker-image-debian-nios2-cross: docker-image-debian10
 docker-image-debian-powerpc-test-cross: docker-image-debian11
 
@@ -184,6 +189,7 @@ DOCKER_PARTIAL_IMAGES += debian-arm64-test-cross
 DOCKER_PARTIAL_IMAGES += debian-powerpc-test-cross
 DOCKER_PARTIAL_IMAGES += debian-hppa-cross
 DOCKER_PARTIAL_IMAGES += debian-m68k-cross debian-mips64-cross
+DOCKER_PARTIAL_IMAGES += debian-microblaze-cross
 DOCKER_PARTIAL_IMAGES += debian-nios2-cross
 DOCKER_PARTIAL_IMAGES += debian-sh4-cross debian-sparc64-cross
 DOCKER_PARTIAL_IMAGES += debian-tricore-cross
diff --git a/tests/docker/dockerfiles/debian-microblaze-cross.d/build-toolchain.sh b/tests/docker/dockerfiles/debian-microblaze-cross.d/build-toolchain.sh
new file mode 100755
index 0000000000..23ec0aa9a7
--- /dev/null
+++ b/tests/docker/dockerfiles/debian-microblaze-cross.d/build-toolchain.sh
@@ -0,0 +1,88 @@
+#!/bin/bash
+
+set -e
+
+TARGET=microblaze-linux-musl
+LINUX_ARCH=microblaze
+
+J=$(expr $(nproc) / 2)
+TOOLCHAIN_INSTALL=/usr/local
+TOOLCHAIN_BIN=${TOOLCHAIN_INSTALL}/bin
+CROSS_SYSROOT=${TOOLCHAIN_INSTALL}/$TARGET/sys-root
+
+export PATH=${TOOLCHAIN_BIN}:$PATH
+
+#
+# Grab all of the source for the toolchain bootstrap.
+#
+
+wget https://ftp.gnu.org/gnu/binutils/binutils-2.37.tar.xz
+wget https://ftp.gnu.org/gnu/gcc/gcc-11.2.0/gcc-11.2.0.tar.xz
+wget https://www.musl-libc.org/releases/musl-1.2.2.tar.gz
+wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.10.70.tar.xz
+
+tar axf binutils-2.37.tar.xz
+tar axf gcc-11.2.0.tar.xz
+tar axf musl-1.2.2.tar.gz
+tar axf linux-5.10.70.tar.xz
+
+mv binutils-2.37 src-binu
+mv gcc-11.2.0 src-gcc
+mv musl-1.2.2 src-musl
+mv linux-5.10.70 src-linux
+
+mkdir -p bld-hdr bld-binu bld-gcc bld-musl
+mkdir -p ${CROSS_SYSROOT}/usr/include
+
+#
+# Install kernel headers
+#
+
+cd src-linux
+make headers_install ARCH=${LINUX_ARCH} INSTALL_HDR_PATH=${CROSS_SYSROOT}/usr
+cd ..
+
+#
+# Build binutils
+#
+
+cd bld-binu
+../src-binu/configure --disable-werror \
+  --prefix=${TOOLCHAIN_INSTALL} --with-sysroot --target=${TARGET}
+make -j${J}
+make install
+cd ..
+
+#
+# Build gcc, just the compiler so far.
+#
+
+cd bld-gcc
+../src-gcc/configure --disable-werror --disable-shared \
+  --prefix=${TOOLCHAIN_INSTALL} --with-sysroot --target=${TARGET} \
+  --enable-languages=c --disable-libssp --disable-libsanitizer \
+  --disable-libatomic --disable-libgomp --disable-libquadmath
+make -j${J} all-gcc
+make install-gcc
+cd ..
+
+#
+# Build musl.
+# We won't go through the extra step of building shared libraries
+# because we don't actually use them in QEMU docker testing.
+#
+
+cd bld-musl
+../src-musl/configure --prefix=/usr --host=${TARGET} --disable-shared
+make -j${j}
+make install DESTDIR=${CROSS_SYSROOT}
+cd ..
+
+#
+# Go back and build the compiler runtime
+#
+
+cd bld-gcc
+make -j${j}
+make install
+cd ..
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 7/7] tests/tcg: Enable container_cross_cc for microblaze
  2021-10-14 22:44 [PATCH 0/7] tests: docker images for hexagon, nios2, microblaze Richard Henderson
                   ` (5 preceding siblings ...)
  2021-10-14 22:44 ` [PATCH 6/7] tests/docker: Add debian-microblaze-cross image Richard Henderson
@ 2021-10-14 22:44 ` Richard Henderson
  2021-10-18 10:57   ` Alex Bennée
  2021-10-19 14:46 ` [PATCH 0/7] tests: docker images for hexagon, nios2, microblaze Alex Bennée
  7 siblings, 1 reply; 16+ messages in thread
From: Richard Henderson @ 2021-10-14 22:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: alex.bennee

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 tests/tcg/configure.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh
index 1f985ccfc0..149eeb15ff 100755
--- a/tests/tcg/configure.sh
+++ b/tests/tcg/configure.sh
@@ -55,6 +55,7 @@ fi
 : ${cross_cc_i386="i686-linux-gnu-gcc"}
 : ${cross_cc_cflags_i386="-m32"}
 : ${cross_cc_m68k="m68k-linux-gnu-gcc"}
+: $(cross_cc_microblaze="microblaze-linux-musl-gcc")
 : $(cross_cc_mips64el="mips64el-linux-gnuabi64-gcc")
 : $(cross_cc_mips64="mips64-linux-gnuabi64-gcc")
 : $(cross_cc_mipsel="mipsel-linux-gnu-gcc")
@@ -133,6 +134,11 @@ for target in $target_list; do
       container_image=debian-m68k-cross
       container_cross_cc=m68k-linux-gnu-gcc
       ;;
+    microblaze-*)
+      container_hosts=x86_64
+      container_image=debian-microblaze-cross
+      container_cross_cc=microblaze-linux-musl-gcc
+      ;;
     mips64el-*)
       container_hosts=x86_64
       container_image=debian-mips64el-cross
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH 1/7] tests/docker: Use apt build-dep in debian10
  2021-10-14 22:44 ` [PATCH 1/7] tests/docker: Use apt build-dep in debian10 Richard Henderson
@ 2021-10-18 10:53   ` Alex Bennée
  0 siblings, 0 replies; 16+ messages in thread
From: Alex Bennée @ 2021-10-18 10:53 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-devel


Richard Henderson <richard.henderson@linaro.org> writes:

> Replace the complex apt-get subshell with apt build-dep.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  tests/docker/dockerfiles/debian10.docker | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/tests/docker/dockerfiles/debian10.docker b/tests/docker/dockerfiles/debian10.docker
> index b414af1b9f..d3bbb90c64 100644
> --- a/tests/docker/dockerfiles/debian10.docker
> +++ b/tests/docker/dockerfiles/debian10.docker
> @@ -14,7 +14,8 @@ RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sources.lis
>  
>  # Install common build utilities
>  RUN apt update && \
> -    DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \
> +    DEBIAN_FRONTEND=noninteractive \
> +    apt install -yy eatmydata && \
>      DEBIAN_FRONTEND=noninteractive eatmydata \
>      apt install -y --no-install-recommends \
>          bc \
> @@ -33,5 +34,7 @@ RUN apt update && \
>          psmisc \
>          python3 \
>          python3-sphinx \
> -        python3-sphinx-rtd-theme \
> -        $(apt-get -s build-dep --arch-only qemu | egrep ^Inst | fgrep '[all]' | cut -d\  -f2)
> +        python3-sphinx-rtd-theme
> +
> +RUN DEBIAN_FRONTEND=noninteractive eatmydata \
> +    apt build-dep -yy qemu

I'd rather preserve the --arch-only while moving it. Otherwise:

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/7] tests/docker: Simplify debian-all-test-cross
  2021-10-14 22:44 ` [PATCH 2/7] tests/docker: Simplify debian-all-test-cross Richard Henderson
@ 2021-10-18 10:54   ` Alex Bennée
  2021-10-18 11:14     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 16+ messages in thread
From: Alex Bennée @ 2021-10-18 10:54 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-devel


Richard Henderson <richard.henderson@linaro.org> writes:

> The base debian10 image contains enough to build qemu;
> we do not need to repeat that within the new image.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  tests/docker/dockerfiles/debian-all-test-cross.docker | 5 -----
>  1 file changed, 5 deletions(-)
>
> diff --git a/tests/docker/dockerfiles/debian-all-test-cross.docker b/tests/docker/dockerfiles/debian-all-test-cross.docker
> index dedcea58b4..b185b7c15a 100644
> --- a/tests/docker/dockerfiles/debian-all-test-cross.docker
> +++ b/tests/docker/dockerfiles/debian-all-test-cross.docker
> @@ -8,11 +8,6 @@
>  #
>  FROM qemu/debian10
>  
> -# What we need to build QEMU itself
> -RUN apt update && \
> -    DEBIAN_FRONTEND=noninteractive eatmydata \
> -    apt build-dep -yy qemu
> -
>  # Add the foreign architecture we want and install dependencies
>  RUN DEBIAN_FRONTEND=noninteractive eatmydata \
>          apt install -y --no-install-recommends \

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 7/7] tests/tcg: Enable container_cross_cc for microblaze
  2021-10-14 22:44 ` [PATCH 7/7] tests/tcg: Enable container_cross_cc for microblaze Richard Henderson
@ 2021-10-18 10:57   ` Alex Bennée
  0 siblings, 0 replies; 16+ messages in thread
From: Alex Bennée @ 2021-10-18 10:57 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-devel


Richard Henderson <richard.henderson@linaro.org> writes:

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/7] tests/docker: Simplify debian-all-test-cross
  2021-10-18 10:54   ` Alex Bennée
@ 2021-10-18 11:14     ` Philippe Mathieu-Daudé
  2021-10-18 11:33       ` Alex Bennée
  0 siblings, 1 reply; 16+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-10-18 11:14 UTC (permalink / raw)
  To: Alex Bennée, Richard Henderson; +Cc: qemu-devel

On 10/18/21 12:54, Alex Bennée wrote:
> 
> Richard Henderson <richard.henderson@linaro.org> writes:
> 
>> The base debian10 image contains enough to build qemu;
>> we do not need to repeat that within the new image.
>>
>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
>> ---
>>  tests/docker/dockerfiles/debian-all-test-cross.docker | 5 -----
>>  1 file changed, 5 deletions(-)
>>
>> diff --git a/tests/docker/dockerfiles/debian-all-test-cross.docker b/tests/docker/dockerfiles/debian-all-test-cross.docker
>> index dedcea58b4..b185b7c15a 100644
>> --- a/tests/docker/dockerfiles/debian-all-test-cross.docker
>> +++ b/tests/docker/dockerfiles/debian-all-test-cross.docker
>> @@ -8,11 +8,6 @@
>>  #
>>  FROM qemu/debian10
>>  
>> -# What we need to build QEMU itself
>> -RUN apt update && \
>> -    DEBIAN_FRONTEND=noninteractive eatmydata \
>> -    apt build-dep -yy qemu
>> -
>>  # Add the foreign architecture we want and install dependencies
>>  RUN DEBIAN_FRONTEND=noninteractive eatmydata \
>>          apt install -y --no-install-recommends \
> 
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

IIUC if we keep --arch-only in the previous step (previous patch),
this step is required here.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/7] tests/docker: Simplify debian-all-test-cross
  2021-10-18 11:14     ` Philippe Mathieu-Daudé
@ 2021-10-18 11:33       ` Alex Bennée
  2021-11-02 12:24         ` Alex Bennée
  0 siblings, 1 reply; 16+ messages in thread
From: Alex Bennée @ 2021-10-18 11:33 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé; +Cc: Richard Henderson, qemu-devel


Philippe Mathieu-Daudé <f4bug@amsat.org> writes:

> On 10/18/21 12:54, Alex Bennée wrote:
>> 
>> Richard Henderson <richard.henderson@linaro.org> writes:
>> 
>>> The base debian10 image contains enough to build qemu;
>>> we do not need to repeat that within the new image.
>>>
>>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
>>> ---
>>>  tests/docker/dockerfiles/debian-all-test-cross.docker | 5 -----
>>>  1 file changed, 5 deletions(-)
>>>
>>> diff --git a/tests/docker/dockerfiles/debian-all-test-cross.docker b/tests/docker/dockerfiles/debian-all-test-cross.docker
>>> index dedcea58b4..b185b7c15a 100644
>>> --- a/tests/docker/dockerfiles/debian-all-test-cross.docker
>>> +++ b/tests/docker/dockerfiles/debian-all-test-cross.docker
>>> @@ -8,11 +8,6 @@
>>>  #
>>>  FROM qemu/debian10
>>>  
>>> -# What we need to build QEMU itself
>>> -RUN apt update && \
>>> -    DEBIAN_FRONTEND=noninteractive eatmydata \
>>> -    apt build-dep -yy qemu
>>> -
>>>  # Add the foreign architecture we want and install dependencies
>>>  RUN DEBIAN_FRONTEND=noninteractive eatmydata \
>>>          apt install -y --no-install-recommends \
>> 
>> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
>
> IIUC if we keep --arch-only in the previous step (previous patch),
> this step is required here.

What for? The --arch-only prevents the attempt to install cross
compilers that don't exist on a given host but we install all the cross
compilers we need for tests explicitly.

-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 0/7] tests: docker images for hexagon, nios2, microblaze
  2021-10-14 22:44 [PATCH 0/7] tests: docker images for hexagon, nios2, microblaze Richard Henderson
                   ` (6 preceding siblings ...)
  2021-10-14 22:44 ` [PATCH 7/7] tests/tcg: Enable container_cross_cc for microblaze Richard Henderson
@ 2021-10-19 14:46 ` Alex Bennée
  7 siblings, 0 replies; 16+ messages in thread
From: Alex Bennée @ 2021-10-19 14:46 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-devel


Richard Henderson <richard.henderson@linaro.org> writes:

> I've refined Brian's outline [1] into a proper patch.
> I've updated my nios2 docker toolchain build based on Alex's feedback,
> then added another toolchain build for microblaze.

Queued to testing/next, thanks.

-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/7] tests/docker: Simplify debian-all-test-cross
  2021-10-18 11:33       ` Alex Bennée
@ 2021-11-02 12:24         ` Alex Bennée
  2021-11-02 14:33           ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 16+ messages in thread
From: Alex Bennée @ 2021-11-02 12:24 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé; +Cc: Richard Henderson, qemu-devel


Alex Bennée <alex.bennee@linaro.org> writes:

> Philippe Mathieu-Daudé <f4bug@amsat.org> writes:
>
>> On 10/18/21 12:54, Alex Bennée wrote:
>>> 
>>> Richard Henderson <richard.henderson@linaro.org> writes:
>>> 
>>>> The base debian10 image contains enough to build qemu;
>>>> we do not need to repeat that within the new image.
>>>>
>>>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
>>>> ---
>>>>  tests/docker/dockerfiles/debian-all-test-cross.docker | 5 -----
>>>>  1 file changed, 5 deletions(-)
>>>>
>>>> diff --git a/tests/docker/dockerfiles/debian-all-test-cross.docker b/tests/docker/dockerfiles/debian-all-test-cross.docker
>>>> index dedcea58b4..b185b7c15a 100644
>>>> --- a/tests/docker/dockerfiles/debian-all-test-cross.docker
>>>> +++ b/tests/docker/dockerfiles/debian-all-test-cross.docker
>>>> @@ -8,11 +8,6 @@
>>>>  #
>>>>  FROM qemu/debian10
>>>>  
>>>> -# What we need to build QEMU itself
>>>> -RUN apt update && \
>>>> -    DEBIAN_FRONTEND=noninteractive eatmydata \
>>>> -    apt build-dep -yy qemu
>>>> -
>>>>  # Add the foreign architecture we want and install dependencies
>>>>  RUN DEBIAN_FRONTEND=noninteractive eatmydata \
>>>>          apt install -y --no-install-recommends \
>>> 
>>> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
>>
>> IIUC if we keep --arch-only in the previous step (previous patch),
>> this step is required here.
>
> What for? The --arch-only prevents the attempt to install cross
> compilers that don't exist on a given host but we install all the cross
> compilers we need for tests explicitly.

Well patches 1 & 2 have been a cause of hair tearing the last two days. If
we replace the previous:

 $(apt-get -s build-dep --arch-only qemu | egrep ^Inst | fgrep '[all]' | cut -d\  -f2)

which only installs (all) packages with:

  apt build-dep -yy --arch-only qemu

it breaks all the cross compiler images that are based on on debian10
because suddenly their:

  apt build-dep -yy -a $ARCH --arch-only qemu

will fail to build. However this is somewhat hidden by the fact that
most people pushing to gitlab would have that effect masked as the
images will be based on the older ones in the registry.

Of course I ran into the opposite problem trying to test things as we
aggressively used the upstream registry. As a result of the dropped the
build-dep in the all-cross but without being based on the new image we
end up without enough deps to build stuff.

In short I need to drop the first two patches.

-- 
Alex Bennée


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH 2/7] tests/docker: Simplify debian-all-test-cross
  2021-11-02 12:24         ` Alex Bennée
@ 2021-11-02 14:33           ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 16+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-11-02 14:33 UTC (permalink / raw)
  To: Alex Bennée; +Cc: Richard Henderson, qemu-devel

On 11/2/21 13:24, Alex Bennée wrote:
> Alex Bennée <alex.bennee@linaro.org> writes:
>> Philippe Mathieu-Daudé <f4bug@amsat.org> writes:
>>> On 10/18/21 12:54, Alex Bennée wrote:
>>>> Richard Henderson <richard.henderson@linaro.org> writes:
>>>>
>>>>> The base debian10 image contains enough to build qemu;
>>>>> we do not need to repeat that within the new image.
>>>>>
>>>>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
>>>>> ---
>>>>>  tests/docker/dockerfiles/debian-all-test-cross.docker | 5 -----
>>>>>  1 file changed, 5 deletions(-)
>>>>>
>>>>> diff --git a/tests/docker/dockerfiles/debian-all-test-cross.docker b/tests/docker/dockerfiles/debian-all-test-cross.docker
>>>>> index dedcea58b4..b185b7c15a 100644
>>>>> --- a/tests/docker/dockerfiles/debian-all-test-cross.docker
>>>>> +++ b/tests/docker/dockerfiles/debian-all-test-cross.docker
>>>>> @@ -8,11 +8,6 @@
>>>>>  #
>>>>>  FROM qemu/debian10
>>>>>  
>>>>> -# What we need to build QEMU itself
>>>>> -RUN apt update && \
>>>>> -    DEBIAN_FRONTEND=noninteractive eatmydata \
>>>>> -    apt build-dep -yy qemu
>>>>> -
>>>>>  # Add the foreign architecture we want and install dependencies
>>>>>  RUN DEBIAN_FRONTEND=noninteractive eatmydata \
>>>>>          apt install -y --no-install-recommends \
>>>>
>>>> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
>>>
>>> IIUC if we keep --arch-only in the previous step (previous patch),
>>> this step is required here.
>>
>> What for? The --arch-only prevents the attempt to install cross
>> compilers that don't exist on a given host but we install all the cross
>> compilers we need for tests explicitly.
> 
> Well patches 1 & 2 have been a cause of hair tearing the last two days. If
> we replace the previous:
> 
>  $(apt-get -s build-dep --arch-only qemu | egrep ^Inst | fgrep '[all]' | cut -d\  -f2)
> 
> which only installs (all) packages with:
> 
>   apt build-dep -yy --arch-only qemu
> 
> it breaks all the cross compiler images that are based on on debian10
> because suddenly their:
> 
>   apt build-dep -yy -a $ARCH --arch-only qemu
> 
> will fail to build. However this is somewhat hidden by the fact that
> most people pushing to gitlab would have that effect masked as the
> images will be based on the older ones in the registry.
> 
> Of course I ran into the opposite problem trying to test things as we
> aggressively used the upstream registry. As a result of the dropped the
> build-dep in the all-cross but without being based on the new image we
> end up without enough deps to build stuff.
> 
> In short I need to drop the first two patches.

I remember I had to do it this ugly way to simplify the
rest, and later I came back to it because Peter said it
was confusing, but I couldn't find a easier way to remove
this command.

Today I think we shouldn't bother to include intermediate
Dockerfiles. I'd simply use one plain file and let the
Docker daemon worry about caching/reusing.

But the whole machinery needs some thought since we want
to be able to use non-x86_64 hosts; and on the CI side
we want pulled images to be stable.


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2021-11-02 14:55 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-14 22:44 [PATCH 0/7] tests: docker images for hexagon, nios2, microblaze Richard Henderson
2021-10-14 22:44 ` [PATCH 1/7] tests/docker: Use apt build-dep in debian10 Richard Henderson
2021-10-18 10:53   ` Alex Bennée
2021-10-14 22:44 ` [PATCH 2/7] tests/docker: Simplify debian-all-test-cross Richard Henderson
2021-10-18 10:54   ` Alex Bennée
2021-10-18 11:14     ` Philippe Mathieu-Daudé
2021-10-18 11:33       ` Alex Bennée
2021-11-02 12:24         ` Alex Bennée
2021-11-02 14:33           ` Philippe Mathieu-Daudé
2021-10-14 22:44 ` [PATCH 3/7] tests/docker: Update debian-hexagon-cross to a newer toolchain Richard Henderson
2021-10-14 22:44 ` [PATCH 4/7] gitlab-ci: Remove special casing for hexagon testing Richard Henderson
2021-10-14 22:44 ` [PATCH 5/7] tests/docker: Add debian-nios2-cross image Richard Henderson
2021-10-14 22:44 ` [PATCH 6/7] tests/docker: Add debian-microblaze-cross image Richard Henderson
2021-10-14 22:44 ` [PATCH 7/7] tests/tcg: Enable container_cross_cc for microblaze Richard Henderson
2021-10-18 10:57   ` Alex Bennée
2021-10-19 14:46 ` [PATCH 0/7] tests: docker images for hexagon, nios2, microblaze Alex Bennée

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).