From ef136c6a891ec10cd4a55bff3cfafe6e4e8be007 Mon Sep 17 00:00:00 2001 From: Adrian Reber Date: Thu, 9 Jul 2026 08:39:22 +0000 Subject: [PATCH] ci: annotate cross-compilation dependency failures When cross-compile dependency packages cannot be installed, emit a ::error:: annotation so that the failure reason is visible in the GitHub Actions summary. Use \r to ensure the annotation is recognized even inside Docker BuildKit output which prefixes each line with step and timing information. Assisted-by: Claude Code (claude-opus-4-6) Signed-off-by: Adrian Reber --- .github/workflows/ci.yml | 1 + contrib/dependencies/apt-cross-packages.sh | 13 +++++++++++-- scripts/build/Dockerfile.stable-cross.tmpl | 3 +++ scripts/build/Dockerfile.unstable-cross.tmpl | 3 +++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 593885715..4b1f50b5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -163,6 +163,7 @@ jobs: - name: Run Cross Compilation Targets run: > sudo make -C scripts/ci ${{ matrix.target }} + BUILD_OPTIONS="--build-arg CI_CROSS_COMPILE=1" docker-test: needs: [alpine-test] diff --git a/contrib/dependencies/apt-cross-packages.sh b/contrib/dependencies/apt-cross-packages.sh index e7a31f219..11528a2c1 100755 --- a/contrib/dependencies/apt-cross-packages.sh +++ b/contrib/dependencies/apt-cross-packages.sh @@ -6,7 +6,7 @@ if [ ! -x "$APT_INSTALL" ]; then exit 1 fi -"$APT_INSTALL" \ +if ! "$APT_INSTALL" \ crossbuild-essential-"${DEBIAN_ARCH}" \ iproute2:"${DEBIAN_ARCH}" \ libaio-dev:"${DEBIAN_ARCH}" \ @@ -34,4 +34,13 @@ fi git \ protobuf-c-compiler \ protobuf-compiler \ - python3-protobuf + python3-protobuf; then + if [ -n "$CI_CROSS_COMPILE" ]; then + # Use \r to move cursor to the start of the line so that + # ::error:: is recognized by GitHub Actions even when + # running inside a Docker build where BuildKit prefixes + # each line with step and timing information. + printf '\r::error::Cross-compile dependency installation failed for %s\n' "${DEBIAN_ARCH}" + fi + exit 1 +fi diff --git a/scripts/build/Dockerfile.stable-cross.tmpl b/scripts/build/Dockerfile.stable-cross.tmpl index 429b077b8..8224ceb24 100644 --- a/scripts/build/Dockerfile.stable-cross.tmpl +++ b/scripts/build/Dockerfile.stable-cross.tmpl @@ -15,6 +15,9 @@ ENV CROSS_COMPILE=${CROSS_TRIPLET}- \ ENV PATH="${PATH}:${CROSS_ROOT}/bin" \ PKG_CONFIG_PATH=/usr/lib/${CROSS_TRIPLET}/pkgconfig +ARG CI_CROSS_COMPILE +ENV CI_CROSS_COMPILE=${CI_CROSS_COMPILE} + COPY contrib/dependencies/apt-cross-packages.sh /criu/contrib/dependencies/apt-cross-packages.sh COPY contrib/apt-install /criu/contrib/apt-install WORKDIR /criu diff --git a/scripts/build/Dockerfile.unstable-cross.tmpl b/scripts/build/Dockerfile.unstable-cross.tmpl index 4aa009f22..db61e15a7 100644 --- a/scripts/build/Dockerfile.unstable-cross.tmpl +++ b/scripts/build/Dockerfile.unstable-cross.tmpl @@ -15,6 +15,9 @@ ENV CROSS_COMPILE=${CROSS_TRIPLET}- \ ENV PATH="${PATH}:${CROSS_ROOT}/bin" \ PKG_CONFIG_PATH=/usr/lib/${CROSS_TRIPLET}/pkgconfig +ARG CI_CROSS_COMPILE +ENV CI_CROSS_COMPILE=${CI_CROSS_COMPILE} + COPY contrib/dependencies/apt-cross-packages.sh /criu/contrib/dependencies/apt-cross-packages.sh COPY contrib/apt-install /criu/contrib/apt-install WORKDIR /criu