summaryrefslogtreecommitdiff
path: root/.gitlab-ci/container
diff options
context:
space:
mode:
authorMichel Dänzer <mdaenzer@redhat.com>2020-06-01 19:08:30 +0200
committerEric Anholt <eric@anholt.net>2020-06-02 10:14:16 -0700
commit3acd5a68a4fb324908674a73d1bf9ccec98da316 (patch)
tree30a0549464e17d226d2905f421e1468b325c77da /.gitlab-ci/container
parenta85da8e3d5e430cf661f0343d00810923de2e379 (diff)
downloadmesa-3acd5a68a4fb324908674a73d1bf9ccec98da316.tar.gz
gitlab-ci: Use separate docker images for cross builds
Using x86_build-base as a separate base layer as well for storage & network bandwidth efficiency. Using separate images allows dropping the workarounds from the cross build job scripts. Reviewed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5296>
Diffstat (limited to '.gitlab-ci/container')
-rw-r--r--.gitlab-ci/container/cross_build.sh50
-rw-r--r--.gitlab-ci/container/i386_build.sh5
-rw-r--r--.gitlab-ci/container/ppc64el_build.sh8
-rw-r--r--.gitlab-ci/container/s390x_build.sh5
-rw-r--r--.gitlab-ci/container/x86_build-base.sh41
-rw-r--r--.gitlab-ci/container/x86_build.sh13
6 files changed, 79 insertions, 43 deletions
diff --git a/.gitlab-ci/container/cross_build.sh b/.gitlab-ci/container/cross_build.sh
new file mode 100644
index 00000000000..58f449f7cf5
--- /dev/null
+++ b/.gitlab-ci/container/cross_build.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+set -e
+set -o xtrace
+
+export DEBIAN_FRONTEND=noninteractive
+
+# Ephemeral packages (installed for this script and removed again at the end)
+STABLE_EPHEMERAL=" \
+ libpciaccess-dev:$arch \
+ wget \
+ "
+
+dpkg --add-architecture $arch
+apt-get update
+
+apt-get install -y --no-remove \
+ $STABLE_EPHEMERAL \
+ 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 \
+ llvm-8-dev:$arch
+
+. .gitlab-ci/create-cross-file.sh $arch
+
+
+. .gitlab-ci/container/container_pre_build.sh
+
+
+# dependencies where we want a specific version
+export LIBDRM_VERSION=libdrm-2.4.100
+
+wget https://dri.freedesktop.org/libdrm/$LIBDRM_VERSION.tar.bz2
+tar -xvf $LIBDRM_VERSION.tar.bz2 && rm $LIBDRM_VERSION.tar.bz2
+cd $LIBDRM_VERSION
+meson --cross-file=/cross_file-${arch}.txt build -D libdir=lib/$(dpkg-architecture -A $arch -qDEB_TARGET_MULTIARCH)
+ninja -C build install
+cd ..
+rm -rf $LIBDRM_VERSION
+
+
+apt-get purge -y \
+ $STABLE_EPHEMERAL
+
+. .gitlab-ci/container/container_post_build.sh
diff --git a/.gitlab-ci/container/i386_build.sh b/.gitlab-ci/container/i386_build.sh
new file mode 100644
index 00000000000..404fe9cac1b
--- /dev/null
+++ b/.gitlab-ci/container/i386_build.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+arch=i386
+
+. .gitlab-ci/container/cross_build.sh
diff --git a/.gitlab-ci/container/ppc64el_build.sh b/.gitlab-ci/container/ppc64el_build.sh
new file mode 100644
index 00000000000..3519192e8ea
--- /dev/null
+++ b/.gitlab-ci/container/ppc64el_build.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+arch=ppc64el
+
+. .gitlab-ci/container/cross_build.sh
+
+apt-get install -y --no-remove \
+ libvulkan-dev:$arch
diff --git a/.gitlab-ci/container/s390x_build.sh b/.gitlab-ci/container/s390x_build.sh
new file mode 100644
index 00000000000..38ca850c582
--- /dev/null
+++ b/.gitlab-ci/container/s390x_build.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+arch=s390x
+
+. .gitlab-ci/container/cross_build.sh
diff --git a/.gitlab-ci/container/x86_build-base.sh b/.gitlab-ci/container/x86_build-base.sh
index dd698fc74cd..2350aca8843 100644
--- a/.gitlab-ci/container/x86_build-base.sh
+++ b/.gitlab-ci/container/x86_build-base.sh
@@ -5,11 +5,6 @@ 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 \
@@ -30,6 +25,7 @@ apt-get install -y --no-remove \
bison \
ccache \
clang-9 \
+ dpkg-cross \
flex \
g++ \
g++-mingw-w64-x86-64 \
@@ -37,19 +33,16 @@ apt-get install -y --no-remove \
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 \
@@ -69,8 +62,6 @@ apt-get install -y --no-remove \
python3-requests \
qemu-user \
scons \
- wine-development \
- wine32-development \
wine64-development \
x11proto-dri2-dev \
x11proto-gl-dev \
@@ -83,36 +74,6 @@ apt-get install -y --no-remove -t buster-backports \
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
diff --git a/.gitlab-ci/container/x86_build.sh b/.gitlab-ci/container/x86_build.sh
index f286748939e..562bde8a6b9 100644
--- a/.gitlab-ci/container/x86_build.sh
+++ b/.gitlab-ci/container/x86_build.sh
@@ -21,8 +21,17 @@ STABLE_EPHEMERAL=" \
wget \
"
+# We need multiarch for Wine
+dpkg --add-architecture i386
+apt-get update
+
apt-get install -y --no-remove \
- $STABLE_EPHEMERAL
+ $STABLE_EPHEMERAL \
+ wine-development \
+ wine32-development
+
+apt-get install -y --no-remove -t buster-backports \
+ llvm-8-dev
. .gitlab-ci/container/container_pre_build.sh
@@ -70,8 +79,6 @@ wget https://dri.freedesktop.org/libdrm/$LIBDRM_VERSION.tar.bz2
tar -xvf $LIBDRM_VERSION.tar.bz2 && rm $LIBDRM_VERSION.tar.bz2
cd $LIBDRM_VERSION
meson build -D vc4=true -D freedreno=true -D etnaviv=true -D libdir=lib/x86_64-linux-gnu; ninja -C build install
-rm -rf build; meson --cross-file=/cross_file-ppc64el.txt build -D libdir=lib/powerpc64le-linux-gnu; ninja -C build install
-rm -rf build; meson --cross-file=/cross_file-i386.txt build -D libdir=lib/i386-linux-gnu; ninja -C build install
cd ..
rm -rf $LIBDRM_VERSION