From 9334b5659c35982344f92590ff567fc396ae5efc Mon Sep 17 00:00:00 2001 From: David Heidelberg Date: Wed, 17 Sep 2025 17:00:04 +0200 Subject: [PATCH] ci: implement debian-cross-riscv64 Revival of my old effort to get riscv64 testing in! Now we're at Debian 13 (trixie), we can support RISC-V builds! Disable llvmpipe suite because of lp_test_arit failure, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/14123 Signed-off-by: David Heidelberg Part-of: --- .gitlab-ci/build/gitlab-ci.yml | 16 +++++++++++++ .gitlab-ci/container/create-cross-file.sh | 2 ++ .gitlab-ci/container/debian/gitlab-ci.yml | 24 ++++++++++++++++++++ .gitlab-ci/container/debian/riscv64_build.sh | 20 ++++++++++++++++ .gitlab-ci/image-tags.yml | 2 +- 5 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 .gitlab-ci/container/debian/riscv64_build.sh diff --git a/.gitlab-ci/build/gitlab-ci.yml b/.gitlab-ci/build/gitlab-ci.yml index 3687c8d7897..116ddb7f099 100644 --- a/.gitlab-ci/build/gitlab-ci.yml +++ b/.gitlab-ci/build/gitlab-ci.yml @@ -751,6 +751,22 @@ debian-x86_32: -D mesa-clc=enabled -D install-mesa-clc=true +# In case of issues with this job, contact @frankbinns +debian-riscv64: + extends: + - .meson-cross + - .use-debian/riscv64_build + - .meson-build-only + tags: + - $FDO_RUNNER_JOB_PRIORITY_TAG_X86_64_KVM + variables: + BUILDTYPE: debug + CROSS: riscv64 + GALLIUM_DRIVERS: "llvmpipe,zink" + VULKAN_DRIVERS: "swrast" + # See https://gitlab.freedesktop.org/mesa/mesa/-/issues/14123 + MESON_TEST_ARGS: "--no-suite mesa:llvmpipe" + # While s390 is dead, s390x is very much alive, and one of the last major # big-endian platforms, so it provides useful coverage. # In case of issues with this job, contact @ajax diff --git a/.gitlab-ci/container/create-cross-file.sh b/.gitlab-ci/container/create-cross-file.sh index acb2c3ee13a..3c55920b8c0 100755 --- a/.gitlab-ci/container/create-cross-file.sh +++ b/.gitlab-ci/container/create-cross-file.sh @@ -22,6 +22,8 @@ elif [[ "$arch" = "i386" ]]; then rust_target=i686-unknown-linux-gnu elif [[ "$arch" = "ppc64el" ]]; then rust_target=powerpc64le-unknown-linux-gnu +elif [[ "$arch" = "riscv64" ]]; then + rust_target=riscv64gc-unknown-linux-gnu elif [[ "$arch" = "s390x" ]]; then rust_target=s390x-unknown-linux-gnu else diff --git a/.gitlab-ci/container/debian/gitlab-ci.yml b/.gitlab-ci/container/debian/gitlab-ci.yml index 7333c986f36..51427c41fa0 100644 --- a/.gitlab-ci/container/debian/gitlab-ci.yml +++ b/.gitlab-ci/container/debian/gitlab-ci.yml @@ -121,6 +121,30 @@ debian/ppc64el_build: - job: debian/ppc64el_build optional: true +# Debian based RISC-V 64 cross-build image +debian/riscv64_build: + extends: + - .use-debian/x86_64_build-base + variables: + MESA_IMAGE_TAG: &debian-riscv64_build ${DEBIAN_BUILD_TAG} + LLVM_VERSION: &debian-riscv64-llvm 19 + +.use-debian/riscv64_build: + tags: + - $FDO_RUNNER_JOB_PRIORITY_TAG_X86_64 + extends: + - .set-image-base-tag + variables: + MESA_BASE_TAG: *debian-x86_64_build-base + MESA_IMAGE_PATH: "debian/riscv64_build" + MESA_IMAGE_TAG: *debian-riscv64_build + LLVM_VERSION: *debian-riscv64-llvm + needs: + - job: sanity + optional: true + - job: debian/riscv64_build + optional: true + # Debian based s390x cross-build image debian/s390x_build: extends: diff --git a/.gitlab-ci/container/debian/riscv64_build.sh b/.gitlab-ci/container/debian/riscv64_build.sh new file mode 100644 index 00000000000..fa8d23bc170 --- /dev/null +++ b/.gitlab-ci/container/debian/riscv64_build.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +set -e + +. .gitlab-ci/setup-test-env.sh + +arch=riscv64 + +# Ephemeral packages (installed for this script and removed again at the end) +EPHEMERAL=( + libssl-dev +) + +apt-get -y install "${EPHEMERAL[@]}" + +. .gitlab-ci/container/build-mold.sh + +apt-get purge -y "${EPHEMERAL[@]}" + +. .gitlab-ci/container/cross_build.sh diff --git a/.gitlab-ci/image-tags.yml b/.gitlab-ci/image-tags.yml index 9995b606566..f33801d51d2 100644 --- a/.gitlab-ci/image-tags.yml +++ b/.gitlab-ci/image-tags.yml @@ -19,7 +19,7 @@ include: - .gitlab-ci/conditional-build-image-tags.yml variables: - DEBIAN_BUILD_BASE_TAG: "20251014-testfix" + DEBIAN_BUILD_BASE_TAG: "20251016-riscv" DEBIAN_BUILD_TAG: "20250926-D3D618" DEBIAN_TEST_BASE_TAG: "20250926-gitlab"