gitlab-ci: Add x86_build-base docker image
authorMichel Dänzer <mdaenzer@redhat.com>
Sat, 30 May 2020 13:53:41 +0000 (15:53 +0200)
committerEric Anholt <eric@anholt.net>
Tue, 2 Jun 2020 17:14:16 +0000 (10:14 -0700)
Similar to x86_test-base.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5296>

.gitlab-ci.yml
.gitlab-ci/container/x86_build-base.sh [new file with mode: 0644]
.gitlab-ci/container/x86_build.sh

index a0a6e4c461328a9a4b1a6ee47d70048b9b22bd80..cf6b386f94fbb14185ec0dce88223b6ce19f9710 100644 (file)
@@ -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 (file)
index 0000000..dd698fc
--- /dev/null
@@ -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
index c6ca639af059dd52d226b1e14853e17e4c76d965..f286748939ed8645b7cdb8d44b58d34af9ac0634 100644 (file)
@@ -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