From b31cd173264ad031a183cac8a08050a720062870 Mon Sep 17 00:00:00 2001 From: Onur Tirtir Date: Mon, 18 Sep 2023 12:29:32 +0300 Subject: [PATCH] Apply valgrind patch only if PG < 16 --- fabfile/setup.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fabfile/setup.py b/fabfile/setup.py index 46feb2b2..9904dd6a 100644 --- a/fabfile/setup.py +++ b/fabfile/setup.py @@ -251,9 +251,12 @@ def build_postgres(c): c.run('tar -xf {}.tar.bz2'.format(final_dir), hide='stdout') with c.cd(final_dir): - # apply the patch that helps reporting the queries that cause memory errors under valgrind - patch_path = os.path.join(config.HOME_DIR, "test-automation/fabfile/pg_report_vg_query.patch") - c.run('git apply {}'.format(patch_path)) + # Apply the patch that helps reporting the queries that cause memory errors under valgrind + # if Postgres version is older than 16. This is because, the relevant patch has already been + # merged into Postgres in 16. + if PG_VERSION.split(".")[0] < "16": + patch_path = os.path.join(config.HOME_DIR, "test-automation/fabfile/pg_report_vg_query.patch") + c.run('git apply {}'.format(patch_path)) pg_latest = config.PG_LATEST flags = ' '.join(config.PG_CONFIGURE_FLAGS)