From 5eea2d7355077a322251e14f489811af17393ad1 Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com> Date: Wed, 17 Jun 2026 15:50:15 +0200 Subject: [PATCH 1/3] Move clang-tidy to ARM runner It is the fastest Debug build we have, and we want clang-tidy in Debug mode as well. --- .github/gh_matrix_builder.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/gh_matrix_builder.py b/.github/gh_matrix_builder.py index 1a5e608f54a..ea2a79715da 100755 --- a/.github/gh_matrix_builder.py +++ b/.github/gh_matrix_builder.py @@ -194,6 +194,8 @@ def macos_config(overrides): # timescale/timescaledb repository. # See the available runners here: # https://github.com/timescale/timescaledb/actions/runners +# +# Also run clang-tidy on it, because it's the fastest debug configuration. if os.environ.get("GITHUB_REPOSITORY") == "timescale/timescaledb": m["include"].append( build_debug_config( @@ -204,6 +206,9 @@ def macos_config(overrides): # code. The actual architecture for our ARM CI runner is reported as: # -imultiarch aarch64-linux-gnu - -mlittle-endian -mabi=lp64 -march=armv8.2-a+crypto+fp16+rcpc+dotprod "pg_extra_args": "--enable-debug --enable-cassert --without-llvm CFLAGS=-march=armv8.2-a+crypto", + "cc": "clang", + "cxx": "clang++", + "tsdb_build_args": "-DLINTER=ON -DWARNINGS_AS_ERRORS=ON", } ) ) @@ -222,15 +227,11 @@ def macos_config(overrides): ) ) -# Test latest postgres release without telemetry. Also run clang-tidy on it -# because it's the fastest one. +# Test latest postgres release without telemetry. m["include"].append( build_without_telemetry( { "pg": PG18_LATEST, - "cc": "clang", - "cxx": "clang++", - "tsdb_build_args": "-DLINTER=ON -DWARNINGS_AS_ERRORS=ON", } ) ) From 275b1db48a0751db36a41d3c5b7ae9ba6daec030 Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com> Date: Wed, 17 Jun 2026 16:05:31 +0200 Subject: [PATCH 2/3] gcc? --- .github/workflows/linux-build-and-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linux-build-and-test.yaml b/.github/workflows/linux-build-and-test.yaml index dd25db55bdf..23b4b657a63 100644 --- a/.github/workflows/linux-build-and-test.yaml +++ b/.github/workflows/linux-build-and-test.yaml @@ -179,7 +179,7 @@ jobs: - name: Build TimescaleDB run: | # Show the actual architecture this CI runner has - "$CC" -march=native -E -v - &1 | grep cc1 + gcc -march=native -E -v - &1 | grep cc1 ./bootstrap -DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" \ -DPG_SOURCE_DIR=$HOME/$PG_SRC_DIR -DPG_PATH=$HOME/$PG_INSTALL_DIR \ From 9481edfa9f7463e7edfc5943d85f520ff42976b2 Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com> Date: Wed, 17 Jun 2026 16:04:43 +0200 Subject: [PATCH 3/3] fix clang-tidy warnings in unit tests --- test/src/test_jsonb_utils.c | 10 +++++----- test/src/test_stats.c | 2 +- tsl/test/src/test_fastlanes.c | 18 +++++++++--------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/test/src/test_jsonb_utils.c b/test/src/test_jsonb_utils.c index 8fcf4713c11..3b08d85435a 100644 --- a/test/src/test_jsonb_utils.c +++ b/test/src/test_jsonb_utils.c @@ -5,15 +5,15 @@ */ #include + +#include +#include +#include + #include "jsonb_utils.h" #include "test_utils.h" #include "ts_catalog/compression_settings.h" #include "utils/jsonb.h" -#include -#include - -// Declare jsonb_in explicitly -extern Datum jsonb_in(PG_FUNCTION_ARGS); const char * jsonb_to_cstring(Jsonb *jsonb) diff --git a/test/src/test_stats.c b/test/src/test_stats.c index 3494ed151fd..442048d926f 100644 --- a/test/src/test_stats.c +++ b/test/src/test_stats.c @@ -68,7 +68,7 @@ test_eviction() Oid uncompressed_relid = 54321; int32 slot_indices[NUM_SLOTS] = { 0 }; uint64 slot_seqno[NUM_SLOTS] = { 0 }; - uint64 sum_lifespan = 0; + double sum_lifespan = 0; double sumsq_lifespan = 0; int32 num_evictions = 0; uint64 min_lifespan = UINT64_MAX; diff --git a/tsl/test/src/test_fastlanes.c b/tsl/test/src/test_fastlanes.c index 40811504cab..ab02adcb26a 100644 --- a/tsl/test/src/test_fastlanes.c +++ b/tsl/test/src/test_fastlanes.c @@ -611,17 +611,17 @@ test_fl256_ffor_144x13b() #define CALC_MINMAX(min, max, values, n) \ do \ { \ - min = *values; \ - max = *values; \ - for (size_t i = 0; i < n; ++i) \ + (min) = *(values); \ + (max) = *(values); \ + for (size_t i = 0; i < (n); ++i) \ { \ - if (min > values[i]) \ + if ((min) > (values)[i]) \ { \ - min = values[i]; \ + (min) = (values)[i]; \ } \ - if (max < values[i]) \ + if ((max) < (values)[i]) \ { \ - max = values[i]; \ + (max) = (values)[i]; \ } \ } \ } while (0) @@ -760,9 +760,9 @@ test_randomized() #define CHECK_VALUES(V, SZ, E) \ do \ { \ - for (int i = 0; i < SZ; ++i) \ + for (int i = 0; i < (SZ); ++i) \ { \ - TestAssertInt64Eq(V[i], E); \ + TestAssertInt64Eq((V)[i], (E)); \ } \ } while (0)