From a85da8e3d5e430cf661f0343d00810923de2e379 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michel=20D=C3=A4nzer?= Date: Sat, 30 May 2020 15:53:41 +0200 Subject: [PATCH] gitlab-ci: Add x86_build-base docker image Similar to x86_test-base. Reviewed-by: Eric Anholt Part-of: --- .gitlab-ci.yml | 35 +++++-- .gitlab-ci/container/x86_build-base.sh | 131 ++++++++++++++++++++++++ .gitlab-ci/container/x86_build.sh | 134 +++---------------------- 3 files changed, 171 insertions(+), 129 deletions(-) create mode 100644 .gitlab-ci/container/x86_build-base.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a0a6e4c4613..cf6b386f94f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -131,30 +131,49 @@ success: # no need to pull the whole repo to build the container image GIT_STRATEGY: none -# Debian 10 based x86 build image -x86_build: +# Debian 10 based x86 build image base +x86_build-base: extends: - .fdo.container-build@debian - .container variables: - FDO_DISTRIBUTION_TAG: &x86_build "2020-05-31" + FDO_DISTRIBUTION_TAG: &x86_build-base "2020-06-01" + +.use-x86_build-base: + extends: + - x86_build-base + - .ci-run-policy + stage: container-2 + variables: + BASE_TAG: *x86_build-base + FDO_BASE_IMAGE: "$CI_REGISTRY_IMAGE/debian/x86_build-base:$BASE_TAG" + needs: + - x86_build-base + +# Debian 10 based x86 main build image +x86_build: + extends: + - .use-x86_build-base + variables: + FDO_DISTRIBUTION_TAG: &x86_build "2020-06-01" .use-x86_build: variables: TAG: *x86_build image: "$CI_REGISTRY_IMAGE/debian/x86_build:$TAG" needs: + - x86_build-base - x86_build # Debian 10 based x86 test image base x86_test-base: - extends: x86_build + extends: x86_build-base variables: FDO_DISTRIBUTION_TAG: &x86_test-base "2020-06-02" .use-x86_test-base: extends: - - x86_build + - x86_build-base - .ci-run-policy stage: container-2 variables: @@ -177,7 +196,7 @@ x86_test-vk: # Debian 9 based x86 build image (old LLVM) x86_build_old: - extends: x86_build + extends: x86_build-base variables: FDO_DISTRIBUTION_TAG: &x86_build_old "2020-06-02" FDO_DISTRIBUTION_VERSION: stretch-slim @@ -206,7 +225,7 @@ arm_build: # x86 image with ARM rootfses for baremetal testing. arm_test: - extends: x86_build + extends: x86_build-base variables: FDO_DISTRIBUTION_TAG: &arm_test "2020-06-01" @@ -621,6 +640,7 @@ meson-mingw32-x86_64: TAG: *x86_test-gl image: "$CI_REGISTRY_IMAGE/debian/x86_test-gl:$TAG" needs: + - x86_build-base - x86_build - meson-testing - x86_test-base @@ -633,6 +653,7 @@ meson-mingw32-x86_64: TAG: *x86_test-vk image: "$CI_REGISTRY_IMAGE/debian/x86_test-vk:$TAG" needs: + - x86_build-base - x86_build - meson-testing - x86_test-base diff --git a/.gitlab-ci/container/x86_build-base.sh b/.gitlab-ci/container/x86_build-base.sh new file mode 100644 index 00000000000..dd698fc74cd --- /dev/null +++ b/.gitlab-ci/container/x86_build-base.sh @@ -0,0 +1,131 @@ +#!/bin/bash + +set -e +set -o xtrace + +export DEBIAN_FRONTEND=noninteractive + +CROSS_ARCHITECTURES="i386 ppc64el s390x" +for arch in $CROSS_ARCHITECTURES; do + dpkg --add-architecture $arch +done + +apt-get install -y \ + ca-certificates \ + gnupg \ + unzip \ + wget + +# Upstream LLVM package repository +apt-key add .gitlab-ci/container/llvm-snapshot.gpg.key +echo "deb https://apt.llvm.org/buster/ llvm-toolchain-buster-9 main" >/etc/apt/sources.list.d/llvm9.list + +sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list +echo 'deb https://deb.debian.org/debian buster-backports main' >/etc/apt/sources.list.d/backports.list + +apt-get update + +apt-get install -y --no-remove \ + $STABLE_EPHEMERAL \ + bison \ + ccache \ + clang-9 \ + flex \ + g++ \ + g++-mingw-w64-x86-64 \ + gcc \ + gettext \ + libclang-9-dev \ + libclc-dev \ + libdrm-dev:s390x \ + libelf-dev \ + libepoxy-dev \ + libexpat1-dev \ + libgtk-3-dev \ + libomxil-bellagio-dev \ + libpciaccess-dev \ + libpciaccess-dev:i386 \ + libunwind-dev \ + libva-dev \ + libvdpau-dev \ + libvulkan-dev \ + libvulkan-dev:ppc64el \ + libx11-dev \ + libx11-xcb-dev \ + libxdamage-dev \ + libxext-dev \ + libxml2-utils \ + libxrandr-dev \ + libxrender-dev \ + libxshmfence-dev \ + libxvmc-dev \ + libxxf86vm-dev \ + libz-mingw-w64-dev \ + llvm-9-dev \ + pkg-config \ + python-mako \ + python3-mako \ + python3-pil \ + python3-requests \ + qemu-user \ + scons \ + wine-development \ + wine32-development \ + wine64-development \ + x11proto-dri2-dev \ + x11proto-gl-dev \ + x11proto-randr-dev \ + xz-utils \ + zlib1g-dev + +apt-get install -y --no-remove -t buster-backports \ + libclang-8-dev \ + libllvm8 \ + meson + +# Cross-build Mesa deps +for arch in $CROSS_ARCHITECTURES; do + apt-get install -y --no-remove \ + crossbuild-essential-${arch} \ + libelf-dev:${arch} \ + libexpat1-dev:${arch} \ + libffi-dev:${arch} \ + libstdc++6:${arch} \ + libtinfo-dev:${arch} + + apt-get install -y --no-remove -t buster-backports \ + libllvm8:${arch} + + mkdir /var/cache/apt/archives/${arch} + # Download llvm-* packages, but don't install them yet, since they can + # only be installed for one architecture at a time + apt-get install -o Dir::Cache::archives=/var/cache/apt/archives/$arch --download-only \ + -y --no-remove -t buster-backports \ + llvm-8-dev:${arch} +done + +apt-get install -y --no-remove -t buster-backports \ + llvm-8-dev + + +# Generate cross build files for Meson +for arch in $CROSS_ARCHITECTURES; do + . .gitlab-ci/create-cross-file.sh $arch +done + + +# for the vulkan overlay layer +wget https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-linux-Release.zip +unzip glslang-master-linux-Release.zip bin/glslangValidator +install -m755 bin/glslangValidator /usr/local/bin/ +rm bin/glslangValidator glslang-master-linux-Release.zip + + +############### Uninstall ephemeral packages + +apt-get purge -y \ + gnupg \ + unzip \ + wget + +. .gitlab-ci/container/container_post_build.sh diff --git a/.gitlab-ci/container/x86_build.sh b/.gitlab-ci/container/x86_build.sh index c6ca639af05..f286748939e 100644 --- a/.gitlab-ci/container/x86_build.sh +++ b/.gitlab-ci/container/x86_build.sh @@ -5,112 +5,24 @@ set -o xtrace export DEBIAN_FRONTEND=noninteractive -CROSS_ARCHITECTURES="i386 ppc64el s390x" -for arch in $CROSS_ARCHITECTURES; do - dpkg --add-architecture $arch -done - -apt-get install -y \ - ca-certificates \ - gnupg \ - unzip \ - wget - -# Upstream LLVM package repository -apt-key add .gitlab-ci/container/llvm-snapshot.gpg.key -echo "deb https://apt.llvm.org/buster/ llvm-toolchain-buster-9 main" >/etc/apt/sources.list.d/llvm9.list - -sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list -echo 'deb https://deb.debian.org/debian buster-backports main' >/etc/apt/sources.list.d/backports.list - -apt-get update - -apt-get install -y --no-remove \ +# Ephemeral packages (installed for this script and removed again at the end) +STABLE_EPHEMERAL=" \ autoconf \ automake \ autotools-dev \ - bison \ - ccache \ - clang-9 \ + bzip2 \ cmake \ - flex \ - g++ \ - g++-mingw-w64-x86-64 \ - gcc \ - gettext \ git \ - libclang-9-dev \ - libclc-dev \ - libdrm-dev:s390x \ - libelf-dev \ - libepoxy-dev \ - libexpat1-dev \ + gnupg \ libgbm-dev \ - libgtk-3-dev \ - libomxil-bellagio-dev \ - libpciaccess-dev \ - libpciaccess-dev:i386 \ libtool \ - libunwind-dev \ - libva-dev \ - libvdpau-dev \ - libvulkan-dev \ - libvulkan-dev:ppc64el \ - libx11-dev \ - libx11-xcb-dev \ - libxdamage-dev \ - libxext-dev \ - libxml2-utils \ - libxrandr-dev \ - libxrender-dev \ - libxshmfence-dev \ - libxvmc-dev \ - libxxf86vm-dev \ - libz-mingw-w64-dev \ - llvm-9-dev \ - pkg-config \ - python-mako \ - python3-mako \ - python3-pil \ - python3-requests \ - qemu-user \ - scons \ - wine-development \ - wine32-development \ - wine64-development \ - x11proto-dri2-dev \ - x11proto-gl-dev \ - x11proto-randr-dev \ - xz-utils \ - zlib1g-dev - -apt-get install -y --no-remove -t buster-backports \ - libclang-8-dev \ - meson - -# Cross-build Mesa deps -for arch in $CROSS_ARCHITECTURES; do - apt-get install -y --no-remove \ - crossbuild-essential-${arch} \ - libelf-dev:${arch} \ - libexpat1-dev:${arch} \ - libffi-dev:${arch} \ - libstdc++6:${arch} \ - libtinfo-dev:${arch} - - apt-get install -y --no-remove -t buster-backports \ - libllvm8:${arch} - - mkdir /var/cache/apt/archives/${arch} - # Download llvm-* packages, but don't install them yet, since they can - # only be installed for one architecture at a time - apt-get install -o Dir::Cache::archives=/var/cache/apt/archives/$arch --download-only \ - -y --no-remove -t buster-backports \ - llvm-8-dev:${arch} -done - -apt-get install -y --no-remove -t buster-backports \ - llvm-8-dev \ + make \ + unzip \ + wget \ + " + +apt-get install -y --no-remove \ + $STABLE_EPHEMERAL . .gitlab-ci/container/container_pre_build.sh @@ -127,19 +39,6 @@ EOF chmod +x /usr/local/bin/x86_64-w64-mingw32-pkg-config -# Generate cross build files for Meson -for arch in $CROSS_ARCHITECTURES; do - . .gitlab-ci/create-cross-file.sh $arch -done - - -# for the vulkan overlay layer -wget https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-linux-Release.zip -unzip glslang-master-linux-Release.zip bin/glslangValidator -install -m755 bin/glslangValidator /usr/local/bin/ -rm bin/glslangValidator glslang-master-linux-Release.zip - - # dependencies where we want a specific version export XORG_RELEASES=https://xorg.freedesktop.org/releases/individual export XCB_RELEASES=https://xcb.freedesktop.org/dist @@ -208,15 +107,6 @@ popd ############### Uninstall the build software apt-get purge -y \ - autoconf \ - automake \ - autotools-dev \ - cmake \ - git \ - gnupg \ - libgbm-dev \ - libtool \ - unzip \ - wget + $STABLE_EPHEMERAL . .gitlab-ci/container/container_post_build.sh -- 2.30.2