From 14a3d36ae13956370db0fb1cd3e14ae478bf0299 Mon Sep 17 00:00:00 2001 From: Andreas Karlsson Date: Fri, 11 Apr 2025 05:13:19 +0200 Subject: [PATCH] Only check pg_tde with the combined typedefs The reason to do this is that the old approach created an unnecessary diff against upstream where they had forgot SinglePartitionSpec in typedefs.list. Additionally add two new structs from our SMGR patch to the list. --- ci_scripts/dump-typedefs.sh | 9 ++------- ci_scripts/run-pgindent.sh | 6 +++++- src/include/nodes/parsenodes.h | 2 +- src/tools/pgindent/typedefs.list | 2 ++ 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ci_scripts/dump-typedefs.sh b/ci_scripts/dump-typedefs.sh index bcc1e1b61dd..6f854a48895 100755 --- a/ci_scripts/dump-typedefs.sh +++ b/ci_scripts/dump-typedefs.sh @@ -3,17 +3,12 @@ SCRIPT_DIR="$(cd -- "$(dirname "$0")" >/dev/null 2>&1; pwd -P)" cd "$SCRIPT_DIR/.." -if ! test -f src/backend/postgres; then - echo "src/backend/postgres doesn't exists, run make-build.sh first in debug mode" - exit 1 -fi - if ! test -f contrib/pg_tde/pg_tde.so; then echo "contrib/pg_tde/pg_tde.so doesn't exists, run make-build.sh first in debug mode" exit 1 fi -src/tools/find_typedef src/backend contrib/pg_tde > percona.typedefs +src/tools/find_typedef contrib/pg_tde > pg_tde.typedefs # Combine with original typedefs -cat percona.typedefs src/tools/pgindent/typedefs.list | sort -u > combined.typedefs +cat pg_tde.typedefs src/tools/pgindent/typedefs.list | sort -u > combined.typedefs diff --git a/ci_scripts/run-pgindent.sh b/ci_scripts/run-pgindent.sh index 13964ffe35c..4b9ba00f278 100755 --- a/ci_scripts/run-pgindent.sh +++ b/ci_scripts/run-pgindent.sh @@ -16,4 +16,8 @@ cd "$SCRIPT_DIR/.." export PATH=$SCRIPT_DIR/../src/tools/pgindent/:$INSTALL_DIR/bin/:$PATH -pgindent --typedefs=combined.typedefs "$@" . +# Check everything except pg_tde with the list in the repo +pgindent --typedefs=src/tools/pgindent/typedefs.list --excludes=<(echo "contrib/pg_tde") "$@" . + +# Check pg_tde with the fresh list extraxted from the object file +pgindent --typedefs=combined.typedefs "$@" contrib/pg_tde diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 0ed589426af..67c90a2bd32 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -945,7 +945,7 @@ typedef struct PartitionRangeDatum typedef struct SinglePartitionSpec { NodeTag type; -} SinglePartitionSpec; +} SinglePartitionSpec; /* * PartitionCmd - info for ALTER TABLE/INDEX ATTACH/DETACH PARTITION commands diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index 72e6d3a9865..2114d560ced 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -1607,6 +1607,7 @@ ManyTestResourceKind Material MaterialPath MaterialState +MdSMgrRelationData MdfdVec Memoize MemoizeEntry @@ -3206,6 +3207,7 @@ XLogRecordBuffer XLogRecoveryCtlData XLogRedoAction XLogSegNo +XLogSmgr XLogSource XLogStats XLogwrtResult