[glib/wip/smcv/show-execution-environment] CI: Show execution environment before we start



commit fd290bbcc524c805b65c1f79d9b25cf3cc367318
Author: Simon McVittie <smcv collabora com>
Date:   Wed Feb 12 14:35:54 2020 +0000

    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 <smcv collabora com>

 .gitlab-ci.yml                           |  9 +++++++++
 .gitlab-ci/show-execution-environment.sh | 11 +++++++++++
 2 files changed, 20 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d28f88b7e..6d1aa4570 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:
@@ -274,6 +275,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:
@@ -321,6 +323,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.
@@ -350,6 +354,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
@@ -375,6 +381,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
@@ -410,6 +417,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 || :


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]