diff --git a/.gitlab-ci/build/gitlab-ci.yml b/.gitlab-ci/build/gitlab-ci.yml index 0dd2348cba6..1c0ee459f2a 100644 --- a/.gitlab-ci/build/gitlab-ci.yml +++ b/.gitlab-ci/build/gitlab-ci.yml @@ -52,7 +52,7 @@ - .use-debian/x86_build stage: build-x86_64 variables: - LLVM_VERSION: 11 + LLVM_VERSION: 15 script: - .gitlab-ci/meson/build.sh @@ -88,7 +88,7 @@ debian-testing: -D perfetto=true -D tools=drm-shim MINIO_ARTIFACT_NAME: mesa-amd64 - LLVM_VERSION: "13" + LLVM_VERSION: 15 script: - .gitlab-ci/meson/build.sh - .gitlab-ci/prepare-artifacts.sh @@ -132,7 +132,7 @@ debian-testing-msan: - .meson-build - .ci-deqp-artifacts variables: - LLVM_VERSION: "13" + LLVM_VERSION: 15 UNWIND: "enabled" DRI_LOADERS: > -D glx=disabled @@ -189,7 +189,7 @@ debian-build-testing: -D osmesa=true -D tools=drm-shim,etnaviv,freedreno,glsl,intel,intel-ui,nir,nouveau,lima,panfrost,asahi -D b_lto=true - LLVM_VERSION: 13 + LLVM_VERSION: 15 script: | section_start lava-pytest "lava-pytest" .gitlab-ci/lava/lava-pytest.sh @@ -206,7 +206,7 @@ debian-build-testing: debian-release: extends: .meson-build variables: - LLVM_VERSION: "13" + LLVM_VERSION: 15 UNWIND: "enabled" DRI_LOADERS: > -D glx=dri @@ -485,7 +485,7 @@ debian-arm64-release: debian-clang: extends: .meson-build variables: - LLVM_VERSION: "13" + LLVM_VERSION: 15 UNWIND: "enabled" GALLIUM_DUMP_CPU: "true" C_ARGS: > @@ -518,7 +518,7 @@ debian-clang: -D gles1=enabled -D gles2=enabled -D llvm=enabled - -D microsoft-clc=enabled + -D microsoft-clc=disabled -D shared-llvm=enabled -D opencl-spirv=true GALLIUM_DRIVERS: "iris,nouveau,kmsro,r300,r600,freedreno,swrast,svga,v3d,vc4,virgl,etnaviv,panfrost,lima,zink,radeonsi,tegra,d3d12,crocus,i915,asahi" @@ -532,8 +532,8 @@ debian-clang: -D build-aco-tests=true -D intel-clc=enabled -D imagination-srv=true - CC: clang - CXX: clang++ + CC: clang-${LLVM_VERSION} + CXX: clang++-${LLVM_VERSION} debian-clang-release: extends: debian-clang @@ -559,7 +559,7 @@ windows-vs2019: .debian-cl: extends: .meson-build variables: - LLVM_VERSION: "13" + LLVM_VERSION: 15 UNWIND: "enabled" DRI_LOADERS: > -D glx=disabled @@ -600,7 +600,7 @@ debian-rusticl: debian-vulkan: extends: .meson-build variables: - LLVM_VERSION: "13" + LLVM_VERSION: 15 UNWIND: "disabled" DRI_LOADERS: > -D glx=disabled @@ -636,7 +636,7 @@ debian-i386: CROSS: i386 VULKAN_DRIVERS: intel,amd,swrast,virtio GALLIUM_DRIVERS: "iris,nouveau,r300,r600,radeonsi,swrast,virgl,zink,crocus" - LLVM_VERSION: 13 + LLVM_VERSION: 15 EXTRA_OPTION: > -D vulkan-layers=device-select,overlay @@ -650,7 +650,7 @@ debian-s390x: variables: CROSS: s390x GALLIUM_DRIVERS: "swrast,zink" - LLVM_VERSION: 13 + LLVM_VERSION: 15 VULKAN_DRIVERS: "swrast" debian-ppc64el: diff --git a/.gitlab-ci/common/init-stage1.sh b/.gitlab-ci/common/init-stage1.sh index 3b3317a2c02..7b74123ced7 100755 --- a/.gitlab-ci/common/init-stage1.sh +++ b/.gitlab-ci/common/init-stage1.sh @@ -13,6 +13,8 @@ mount -t debugfs none /sys/kernel/debug mount -t devtmpfs none /dev || echo possibly already mounted mkdir -p /dev/pts mount -t devpts devpts /dev/pts +mkdir /dev/shm +mount -t tmpfs -o noexec,nodev,nosuid tmpfs /dev/shm mount -t tmpfs tmpfs /tmp echo "nameserver 8.8.8.8" > /etc/resolv.conf diff --git a/.gitlab-ci/container/build-crosvm.sh b/.gitlab-ci/container/build-crosvm.sh index 486cb6f1e03..cfb6796eb26 100644 --- a/.gitlab-ci/container/build-crosvm.sh +++ b/.gitlab-ci/container/build-crosvm.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # shellcheck disable=SC2086 # we want word splitting set -ex @@ -17,7 +17,7 @@ rm -rf third_party/virglrenderer git clone --single-branch -b master --no-checkout https://gitlab.freedesktop.org/virgl/virglrenderer.git third_party/virglrenderer pushd third_party/virglrenderer git checkout "$VIRGLRENDERER_VERSION" -meson setup build/ -Drender-server-worker=process -Dvenus=true $EXTRA_MESON_ARGS +meson setup build/ -D libdir=lib -D render-server-worker=process -D venus=true $EXTRA_MESON_ARGS meson install -C build popd diff --git a/.gitlab-ci/container/build-libclc.sh b/.gitlab-ci/container/build-libclc.sh index a16f5019c23..9ec3e3c55bb 100644 --- a/.gitlab-ci/container/build-libclc.sh +++ b/.gitlab-ci/container/build-libclc.sh @@ -1,8 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash set -ex -export LLVM_CONFIG="llvm-config-11" +export LLVM_CONFIG="llvm-config-${LLVM_VERSION:?"llvm unset!"}" +LLVM_TAG="llvmorg-15.0.7" $LLVM_CONFIG --version @@ -11,12 +12,12 @@ git config --global user.name "Mesa CI" git clone \ https://github.com/llvm/llvm-project \ --depth 1 \ - -b llvmorg-12.0.0-rc3 \ + -b "${LLVM_TAG}" \ /llvm-project mkdir /libclc pushd /libclc -cmake -S /llvm-project/libclc -B . -G Ninja -DLLVM_CONFIG=$LLVM_CONFIG -DLIBCLC_TARGETS_TO_BUILD="spirv-mesa3d-;spirv64-mesa3d-" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DLLVM_SPIRV=/usr/bin/llvm-spirv +cmake -S /llvm-project/libclc -B . -G Ninja -DLLVM_CONFIG="$LLVM_CONFIG" -DLIBCLC_TARGETS_TO_BUILD="spirv-mesa3d-;spirv64-mesa3d-" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DLLVM_SPIRV=/usr/bin/llvm-spirv ninja ninja install popd diff --git a/.gitlab-ci/container/build-llvm-spirv.sh b/.gitlab-ci/container/build-llvm-spirv.sh index f37a54cc4f2..2742298b121 100644 --- a/.gitlab-ci/container/build-llvm-spirv.sh +++ b/.gitlab-ci/container/build-llvm-spirv.sh @@ -1,8 +1,8 @@ -#!/bin/bash +#!/usr/bin/env bash set -ex -VER="13.0.0" +VER="${LLVM_VERSION:?llvm not set}.0.0" curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \ -O "https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/v${VER}.tar.gz" diff --git a/.gitlab-ci/container/create-cross-file.sh b/.gitlab-ci/container/create-cross-file.sh index 1883e9abb98..acb2c3ee13a 100755 --- a/.gitlab-ci/container/create-cross-file.sh +++ b/.gitlab-ci/container/create-cross-file.sh @@ -47,6 +47,7 @@ if [[ -n "$GCC_ARCH" ]]; then echo "set(CMAKE_SYSTEM_PROCESSOR arm)"; echo "set(CMAKE_C_COMPILER /usr/lib/ccache/$GCC_ARCH-gcc)"; echo "set(CMAKE_CXX_COMPILER /usr/lib/ccache/$GCC_ARCH-g++)"; + echo "set(CMAKE_CXX_FLAGS_INIT \"-Wno-psabi\")"; # makes ABI warnings quiet for ARMv7 echo "set(ENV{PKG_CONFIG} \"/usr/bin/$GCC_ARCH-pkgconf\")"; echo "set(DE_CPU $DE_CPU)"; } > "$toolchain_file" diff --git a/.gitlab-ci/container/create-rootfs.sh b/.gitlab-ci/container/create-rootfs.sh deleted file mode 100644 index f2972fb975a..00000000000 --- a/.gitlab-ci/container/create-rootfs.sh +++ /dev/null @@ -1,326 +0,0 @@ -#!/bin/bash -# shellcheck disable=SC2140 # ugly array, remove later -# shellcheck disable=SC2288 # ugly array, remove later -# shellcheck disable=SC2086 # we want word splitting - -set -ex - -if [ $DEBIAN_ARCH = arm64 ]; then - ARCH_PACKAGES="firmware-qcom-media - firmware-linux-nonfree - libfontconfig1 - libgl1 - libglu1-mesa - libvulkan-dev - " -elif [ $DEBIAN_ARCH = amd64 ]; then - # Add llvm 13 to the build image - apt-get -y install --no-install-recommends curl gnupg2 software-properties-common - apt-key add /llvm-snapshot.gpg.key - add-apt-repository "deb https://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-13 main" - # Debian bullseye has older wine 5.0, we want >= 7.0 for traces. - apt-key add /winehq.gpg.key - apt-add-repository https://dl.winehq.org/wine-builds/debian/ - - - ARCH_PACKAGES="firmware-amd-graphics - inetutils-syslogd - iptables - libcap2 - libfontconfig1 - libelf1 - libfdt1 - libgl1 - libglu1-mesa - libllvm13 - libllvm11 - libva2 - libva-drm2 - libvulkan-dev - socat - spirv-tools - sysvinit-core - " - -elif [ $DEBIAN_ARCH = armhf ]; then - ARCH_PACKAGES="firmware-misc-nonfree - " -fi - -INSTALL_CI_FAIRY_PACKAGES="git - python3-dev - python3-pip - python3-setuptools - python3-wheel - " - -apt-get update -apt-get -y install --no-install-recommends \ - $ARCH_PACKAGES \ - $INSTALL_CI_FAIRY_PACKAGES \ - $EXTRA_LOCAL_PACKAGES \ - bash \ - ca-certificates \ - curl \ - dropbear \ - firmware-realtek \ - initramfs-tools \ - jq \ - libasan6 \ - libexpat1 \ - libpng16-16 \ - libpython3.9 \ - libsensors5 \ - libvulkan1 \ - libwaffle-1-0 \ - libx11-6 \ - libx11-xcb1 \ - libxcb-dri2-0 \ - libxcb-dri3-0 \ - libxcb-glx0 \ - libxcb-present0 \ - libxcb-randr0 \ - libxcb-shm0 \ - libxcb-sync1 \ - libxcb-xfixes0 \ - libxdamage1 \ - libxext6 \ - libxfixes3 \ - libxkbcommon0 \ - libxrender1 \ - libxshmfence1 \ - libxxf86vm1 \ - netcat-openbsd \ - python3 \ - python3-lxml \ - python3-mako \ - python3-numpy \ - python3-packaging \ - python3-pil \ - python3-renderdoc \ - python3-requests \ - python3-simplejson \ - python3-yaml \ - sntp \ - strace \ - waffle-utils \ - weston \ - xinit \ - xserver-xorg-core \ - xwayland \ - zstd - - -if [ "$DEBIAN_ARCH" = "amd64" ]; then - # workaround wine needing 32-bit - # https://bugs.winehq.org/show_bug.cgi?id=53393 - apt-get install -y --no-remove wine-stable-amd64 # a requirement for wine-stable - WINE_PKG="wine-stable" - WINE_PKG_DROP="wine-stable-i386" - apt download "${WINE_PKG}" - dpkg --ignore-depends="${WINE_PKG_DROP}" -i "${WINE_PKG}"*.deb - rm "${WINE_PKG}"*.deb - sed -i "/${WINE_PKG_DROP}/d" /var/lib/dpkg/status - apt-get install -y --no-remove winehq-stable # symlinks-only, depends on wine-stable -fi - -# Needed for ci-fairy, this revision is able to upload files to -# MinIO and doesn't depend on git -pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates@ffe4d1b10aab7534489f0c4bbc4c5899df17d3f2 - -# Needed for manipulation with traces yaml files. -pip3 install yq - -apt-get purge -y \ - $INSTALL_CI_FAIRY_PACKAGES - -passwd root -d -chsh -s /bin/sh - -cat > /init </etc/apt/sources.list.d/buster.list +sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list.d/* apt-get update # Ephemeral packages (installed for this script and removed again at @@ -16,8 +17,8 @@ STABLE_EPHEMERAL=" \ " apt-get -y install \ - ${EXTRA_LOCAL_PACKAGES} \ ${STABLE_EPHEMERAL} \ + apt-utils \ android-libext4-utils \ autoconf \ automake \ @@ -33,7 +34,7 @@ apt-get -y install \ git \ glslang-tools \ kmod \ - libasan6 \ + libasan8 \ libdrm-dev \ libelf-dev \ libexpat1-dev \ @@ -53,8 +54,11 @@ apt-get -y install \ libxshmfence-dev \ libxxf86vm-dev \ libwayland-dev \ - llvm-11-dev \ + libwayland-egl-backend-dev \ + llvm-${LLVM_VERSION}-dev \ ninja-build \ + meson \ + openssh-server \ pkgconf \ python3-mako \ python3-pil \ @@ -66,10 +70,7 @@ apt-get -y install \ zlib1g-dev \ zstd -pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates@ffe4d1b10aab7534489f0c4bbc4c5899df17d3f2 - -# We need at least 0.61.4 for proper Rust; 0.62 for modern meson env2mfile -pip3 install meson==0.63.3 +pip3 install --break-system-packages git+http://gitlab.freedesktop.org/freedesktop/ci-templates@ffe4d1b10aab7534489f0c4bbc4c5899df17d3f2 arch=armhf . .gitlab-ci/container/cross_build.sh @@ -78,10 +79,6 @@ arch=armhf . .gitlab-ci/container/build-mold.sh -# dependencies where we want a specific version -EXTRA_MESON_ARGS= -. .gitlab-ci/container/build-libdrm.sh - . .gitlab-ci/container/build-wayland.sh apt-get purge -y $STABLE_EPHEMERAL diff --git a/.gitlab-ci/container/debian/arm_test.sh b/.gitlab-ci/container/debian/arm_test.sh index 164562322db..f0ab7bd33fe 100644 --- a/.gitlab-ci/container/debian/arm_test.sh +++ b/.gitlab-ci/container/debian/arm_test.sh @@ -10,14 +10,15 @@ set -o xtrace ############### Install packages for baremetal testing apt-get install -y ca-certificates -sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list +sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list.d/* apt-get update apt-get install -y --no-remove \ cpio \ curl \ fastboot \ - netcat \ + netcat-openbsd \ + openssh-server \ procps \ python3-distutils \ python3-minimal \ diff --git a/.gitlab-ci/container/debian/x86_build-base-wine.sh b/.gitlab-ci/container/debian/x86_build-base-wine.sh index 3e143ac54f6..275adfeb2c4 100644 --- a/.gitlab-ci/container/debian/x86_build-base-wine.sh +++ b/.gitlab-ci/container/debian/x86_build-base-wine.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e set -o xtrace @@ -12,5 +12,4 @@ apt-get install -y --no-remove \ xvfb # Used to initialize the Wine environment to reduce build time -wine64 whoami.exe - +wine wineboot.exe --init diff --git a/.gitlab-ci/container/debian/x86_build-base.sh b/.gitlab-ci/container/debian/x86_build-base.sh index 88bcf54bcca..31b4edded10 100644 --- a/.gitlab-ci/container/debian/x86_build-base.sh +++ b/.gitlab-ci/container/debian/x86_build-base.sh @@ -5,30 +5,25 @@ set -e set -o xtrace export DEBIAN_FRONTEND=noninteractive +export LLVM_VERSION="${LLVM_VERSION:=15}" -apt-get install -y ca-certificates gnupg2 software-properties-common - -# Add llvm 13 to the build image -apt-key add .gitlab-ci/container/debian/llvm-snapshot.gpg.key -add-apt-repository "deb https://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-13 main" - -sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list +apt-get install -y ca-certificates +sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list.d/* # Ephemeral packages (installed for this script and removed again at # the end) STABLE_EPHEMERAL=" \ - python3-pip \ - python3-setuptools \ " apt-get update apt-get install -y --no-remove \ $STABLE_EPHEMERAL \ + apt-utils \ bison \ ccache \ - curl \ - clang-format-13 \ + curl \ + clang-format-${LLVM_VERSION} \ dpkg-cross \ findutils \ flex \ @@ -38,14 +33,14 @@ apt-get install -y --no-remove \ git \ glslang-tools \ kmod \ - libclang-13-dev \ - libclang-11-dev \ + libclang-${LLVM_VERSION}-dev \ + libclang-cpp${LLVM_VERSION}-dev \ + libclang-common-${LLVM_VERSION}-dev \ libelf-dev \ libepoxy-dev \ libexpat1-dev \ libgtk-3-dev \ - libllvm13 \ - libllvm11 \ + libllvm${LLVM_VERSION} \ libomxil-bellagio-dev \ libpciaccess-dev \ libunwind-dev \ @@ -60,13 +55,18 @@ apt-get install -y --no-remove \ libxrender-dev \ libxshmfence-dev \ libxxf86vm-dev \ + libwayland-egl-backend-dev \ make \ + meson \ ninja-build \ + openssh-server \ pkgconf \ python3-mako \ python3-pil \ + python3-pip \ python3-ply \ python3-requests \ + python3-setuptools \ qemu-user \ valgrind \ x11proto-dri2-dev \ @@ -74,13 +74,10 @@ apt-get install -y --no-remove \ x11proto-randr-dev \ xz-utils \ zlib1g-dev \ - zstd + zstd -# Needed for ci-fairy, this revision is able to upload files to MinIO -pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates@ffe4d1b10aab7534489f0c4bbc4c5899df17d3f2 - -# We need at least 1.0.0 for proper Rust; 0.62 for modern meson env2mfile -pip3 install meson==1.0.0 +# Needed for ci-fairy, this revision is able to upload files to S3 +pip3 install --break-system-packages git+http://gitlab.freedesktop.org/freedesktop/ci-templates@ffe4d1b10aab7534489f0c4bbc4c5899df17d3f2 . .gitlab-ci/container/build-rust.sh diff --git a/.gitlab-ci/container/debian/x86_build-mingw-source-deps.sh b/.gitlab-ci/container/debian/x86_build-mingw-source-deps.sh index 0637b01d1a6..a6170795518 100644 --- a/.gitlab-ci/container/debian/x86_build-mingw-source-deps.sh +++ b/.gitlab-ci/container/debian/x86_build-mingw-source-deps.sh @@ -64,10 +64,10 @@ ninja install popd # Building LLVM -git clone -b release/14.x --depth=1 \ +git clone -b release/15.x --depth=1 \ https://github.com/llvm/llvm-project llvm-project -git clone -b v14.0.0 --depth=1 \ +git clone -b v15.0.0 --depth=1 \ https://github.com/KhronosGroup/SPIRV-LLVM-Translator llvm-project/llvm/projects/SPIRV-LLVM-Translator mkdir llvm-project/build diff --git a/.gitlab-ci/container/debian/x86_build-mingw.sh b/.gitlab-ci/container/debian/x86_build-mingw.sh index 34630e45a46..149b3e2504b 100644 --- a/.gitlab-ci/container/debian/x86_build-mingw.sh +++ b/.gitlab-ci/container/debian/x86_build-mingw.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e set -o xtrace diff --git a/.gitlab-ci/container/debian/x86_build.sh b/.gitlab-ci/container/debian/x86_build.sh index 932b6a4ea5b..4e7d0bb74a7 100644 --- a/.gitlab-ci/container/debian/x86_build.sh +++ b/.gitlab-ci/container/debian/x86_build.sh @@ -1,10 +1,11 @@ -#!/bin/bash +#!/usr/bin/env bash # shellcheck disable=SC2086 # we want word splitting set -e set -o xtrace export DEBIAN_FRONTEND=noninteractive +export LLVM_VERSION="${LLVM_VERSION:=15}" # Ephemeral packages (installed for this script and removed again at the end) STABLE_EPHEMERAL=" \ @@ -21,11 +22,11 @@ apt-get update apt-get install -y --no-remove \ $STABLE_EPHEMERAL \ check \ - clang \ - libasan6 \ + clang-${LLVM_VERSION} \ + libasan8 \ libarchive-dev \ - libclang-cpp13-dev \ - libclang-cpp11-dev \ + libdrm-dev \ + libclang-cpp${LLVM_VERSION}-dev \ libgbm-dev \ libglvnd-dev \ liblua5.3-dev \ @@ -39,8 +40,7 @@ apt-get install -y --no-remove \ libxcb-xfixes0-dev \ libxcb1-dev \ libxml2-dev \ - llvm-13-dev \ - llvm-11-dev \ + llvm-${LLVM_VERSION}-dev \ ocl-icd-opencl-dev \ python3-pip \ python3-venv \ @@ -72,8 +72,6 @@ rm -rf $XORGMACROS_VERSION . .gitlab-ci/container/build-libclc.sh -. .gitlab-ci/container/build-libdrm.sh - . .gitlab-ci/container/build-wayland.sh pushd /usr/local @@ -90,7 +88,7 @@ meson install -C build popd rm -rf DirectX-Headers -python3 -m pip install -r .gitlab-ci/lava/requirements.txt +python3 -m pip install --break-system-packages -r .gitlab-ci/lava/requirements.txt # install bindgen RUSTFLAGS='-L native=/usr/local/lib' cargo install \ diff --git a/.gitlab-ci/container/debian/x86_test-base.sh b/.gitlab-ci/container/debian/x86_test-base.sh index fb692c2a67e..533be651cd7 100644 --- a/.gitlab-ci/container/debian/x86_test-base.sh +++ b/.gitlab-ci/container/debian/x86_test-base.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # shellcheck disable=SC2086 # we want word splitting set -e @@ -8,7 +8,9 @@ export DEBIAN_FRONTEND=noninteractive apt-get install -y ca-certificates gnupg2 software-properties-common -sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list +sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list.d/* + +export LLVM_VERSION="${LLVM_VERSION:=15}" # Ephemeral packages (installed for this script and removed again at # the end) @@ -20,13 +22,14 @@ STABLE_EPHEMERAL=" \ bzip2 \ ccache \ cmake \ - clang-11 \ + clang-${LLVM_VERSION} \ flex \ glslang-tools \ g++ \ libasound2-dev \ libcap-dev \ - libclang-cpp11-dev \ + libclang-cpp${LLVM_VERSION}-dev \ + libdrm-dev \ libegl-dev \ libelf-dev \ libepoxy-dev \ @@ -36,10 +39,10 @@ STABLE_EPHEMERAL=" \ libwayland-dev \ libx11-xcb-dev \ libxext-dev \ - llvm-13-dev \ - llvm-11-dev \ + llvm-${LLVM_VERSION}-dev \ make \ meson \ + openssh-server \ patch \ pkgconf \ protobuf-compiler \ @@ -52,30 +55,27 @@ STABLE_EPHEMERAL=" \ xz-utils \ " -# Add llvm 13 to the build image -apt-key add .gitlab-ci/container/debian/llvm-snapshot.gpg.key -add-apt-repository "deb https://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-13 main" - apt-get update apt-get dist-upgrade -y -apt-get install -y \ - sysvinit-core +apt-get install --purge -y \ + sysvinit-core libelogind0 apt-get install -y --no-remove \ + apt-utils \ curl \ git \ git-lfs \ inetutils-syslogd \ iptables \ jq \ - libasan6 \ + libasan8 \ + libdrm2 \ libexpat1 \ - libllvm13 \ - libllvm11 \ + libllvm${LLVM_VERSION} \ liblz4-1 \ libpng16-16 \ - libpython3.9 \ + libpython3.11 \ libvulkan1 \ libwayland-client0 \ libwayland-server0 \ @@ -118,13 +118,10 @@ mkdir -p /lava-files/ # Needed for ci-fairy, this revision is able to upload files to MinIO # and doesn't depend on git -pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates@ffe4d1b10aab7534489f0c4bbc4c5899df17d3f2 +pip3 install --break-system-packages git+http://gitlab.freedesktop.org/freedesktop/ci-templates@ffe4d1b10aab7534489f0c4bbc4c5899df17d3f2 # Needed for manipulation with traces yaml files. -pip3 install yq - -# Needed for crosvm compilation. -update-alternatives --install /usr/bin/clang clang /usr/bin/clang-11 100 +pip3 install --break-system-packages yq ############### Build LLVM-SPIRV translator @@ -134,10 +131,6 @@ update-alternatives --install /usr/bin/clang clang /usr/bin/clang-11 100 . .gitlab-ci/container/build-libclc.sh -############### Build libdrm - -. .gitlab-ci/container/build-libdrm.sh - ############### Build Wayland . .gitlab-ci/container/build-wayland.sh diff --git a/.gitlab-ci/container/debian/x86_test-gl.sh b/.gitlab-ci/container/debian/x86_test-gl.sh index 91c9b361f66..02292392a63 100644 --- a/.gitlab-ci/container/debian/x86_test-gl.sh +++ b/.gitlab-ci/container/debian/x86_test-gl.sh @@ -5,20 +5,20 @@ set -e set -o xtrace export DEBIAN_FRONTEND=noninteractive +export LLVM_VERSION="${LLVM_VERSION:=15}" # Ephemeral packages (installed for this script and removed again at the end) STABLE_EPHEMERAL=" \ bzip2 \ ccache \ - clang-13 \ - clang-11 \ + clang-${LLVM_VERSION} \ cmake \ g++ \ glslang-tools \ libasound2-dev \ libcap-dev \ - libclang-cpp13-dev \ - libclang-cpp11-dev \ + libclang-cpp${LLVM_VERSION}-dev \ + libdrm-dev \ libgles2-mesa-dev \ libpciaccess-dev \ libpng-dev \ @@ -31,8 +31,7 @@ STABLE_EPHEMERAL=" \ libxkbcommon-dev \ libxrandr-dev \ libxrender-dev \ - llvm-13-dev \ - llvm-11-dev \ + llvm-${LLVM_VERSION}-dev \ make \ meson \ ocl-icd-opencl-dev \ @@ -48,10 +47,8 @@ apt-get install -y --no-remove \ $STABLE_EPHEMERAL \ clinfo \ iptables \ - libclang-common-13-dev \ - libclang-common-11-dev \ - libclang-cpp13 \ - libclang-cpp11 \ + libclang-common-${LLVM_VERSION}-dev \ + libclang-cpp${LLVM_VERSION} \ libcap2 \ libegl1 \ libepoxy0 \ @@ -91,6 +88,3 @@ apt-get purge -y \ $STABLE_EPHEMERAL apt-get autoremove -y --purge - -# hack to remove Debian libdrm (until bookworm), deqp sometimes load old libdrm, we could remove here eventually Mesa too; execute on both GL and VK container -dpkg -r --force-depends "libdrm2" "libdrm-radeon1" "libdrm-nouveau2" "libdrm-intel1" "libdrm-amdgpu1" "libdrm-common" # "mesa-vulkan-drivers" "mesa-vdpau-drivers" "mesa-va-drivers" "libgl1-mesa-dri" "libglx-mesa0" "vdpau-driver-all" "va-driver-all" "libglx0" "libgl1" "libvdpau-va-gl1" "libglu1-mesa" "libegl-mesa0" "libgl1-mesa-dri" "libglapi-mesa" "libosmesa6" diff --git a/.gitlab-ci/container/debian/x86_test-vk.sh b/.gitlab-ci/container/debian/x86_test-vk.sh index f591a659692..0d8d9272cc6 100644 --- a/.gitlab-ci/container/debian/x86_test-vk.sh +++ b/.gitlab-ci/container/debian/x86_test-vk.sh @@ -18,6 +18,7 @@ STABLE_EPHEMERAL=" \ glslang-tools \ libexpat1-dev \ gnupg2 \ + libdrm-dev \ libgbm-dev \ libgles2-mesa-dev \ liblz4-dev \ @@ -45,6 +46,8 @@ STABLE_EPHEMERAL=" \ python3-setuptools \ python3-wheel \ software-properties-common \ + wine \ + wine64 \ wine64-tools \ xz-utils \ " @@ -61,22 +64,8 @@ apt-get install -y --no-remove --no-install-recommends \ xserver-xorg-video-amdgpu \ xserver-xorg-video-ati -# Install a more recent version of Wine than exists in Debian. -apt-key add .gitlab-ci/container/debian/winehq.gpg.key -apt-add-repository https://dl.winehq.org/wine-builds/debian/ apt-get update -q -# workaround wine needing 32-bit -# https://bugs.winehq.org/show_bug.cgi?id=53393 -apt-get install -y --no-remove wine-stable-amd64 # a requirement for wine-stable -WINE_PKG="wine-stable" -WINE_PKG_DROP="wine-stable-i386" -apt-get download "${WINE_PKG}" -dpkg --ignore-depends="${WINE_PKG_DROP}" -i "${WINE_PKG}"*.deb -rm "${WINE_PKG}"*.deb -sed -i "/${WINE_PKG_DROP}/d" /var/lib/dpkg/status -apt-get install -y --no-remove winehq-stable # symlinks-only, depends on wine-stable - ############### Install DXVK . .gitlab-ci/container/setup-wine.sh "/dxvk-wine64" @@ -86,7 +75,7 @@ apt-get install -y --no-remove winehq-stable # symlinks-only, depends on wine-s . .gitlab-ci/container/install-wine-apitrace.sh # Add the apitrace path to the registry -wine64 \ +wine \ reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment" \ /v Path \ /t REG_EXPAND_SZ \ @@ -136,5 +125,4 @@ apt-get purge -y \ apt-get autoremove -y --purge -# hack to remove Debian libdrm (until bookworm), deqp sometimes load old libdrm, we could remove here eventually Mesa too; execute on both GL and VK container -dpkg -r --force-depends "libdrm2" "libdrm-radeon1" "libdrm-nouveau2" "libdrm-intel1" "libdrm-amdgpu1" "libdrm-common" # "mesa-vulkan-drivers" "mesa-vdpau-drivers" "mesa-va-drivers" "libgl1-mesa-dri" "libglx-mesa0" "vdpau-driver-all" "va-driver-all" "libglx0" "libgl1" "libvdpau-va-gl1" "libglu1-mesa" "libegl-mesa0" "libgl1-mesa-dri" "libglapi-mesa" "libosmesa6" +#dpkg -r --force-depends "mesa-vulkan-drivers" "mesa-vdpau-drivers" "mesa-va-drivers" "libgl1-mesa-dri" "libglx-mesa0" "vdpau-driver-all" "va-driver-all" "libglx0" "libgl1" "libvdpau-va-gl1" "libglu1-mesa" "libegl-mesa0" "libgl1-mesa-dri" "libglapi-mesa" "libosmesa6" diff --git a/.gitlab-ci/container/gitlab-ci.yml b/.gitlab-ci/container/gitlab-ci.yml index 0ccfa81c628..0f9367ec4c5 100644 --- a/.gitlab-ci/container/gitlab-ci.yml +++ b/.gitlab-ci/container/gitlab-ci.yml @@ -51,7 +51,7 @@ - .incorporate-templates-commit - .use-wine variables: - FDO_DISTRIBUTION_VERSION: bullseye-slim + FDO_DISTRIBUTION_VERSION: bookworm-slim FDO_REPO_SUFFIX: $CI_JOB_NAME FDO_DISTRIBUTION_EXEC: 'bash .gitlab-ci/container/${CI_JOB_NAME}.sh' # no need to pull the whole repo to build the container image @@ -64,7 +64,7 @@ # Don't want the .container rules - .build-rules -# Debian 11 based x86 build image base +# Debian based x86 build image base debian/x86_build-base: extends: - .fdo.container-build@debian @@ -83,7 +83,7 @@ debian/x86_build-base: needs: - debian/x86_build-base -# Debian 11 based x86 main build image +# Debian based x86 main build image debian/x86_build: extends: - .use-debian/x86_build-base @@ -100,7 +100,7 @@ debian/x86_build: needs: - debian/x86_build -# Debian 11 based i386 cross-build image +# Debian based i386 cross-build image debian/i386_build: extends: - .use-debian/x86_build-base @@ -117,7 +117,7 @@ debian/i386_build: needs: - debian/i386_build -# Debian 11 based x86-mingw cross main build image +# Debian based x86-mingw cross main build image debian/x86_build-mingw: extends: - .use-debian/x86_build-base @@ -134,7 +134,7 @@ debian/x86_build-mingw: needs: - debian/x86_build-mingw -# Debian 11 based ppc64el cross-build image +# Debian based ppc64el cross-build image debian/ppc64el_build: extends: - .use-debian/x86_build-base @@ -151,7 +151,7 @@ debian/ppc64el_build: needs: - debian/ppc64el_build -# Debian 11 based s390x cross-build image +# Debian based s390x cross-build image debian/s390x_build: extends: - .use-debian/x86_build-base @@ -187,7 +187,7 @@ debian/android_build: needs: - debian/android_build -# Debian 11 based x86 test image base +# Debian based x86 test image base debian/x86_test-base: extends: debian/x86_build-base variables: @@ -204,7 +204,7 @@ debian/x86_test-base: needs: - debian/x86_test-base -# Debian 11 based x86 test image for GL +# Debian based x86 test image for GL debian/x86_test-gl: extends: .use-debian/x86_test-base variables: @@ -220,7 +220,7 @@ debian/x86_test-gl: needs: - debian/x86_test-gl -# Debian 11 based x86 test image for VK +# Debian based x86 test image for VK debian/x86_test-vk: extends: .use-debian/x86_test-base variables: @@ -236,7 +236,7 @@ debian/x86_test-vk: needs: - debian/x86_test-vk -# Debian 11 based x86 test image for Android +# Debian based x86 test image for Android debian/x86_test-android: extends: .use-debian/x86_test-base variables: @@ -253,7 +253,7 @@ debian/x86_test-android: needs: - debian/x86_test-android -# Debian 11 based ARM build image +# Debian based ARM build image debian/arm_build: extends: - .fdo.container-build@debian diff --git a/.gitlab-ci/container/install-wine-dxvk.sh b/.gitlab-ci/container/install-wine-dxvk.sh index 9bc53e8fc3d..9448a9b7934 100755 --- a/.gitlab-ci/container/install-wine-dxvk.sh +++ b/.gitlab-ci/container/install-wine-dxvk.sh @@ -3,7 +3,7 @@ set -e overrideDll() { - if ! wine64 reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v "$1" /d native /f; then + if ! wine reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v "$1" /d native /f; then echo -e "Failed to add override for $1" exit 1 fi diff --git a/.gitlab-ci/container/lava_build.sh b/.gitlab-ci/container/lava_build.sh index ce684c1d24b..00086a0bd59 100755 --- a/.gitlab-ci/container/lava_build.sh +++ b/.gitlab-ci/container/lava_build.sh @@ -10,6 +10,7 @@ set -e set -o xtrace export DEBIAN_FRONTEND=noninteractive +export LLVM_VERSION="${LLVM_VERSION:=15}" check_minio() { @@ -94,10 +95,10 @@ apt-get install -y --no-remove \ ${ARCH_PACKAGES} \ automake \ bc \ - clang \ + clang-${LLVM_VERSION} \ cmake \ curl \ - debootstrap \ + mmdebstrap \ git \ glslang-tools \ libdrm-dev \ @@ -120,6 +121,7 @@ apt-get install -y --no-remove \ libxkbcommon-dev \ libwayland-dev \ ninja-build \ + openssh-server \ patch \ protobuf-compiler \ python-is-python3 \ @@ -147,7 +149,68 @@ if [[ "$DEBIAN_ARCH" = "armhf" ]]; then fi ROOTFS=/lava-files/rootfs-${DEBIAN_ARCH} -mkdir -p $ROOTFS +mkdir -p "$ROOTFS" + +# rootfs packages +PKG_BASE=( + tzdata mount +) +PKG_CI=( + firmware-realtek + bash ca-certificates curl + initramfs-tools jq netcat-openbsd dropbear openssh-server + libasan8 + git + python3-dev python3-pip python3-setuptools python3-wheel + weston # Wayland + xinit xserver-xorg-core xwayland # X11 +) +PKG_MESA_DEP=( + libdrm2 libsensors5 libexpat1 # common + libvulkan1 # vulkan + libx11-6 libx11-xcb1 libxcb-dri2-0 libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-randr0 libxcb-shm0 libxcb-sync1 libxcb-xfixes0 libxdamage1 libxext6 libxfixes3 libxkbcommon0 libxrender1 libxshmfence1 libxxf86vm1 # X11 +) +PKG_DEP=( + libpng16-16 + libwaffle-1-0 + libpython3.11 python3 python3-lxml python3-mako python3-numpy python3-packaging python3-pil python3-renderdoc python3-requests python3-simplejson python3-yaml # Python + sntp + strace + waffle-utils + zstd +) +# arch dependent rootfs packages +[ "$DEBIAN_ARCH" = "arm64" ] && PKG_ARCH=( + libgl1 libglu1-mesa + libvulkan-dev + firmware-linux-nonfree firmware-qcom-media + libfontconfig1 +) +[ "$DEBIAN_ARCH" = "amd64" ] && PKG_ARCH=( + firmware-amd-graphics + libgl1 libglu1-mesa + inetutils-syslogd iptables libcap2 + libfontconfig1 + spirv-tools + libelf1 libfdt1 "libllvm${LLVM_VERSION}" + libva2 libva-drm2 + libvulkan-dev + socat + sysvinit-core + wine +) +[ "$DEBIAN_ARCH" = "armhf" ] && PKG_ARCH=( + firmware-misc-nonfree +) + +mmdebstrap \ + --variant=apt \ + --arch="${DEBIAN_ARCH}" \ + --components main,contrib,non-free-firmware \ + --include "${PKG_BASE[*]} ${PKG_CI[*]} ${PKG_DEP[*]} ${PKG_MESA_DEP[*]} ${PKG_ARCH[*]}" \ + bookworm \ + "$ROOTFS/" \ + "http://deb.debian.org/debian" ############### Setuping if [ "$DEBIAN_ARCH" = "amd64" ]; then @@ -214,16 +277,11 @@ fi if [[ ${DEBIAN_ARCH} = "amd64" ]]; then . .gitlab-ci/container/build-crosvm.sh mv /usr/local/bin/crosvm $ROOTFS/usr/bin/ - mv /usr/local/lib/$GCC_ARCH/libvirglrenderer.* $ROOTFS/usr/lib/$GCC_ARCH/ + mv /usr/local/lib/libvirglrenderer.* $ROOTFS/usr/lib/$GCC_ARCH/ mkdir -p $ROOTFS/usr/local/libexec/ mv /usr/local/libexec/virgl* $ROOTFS/usr/local/libexec/ fi -############### Build libdrm -EXTRA_MESON_ARGS+=" -D prefix=/libdrm" -. .gitlab-ci/container/build-libdrm.sh - - ############### Build local stuff for use by igt and kernel testing, which ############### will reuse most of our container build process from a specific ############### hash of the Mesa tree. @@ -239,59 +297,25 @@ fi rm -rf /root/.cargo rm -rf /root/.rustup -############### Create rootfs -set +e -if ! debootstrap \ - --variant=minbase \ - --arch=${DEBIAN_ARCH} \ - --components main,contrib,non-free \ - bullseye \ - $ROOTFS/ \ - http://deb.debian.org/debian; then - cat $ROOTFS/debootstrap/debootstrap.log - exit 1 -fi -set -e - -cp .gitlab-ci/container/create-rootfs.sh $ROOTFS/. +############### Fill rootfs +cp .gitlab-ci/container/setup-rootfs.sh $ROOTFS/. +cp .gitlab-ci/container/strip-rootfs.sh $ROOTFS/. cp .gitlab-ci/container/debian/llvm-snapshot.gpg.key $ROOTFS/. cp .gitlab-ci/container/debian/winehq.gpg.key $ROOTFS/. -chroot $ROOTFS sh /create-rootfs.sh +chroot $ROOTFS bash /setup-rootfs.sh rm $ROOTFS/{llvm-snapshot,winehq}.gpg.key -rm $ROOTFS/create-rootfs.sh +rm "$ROOTFS/setup-rootfs.sh" +rm "$ROOTFS/strip-rootfs.sh" cp /etc/wgetrc $ROOTFS/etc/. -############### Inject missing firmwares from Debian 11 -if [[ "$DEBIAN_ARCH" == "arm64" ]]; then - # This A660 firmware is included from Debian 12 (bookworm) up - mkdir -p /lava-files/rootfs-arm64/lib/firmware/qcom/sm8350/ # for firmware imported later - curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \ - "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/qcom/a660_gmu.bin?id=8451c2b1d529dc1a49328ac9235d3cf5bb8a8fcb" \ - -o /lava-files/rootfs-arm64/lib/firmware/qcom/a660_gmu.bin - curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \ - "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/qcom/a660_sqe.fw?id=8451c2b1d529dc1a49328ac9235d3cf5bb8a8fcb" \ - -o /lava-files/rootfs-arm64/lib/firmware/qcom/a660_sqe.fw -fi - - -############### Install the built libdrm -# Dependencies pulled during the creation of the rootfs may overwrite -# the built libdrm. Hence, we add it after the rootfs has been already -# created. -find /libdrm/ -name lib\*\.so\* \ - -exec cp -t $ROOTFS/usr/lib/$GCC_ARCH/. {} \; -mkdir -p $ROOTFS/libdrm/ -cp -Rp /libdrm/share $ROOTFS/libdrm/share -rm -rf /libdrm - - -if [ ${DEBIAN_ARCH} = arm64 ]; then +if [ "${DEBIAN_ARCH}" = "arm64" ]; then + mkdir -p /lava-files/rootfs-arm64/lib/firmware/qcom/sm8350/ # for firmware imported later # Make a gzipped copy of the Image for db410c. gzip -k /lava-files/Image KERNEL_IMAGE_NAME+=" Image.gz" fi -du -ah $ROOTFS | sort -h | tail -100 +du -ah "$ROOTFS" | sort -h | tail -100 pushd $ROOTFS tar --zstd -cf /lava-files/lava-rootfs.tar.zst . popd diff --git a/.gitlab-ci/container/setup-rootfs.sh b/.gitlab-ci/container/setup-rootfs.sh new file mode 100644 index 00000000000..596f50c467b --- /dev/null +++ b/.gitlab-ci/container/setup-rootfs.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# shellcheck disable=SC1091 # The relative paths in this file only become valid at runtime. +# When changing this file, you need to bump the following +# .gitlab-ci/image-tags.yml tags: +# KERNEL_ROOTFS_TAG +set -ex + +export DEBIAN_FRONTEND=noninteractive + +# Needed for ci-fairy, this revision is able to upload files to +# MinIO and doesn't depend on git +pip3 install --break-system-packages git+http://gitlab.freedesktop.org/freedesktop/ci-templates@ffe4d1b10aab7534489f0c4bbc4c5899df17d3f2 + +# Needed for manipulation with traces yaml files. +pip3 install --break-system-packages yq + +passwd root -d +chsh -s /bin/sh + +cat > /init <