From dff2e3b4c7bba04b8eeeea391879c21f4be45870 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 12 Feb 2020 14:35:54 +0000 Subject: [PATCH] CI: Show execution environment before we start This will help to debug CI issues that are related to us running in a container that might have unusual capabilities, mount points, filesystems etc., such as (probably) #2027, #2028, #2029. Signed-off-by: Simon McVittie --- .gitlab-ci.yml | 9 +++++++++ .gitlab-ci/show-execution-environment.sh | 11 +++++++++++ 2 files changed, 20 insertions(+) create mode 100755 .gitlab-ci/show-execution-environment.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e23c2bb0e..aa4e004ec 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,6 +28,7 @@ variables: .build: extends: .only-default before_script: + - bash .gitlab-ci/show-execution-environment.sh - cp -r $HOME/subprojects/* subprojects/ style-check-diff: @@ -278,6 +279,7 @@ msys2-mingw32: CHERE_INVOKING: "yes" script: - C:\msys64\usr\bin\pacman --noconfirm -Syyuu --ask 20 + - C:\msys64\usr\bin\bash .gitlab-ci/show-execution-environment.sh - C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2.sh" artifacts: reports: @@ -325,6 +327,8 @@ freebsd-11-x86_64: LDFLAGS: -L/usr/local/lib -Wl,--disable-new-dtags # FreeBSD doesn't have C.UTF-8 locale. LANG: en_US.UTF-8 + before_script: + - bash .gitlab-ci/show-execution-environment.sh script: # We cannot use -Wl,--no-undefined because GLib uses 'environ' variable. # FreeBSD iconv doesn't handle transliteration, so we use (external) GNU libiconv here. @@ -354,6 +358,8 @@ freebsd-12-x86_64: CPPFLAGS: -I/usr/local/include LDFLAGS: -L/usr/local/lib -Wl,--disable-new-dtags LANG: en_US.UTF-8 + before_script: + - bash .gitlab-ci/show-execution-environment.sh script: - meson ${MESON_COMMON_OPTIONS} -Db_lundef=false -Diconv=external -Dxattr=false _build - ninja -C _build @@ -379,6 +385,7 @@ macos: tags: - macos before_script: + - bash .gitlab-ci/show-execution-environment.sh - pip3 install --user meson==0.49.2 - pip3 install --user ninja - export PATH=/Users/gitlabrunner/Library/Python/3.7/bin:$PATH @@ -414,6 +421,8 @@ coverage: name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}" paths: - _coverage/ + before_script: + - bash .gitlab-ci/show-execution-environment.sh script: - bash -x ./.gitlab-ci/coverage-docker.sh coverage: '/^\s+lines\.+:\s+([\d.]+\%)\s+/' diff --git a/.gitlab-ci/show-execution-environment.sh b/.gitlab-ci/show-execution-environment.sh new file mode 100755 index 000000000..0c2265161 --- /dev/null +++ b/.gitlab-ci/show-execution-environment.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -eux -o pipefail + +id || : +capsh --print || : +env -0 | sort -z | perl -pe 's/\0/\n/g' || : +setpriv --dump || : +ulimit -a || : +cat /proc/self/status || : +cat /proc/self/mountinfo || :