0001-headerscheck-ccache-support.patch
text/plain
Filename: 0001-headerscheck-ccache-support.patch
Type: text/plain
Part: 0
Message:
headerscheck ccache support
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch 0001
Subject: headerscheck ccache support
| File | + | − |
|---|---|---|
| .cirrus.tasks.yml | 2 | 3 |
| src/tools/pginclude/headerscheck | 4 | 7 |
From fe0517de0ef9017293bf2cbc2ca735e7b8949ced Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter@eisentraut.org>
Date: Fri, 21 Nov 2025 10:53:53 +0100
Subject: [PATCH] headerscheck ccache support
---
.cirrus.tasks.yml | 5 ++---
src/tools/pginclude/headerscheck | 11 ++++-------
2 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/.cirrus.tasks.yml b/.cirrus.tasks.yml
index 2fe9671f3dc..038d043d00e 100644
--- a/.cirrus.tasks.yml
+++ b/.cirrus.tasks.yml
@@ -1005,16 +1005,15 @@ task:
###
# Verify headerscheck / cpluspluscheck succeed
#
- # - Don't use ccache, the files are uncacheable, polluting ccache's
- # cache
# - Use -fmax-errors, as particularly cpluspluscheck can be very verbose
###
always:
headers_headerscheck_script: |
time ./configure \
${LINUX_CONFIGURE_FEATURES} \
+ --cache gcc.cache \
--quiet \
- CC="gcc" CXX"=g++" CLANG="clang"
+ CC="ccache gcc" CXX="ccache g++" CLANG="ccache clang"
make -s -j${BUILD_JOBS} clean
time make -s headerscheck EXTRAFLAGS='-fmax-errors=10'
headers_cpluspluscheck_script: |
diff --git a/src/tools/pginclude/headerscheck b/src/tools/pginclude/headerscheck
index a52a5580bdc..c77c4eec2f6 100755
--- a/src/tools/pginclude/headerscheck
+++ b/src/tools/pginclude/headerscheck
@@ -72,11 +72,6 @@ else
COMPILER_FLAGS="$CPPFLAGS $CFLAGS $ICU_CFLAGS"
fi
-# Create temp directory.
-tmp=`mktemp -d /tmp/$me.XXXXXX`
-
-trap "ret=$?; rm -rf $tmp; exit $ret" 0 1 2 3 15
-
exit_status=0
# Scan all of src/ and contrib/ for header files.
@@ -200,6 +195,7 @@ do
fi
# OK, create .c file to include this .h file.
+ test_file_name=${me}_$(printf '%s' "$f" | sed 's![/.]!_!g')
{
$cplusplus && echo 'extern "C" {'
# Ideally we'd pre-include only the appropriate one of
@@ -231,7 +227,7 @@ do
esac
echo "#include \"$f\""
$cplusplus && echo '};'
- } >$tmp/test.$ext
+ } >$test_file_name.$ext
# Some subdirectories need extra -I switches.
case "$f" in
@@ -253,10 +249,11 @@ do
if ! $COMPILER $COMPILER_FLAGS -I $builddir -I $srcdir \
-I $builddir/src/include -I $srcdir/src/include \
-I $builddir/src/interfaces/libpq -I $srcdir/src/interfaces/libpq \
- $EXTRAINCLUDES $EXTRAFLAGS -c $tmp/test.$ext -o $tmp/test.o
+ $EXTRAINCLUDES $EXTRAFLAGS -c $test_file_name.$ext -o $test_file_name.o
then
exit_status=1
fi
+ rm -f "$test_file_name.$ext" "$test_file_name.o"
done
exit $exit_status
--
2.51.0