summaryrefslogtreecommitdiff
path: root/.gitlab-ci
diff options
context:
space:
mode:
authorEric Engestrom <eric@igalia.com>2023-03-17 18:53:34 +0000
committerMarge Bot <emma+marge@anholt.net>2023-03-22 17:28:07 +0000
commit6a0f12ba5f10fe82fd26304a56cb4f7b60119902 (patch)
tree9ab3d67b5c956b625c4b94ebccfba669ff02dcec /.gitlab-ci
parentab46f6974b7853c54cda642354712e8f68b050a8 (diff)
ci: centralize detection of ccache in link-werror wrapper
Signed-off-by: Eric Engestrom <eric@igalia.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21997>
Diffstat (limited to '.gitlab-ci')
-rwxr-xr-x.gitlab-ci/build/ccache-g++-link-werror.sh15
-rwxr-xr-x.gitlab-ci/build/ccache-gcc-link-werror.sh15
-rwxr-xr-x.gitlab-ci/build/g++-link-werror.sh12
-rwxr-xr-x.gitlab-ci/build/gcc-link-werror.sh12
-rw-r--r--.gitlab-ci/build/gitlab-ci.yml2
-rw-r--r--.gitlab-ci/build/meson-native-lto-wrappers-ccache.txt3
6 files changed, 19 insertions, 40 deletions
diff --git a/.gitlab-ci/build/ccache-g++-link-werror.sh b/.gitlab-ci/build/ccache-g++-link-werror.sh
deleted file mode 100755
index 1264decc248..00000000000
--- a/.gitlab-ci/build/ccache-g++-link-werror.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh -e
-
-if [ "$(ps -p $(ps -p $PPID -o ppid --no-headers) -o comm --no-headers)" != ninja ]; then
- # Not invoked by ninja (e.g. for a meson feature check)
- exec ccache g++ "$@"
-fi
-
-if [ "$(eval printf "'%s'" "\"\${$(($#-1))}\"")" = "-c" ]; then
- # Not invoked for linking
- exec ccache g++ "$@"
-fi
-
-# Compiler invoked by ninja for linking. Add -Werror to turn compiler warnings into errors
-# with LTO. (meson's werror should arguably do this, but meanwhile we need to)
-exec ccache g++ "$@" -Werror
diff --git a/.gitlab-ci/build/ccache-gcc-link-werror.sh b/.gitlab-ci/build/ccache-gcc-link-werror.sh
deleted file mode 100755
index 136f0e7825a..00000000000
--- a/.gitlab-ci/build/ccache-gcc-link-werror.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh -e
-
-if [ "$(ps -p $(ps -p $PPID -o ppid --no-headers) -o comm --no-headers)" != ninja ]; then
- # Not invoked by ninja (e.g. for a meson feature check)
- exec ccache gcc "$@"
-fi
-
-if [ "$(eval printf "'%s'" "\"\${$(($#-1))}\"")" = "-c" ]; then
- # Not invoked for linking
- exec ccache gcc "$@"
-fi
-
-# Compiler invoked by ninja for linking. Add -Werror to turn compiler warnings into errors
-# with LTO. (meson's werror should arguably do this, but meanwhile we need to)
-exec ccache gcc "$@" -Werror
diff --git a/.gitlab-ci/build/g++-link-werror.sh b/.gitlab-ci/build/g++-link-werror.sh
index 5aa9f8477ae..649549ccc07 100755
--- a/.gitlab-ci/build/g++-link-werror.sh
+++ b/.gitlab-ci/build/g++-link-werror.sh
@@ -1,15 +1,21 @@
#!/bin/sh -e
+if command -V ccache >/dev/null 2>/dev/null; then
+ CCACHE=ccache
+else
+ CCACHE=
+fi
+
if [ "$(ps -p $(ps -p $PPID -o ppid --no-headers) -o comm --no-headers)" != ninja ]; then
# Not invoked by ninja (e.g. for a meson feature check)
- exec g++ "$@"
+ exec $CCACHE g++ "$@"
fi
if [ "$(eval printf "'%s'" "\"\${$(($#-1))}\"")" = "-c" ]; then
# Not invoked for linking
- exec g++ "$@"
+ exec $CCACHE g++ "$@"
fi
# Compiler invoked by ninja for linking. Add -Werror to turn compiler warnings into errors
# with LTO. (meson's werror should arguably do this, but meanwhile we need to)
-exec g++ "$@" -Werror
+exec $CCACHE g++ "$@" -Werror
diff --git a/.gitlab-ci/build/gcc-link-werror.sh b/.gitlab-ci/build/gcc-link-werror.sh
index aa92a41ea43..3e8c69fdb8e 100755
--- a/.gitlab-ci/build/gcc-link-werror.sh
+++ b/.gitlab-ci/build/gcc-link-werror.sh
@@ -1,15 +1,21 @@
#!/bin/sh -e
+if command -V ccache >/dev/null 2>/dev/null; then
+ CCACHE=ccache
+else
+ CCACHE=
+fi
+
if [ "$(ps -p $(ps -p $PPID -o ppid --no-headers) -o comm --no-headers)" != ninja ]; then
# Not invoked by ninja (e.g. for a meson feature check)
- exec gcc "$@"
+ exec $CCACHE gcc "$@"
fi
if [ "$(eval printf "'%s'" "\"\${$(($#-1))}\"")" = "-c" ]; then
# Not invoked for linking
- exec gcc "$@"
+ exec $CCACHE gcc "$@"
fi
# Compiler invoked by ninja for linking. Add -Werror to turn compiler warnings into errors
# with LTO. (meson's werror should arguably do this, but meanwhile we need to)
-exec gcc "$@" -Werror
+exec $CCACHE gcc "$@" -Werror
diff --git a/.gitlab-ci/build/gitlab-ci.yml b/.gitlab-ci/build/gitlab-ci.yml
index 5f83cfd80c8..0642bbfa157 100644
--- a/.gitlab-ci/build/gitlab-ci.yml
+++ b/.gitlab-ci/build/gitlab-ci.yml
@@ -184,7 +184,7 @@ debian-build-testing:
GALLIUM_DRIVERS: "iris,nouveau,kmsro,r300,r600,freedreno,swrast,svga,v3d,vc4,virgl,etnaviv,panfrost,lima,zink,d3d12,asahi,crocus"
VULKAN_DRIVERS: swrast
EXTRA_OPTION: >
- --native-file .gitlab-ci/build/meson-native-lto-wrappers-ccache.txt
+ --native-file .gitlab-ci/build/meson-native-lto-wrappers.txt
-D spirv-to-dxil=true
-D osmesa=true
-D tools=drm-shim,etnaviv,freedreno,glsl,intel,intel-ui,nir,nouveau,lima,panfrost,asahi
diff --git a/.gitlab-ci/build/meson-native-lto-wrappers-ccache.txt b/.gitlab-ci/build/meson-native-lto-wrappers-ccache.txt
deleted file mode 100644
index e17f64f8400..00000000000
--- a/.gitlab-ci/build/meson-native-lto-wrappers-ccache.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-[binaries]
-c = 'ccache-gcc-link-werror.sh'
-cpp = 'ccache-g++-link-werror.sh'