ci: Move cross file generation to a shared script.
authorEric Anholt <eric@anholt.net>
Wed, 13 May 2020 18:54:04 +0000 (11:54 -0700)
committerMarge Bot <eric+marge@anholt.net>
Mon, 18 May 2020 19:39:46 +0000 (19:39 +0000)
We're going to do this in another container soon, and it would also be
nice to consolidate cmake cross setup.

Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5033>

.gitlab-ci.yml
.gitlab-ci/container/arm_build.sh
.gitlab-ci/container/x86_build.sh
.gitlab-ci/create-cross-file.sh [new file with mode: 0755]

index 62dccc6f34aaf5141f8e4187e3dd0475428cf61f..863d0ec9864f45b99fda19118f07b9ce603df7e0 100644 (file)
@@ -136,7 +136,7 @@ x86_build:
     - .fdo.container-build@debian
     - .container
   variables:
-    FDO_DISTRIBUTION_TAG: &x86_build "2020-05-18"
+    FDO_DISTRIBUTION_TAG: &x86_build "2020-05-18-baremetal"
 
 .use-x86_build:
   variables:
@@ -177,7 +177,7 @@ arm_build:
     - .fdo.container-build@debian@arm64v8
     - .container
   variables:
-    FDO_DISTRIBUTION_TAG: &arm_build "2020-05-01-netcat"
+    FDO_DISTRIBUTION_TAG: &arm_build "2020-05-14-baremetal"
 
 .use-arm_build:
   variables:
index 74ecd2b1296bdc1bcdb9871da8d43050a180c0ed..0d09497ceef185dc3cdcd64c13ff4557f1b33eee 100644 (file)
@@ -64,12 +64,7 @@ rm -rf $LIBDRM_VERSION
 
 ############### Generate cross build file for Meson
 
-cross_file="/cross_file-armhf.txt"
-/usr/share/meson/debcrossgen --arch armhf -o "$cross_file"
-# Explicitly set ccache path for cross compilers
-sed -i "s|/usr/bin/\([^-]*\)-linux-gnu\([^-]*\)-g|/usr/lib/ccache/\\1-linux-gnu\\2-g|g" "$cross_file"
-# Don't need wrapper for armhf executables
-sed -i -e '/\[properties\]/a\' -e "needs_exe_wrapper = False" "$cross_file"
+. .gitlab-ci/create-cross-file.sh armhf
 
 ############### Generate kernel, ramdisk, test suites, etc for LAVA jobs
 
index d9c88abf22033f0820737faf809554dbf02729f8..64e1e488aea5c1f2e97d1f485ef8ad97f6a5e184 100644 (file)
@@ -154,17 +154,7 @@ chmod +x /usr/local/bin/x86_64-w64-mingw32-pkg-config
 
 # Generate cross build files for Meson
 for arch in $CROSS_ARCHITECTURES; do
-  cross_file="/cross_file-$arch.txt"
-  /usr/share/meson/debcrossgen --arch "$arch" -o "$cross_file"
-  # Explicitly set ccache path for cross compilers
-  sed -i "s|/usr/bin/\([^-]*\)-linux-gnu\([^-]*\)-g|/usr/lib/ccache/\\1-linux-gnu\\2-g|g" "$cross_file"
-  if [ "$arch" = "i386" ]; then
-    # Work around a bug in debcrossgen that should be fixed in the next release
-    sed -i "s|cpu_family = 'i686'|cpu_family = 'x86'|g" "$cross_file"
-  fi
-
-  # Rely on qemu-user being configured in binfmt_misc on the host
-  sed -i -e '/\[properties\]/a\' -e "needs_exe_wrapper = False" "$cross_file"
+    . .gitlab-ci/create-cross-file.sh $arch
 done
 
 
diff --git a/.gitlab-ci/create-cross-file.sh b/.gitlab-ci/create-cross-file.sh
new file mode 100755 (executable)
index 0000000..de2fba5
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+arch=$1
+cross_file="/cross_file-$arch.txt"
+/usr/share/meson/debcrossgen --arch $arch -o "$cross_file"
+# Explicitly set ccache path for cross compilers
+sed -i "s|/usr/bin/\([^-]*\)-linux-gnu\([^-]*\)-g|/usr/lib/ccache/\\1-linux-gnu\\2-g|g" "$cross_file"
+if [ "$arch" = "i386" ]; then
+    # Work around a bug in debcrossgen that should be fixed in the next release
+    sed -i "s|cpu_family = 'i686'|cpu_family = 'x86'|g" "$cross_file"
+fi
+# Rely on qemu-user being configured in binfmt_misc on the host
+sed -i -e '/\[properties\]/a\' -e "needs_exe_wrapper = False" "$cross_file"