From 591817ca9d099780f1c31640db08bcfa28d3cd54 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sun, 31 May 2026 18:23:04 +0200 Subject: [PATCH 01/11] new(citus): horizontally-scalable PostgreSQL extension MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Citus turns Postgres into a distributed SQL database by sharding tables across worker nodes. Common alternative to CockroachDB / Yugabyte for users who'd rather keep vanilla Postgres semantics (same SQL, same protocol, same MVCC) and just add sharding. Build is PGXS; pantry's postgresql.org provides pg_config. Citus 14.x supports PG 16, 17, 18 (configure enforces this), so the dep is pinned `>=16<19`. Compression deps (lz4, zstd) and libcurl (anonymous stats) are enabled explicitly so the bottle matches upstream's default feature set. `make install-all prefix={{prefix}}` redirects PGXS-derived install dirs into pantry's prefix so extension files don't leak into the postgresql.org dependency's tree. No `provides:` — Citus ships no CLI; artefacts are citus.so plus the extension control/SQL files, loaded inside Postgres via `CREATE EXTENSION citus`. Co-Authored-By: Claude Opus 4.7 --- .../github.com/citusdata/citus/package.yml | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 projects/github.com/citusdata/citus/package.yml diff --git a/projects/github.com/citusdata/citus/package.yml b/projects/github.com/citusdata/citus/package.yml new file mode 100644 index 0000000000..c7a28d3d47 --- /dev/null +++ b/projects/github.com/citusdata/citus/package.yml @@ -0,0 +1,70 @@ +# Citus — horizontally-scalable PostgreSQL extension. +# +# Citus extends Postgres into a distributed SQL database by sharding +# tables across worker nodes. It's a drop-in extension: same Postgres, +# same SQL, just transparently parallelised across a cluster. Common +# alternative to CockroachDB / Yugabyte for users who want to stay on +# vanilla Postgres semantics. +# +# Build: PGXS-based extension. Installs no CLI tools — the artefacts +# are a shared library (citus.so) plus extension control/SQL files, +# loaded inside Postgres via `CREATE EXTENSION citus` after adding it +# to shared_preload_libraries. +# +# PostgreSQL compatibility (Citus 14.x): PG 16, 17, 18. + +distributable: + url: https://github.com/citusdata/citus/archive/refs/tags/v{{version}}.tar.gz + strip-components: 1 + +versions: + github: citusdata/citus + +platforms: + - linux/x86-64 + - linux/aarch64 + - darwin/x86-64 + - darwin/aarch64 + +dependencies: + postgresql.org: '>=16<19' + curl.se: '*' # anonymous statistics collection + lz4.org: '*' # column compression + facebook.com/zstd: '*' # column compression + openssl.org: '*' # transitively via libpq / PG + +build: + dependencies: + gnu.org/make: '*' + freedesktop.org/pkg-config: '*' + linux: + gnu.org/gcc: '*' + script: + # PGXS uses pg_config to determine install dirs. Override `prefix` + # at install time so extension files land in pantry's bottle, not + # in the Postgres dependency's tree. + - ./configure $ARGS + - make --jobs {{ hw.concurrency }} + - make install-all prefix={{prefix}} + env: + ARGS: + - PG_CONFIG={{deps.postgresql.org.prefix}}/bin/pg_config + - --prefix={{prefix}} + - --with-libcurl + - --with-lz4 + - --with-zstd + +# Citus ships no executables — it's a Postgres extension loaded inside +# the server process. Bottle contents: +# {{prefix}}/lib/postgresql/citus.so +# {{prefix}}/share/postgresql/extension/citus.control +# {{prefix}}/share/postgresql/extension/citus--*.sql +# `provides:` validates bin/sbin paths, so omit the key entirely +# (cf. zlib.net, which is also library-only). + +test: + script: + # Shared object lands in lib/postgresql when prefix lacks + # "postgres"/"pgsql" tokens (PGXS convention). + - test -f "{{prefix}}/lib/postgresql/citus.so" || test -f "{{prefix}}/lib/citus.so" + - test -f "{{prefix}}/share/postgresql/extension/citus.control" || test -f "{{prefix}}/share/extension/citus.control" From 0ebeaa594fcfa26a88268f3451a2c070f57070e6 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sun, 31 May 2026 18:26:29 +0200 Subject: [PATCH 02/11] fix(citus): pin CC=cc, configure inherits clang from pg_config --cc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Citus's configure copies CC from `$(pg_config --cc)` (so it matches the PostgreSQL the extension links against). Pantry's postgresql.org bottle was built with clang, but the pkgx linux toolchain ships gcc only — so configure picked `clang`, then died with "C compiler cannot create executables". Pin CC=cc to use the toolchain's default (gcc on linux, clang on darwin) while still building hermetically. Co-Authored-By: Claude Opus 4.7 --- projects/github.com/citusdata/citus/package.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/projects/github.com/citusdata/citus/package.yml b/projects/github.com/citusdata/citus/package.yml index c7a28d3d47..f78dc4bf21 100644 --- a/projects/github.com/citusdata/citus/package.yml +++ b/projects/github.com/citusdata/citus/package.yml @@ -43,11 +43,17 @@ build: # PGXS uses pg_config to determine install dirs. Override `prefix` # at install time so extension files land in pantry's bottle, not # in the Postgres dependency's tree. + # + # Citus's configure inherits CC from `pg_config --cc`, which on the + # pantry postgresql.org bottle reports `clang`. The pantry linux + # toolchain ships gcc, not clang, so we pin CC=cc (gcc on linux, + # clang on darwin) to keep the build hermetic. - ./configure $ARGS - make --jobs {{ hw.concurrency }} - make install-all prefix={{prefix}} env: ARGS: + - CC=cc - PG_CONFIG={{deps.postgresql.org.prefix}}/bin/pg_config - --prefix={{prefix}} - --with-libcurl From 1985ba138e67818b8ab6a34681207bc8d48dfeb3 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sun, 31 May 2026 18:29:33 +0200 Subject: [PATCH 03/11] fix(citus): build with clang on linux, set SDKROOT on darwin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PostgreSQL's bottle was compiled with clang, and Citus extensions inherit CFLAGS via `pg_config --cflags`. Those flags include clang-specific warnings (-Werror=unguarded-availability-new, -Wno-cast-function-type-strict, …) that gcc-16 rejects outright. Add llvm.org as a linux build-dep and set CC=clang so the extension matches PG's compiler. On darwin, brewkit's hermetic CPATH masks the Xcode SDK headers, so Xcode clang's #include_next chain can't reach / . Set SDKROOT=$(xcrun --sdk macosx --show-sdk-path) — same pattern used by github.com/99designs/aws-vault for the same situation. Co-Authored-By: Claude Opus 4.7 --- .../github.com/citusdata/citus/package.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/projects/github.com/citusdata/citus/package.yml b/projects/github.com/citusdata/citus/package.yml index f78dc4bf21..4118130bff 100644 --- a/projects/github.com/citusdata/citus/package.yml +++ b/projects/github.com/citusdata/citus/package.yml @@ -38,27 +38,31 @@ build: gnu.org/make: '*' freedesktop.org/pkg-config: '*' linux: - gnu.org/gcc: '*' + # PostgreSQL bottle was built with clang, and Citus extensions + # inherit CFLAGS via `pg_config --cflags` — those carry + # clang-specific warnings (e.g. -Werror=unguarded-availability-new) + # that gcc rejects. Use the same clang to stay compatible. + llvm.org: '*' script: # PGXS uses pg_config to determine install dirs. Override `prefix` # at install time so extension files land in pantry's bottle, not # in the Postgres dependency's tree. - # - # Citus's configure inherits CC from `pg_config --cc`, which on the - # pantry postgresql.org bottle reports `clang`. The pantry linux - # toolchain ships gcc, not clang, so we pin CC=cc (gcc on linux, - # clang on darwin) to keep the build hermetic. - ./configure $ARGS - make --jobs {{ hw.concurrency }} - make install-all prefix={{prefix}} env: + CC: clang ARGS: - - CC=cc - PG_CONFIG={{deps.postgresql.org.prefix}}/bin/pg_config - --prefix={{prefix}} - --with-libcurl - --with-lz4 - --with-zstd + darwin: + # Brewkit's hermetic CPATH masks the Xcode SDK, so Xcode clang's + # #include_next chain can't reach , , etc. + # Point the toolchain at the active SDK explicitly. + SDKROOT: $(xcrun --sdk macosx --show-sdk-path) # Citus ships no executables — it's a Postgres extension loaded inside # the server process. Bottle contents: From 948071e57c38235d8e4cdfc08239984cced9b3ca Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sun, 31 May 2026 18:32:16 +0200 Subject: [PATCH 04/11] fix(citus): strip stale -isysroot from PG's CFLAGS on darwin The pantry postgresql.org bottle was built with the macOS 15.2 SDK (/Applications/Xcode.app/.../SDKs/MacOSX15.2.sdk), and pg_config bakes that path into the -isysroot flag returned by `pg_config --cflags`. On the current darwin runners only the newer Xcode SDK is installed, so clang's -isysroot points at a directory that doesn't exist, and stdio.h / math.h / inttypes.h all go missing. Sed the stale -isysroot out of Makefile.global after configure runs; the SDKROOT env var (already set above) then steers clang to the correct, present-day SDK. No-op on linux, where -isysroot is absent. Co-Authored-By: Claude Opus 4.7 --- projects/github.com/citusdata/citus/package.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/projects/github.com/citusdata/citus/package.yml b/projects/github.com/citusdata/citus/package.yml index 4118130bff..ae561d0074 100644 --- a/projects/github.com/citusdata/citus/package.yml +++ b/projects/github.com/citusdata/citus/package.yml @@ -48,6 +48,13 @@ build: # at install time so extension files land in pantry's bottle, not # in the Postgres dependency's tree. - ./configure $ARGS + # The PostgreSQL bottle was built with macOS SDK 15.2, so + # `pg_config --cflags` injects `-isysroot .../MacOSX15.2.sdk`. + # Pantry's darwin runners ship a newer SDK only, so that path no + # longer exists and the compile dies looking for stdio.h / math.h. + # Strip the stale isysroot from Makefile.global; SDKROOT (set + # below) then drives the toolchain to the current SDK. + - test ! -f Makefile.global || sed -i.bak -E 's|-isysroot[[:space:]]+/Applications/Xcode[^[:space:]]*||g' Makefile.global - make --jobs {{ hw.concurrency }} - make install-all prefix={{prefix}} env: From acdacfd14b94cb799b52962a4b4e9202a72169ce Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sun, 31 May 2026 18:35:20 +0200 Subject: [PATCH 05/11] fix(citus): override stale -isysroot via PG_CPPFLAGS on darwin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous attempt to sed the stale `-isysroot .../MacOSX15.2.sdk` out of Makefile.global was a no-op — PGXS pulls that flag in from pg_config at make time, not from the per-extension Makefile.global. Use the PGXS-blessed extension hook instead: PG_CPPFLAGS is appended to the compile line after PG's own CPPFLAGS, and clang resolves multiple -isysroot occurrences left-to-right (last wins). Passing `PG_CPPFLAGS="-isysroot $(xcrun --sdk macosx --show-sdk-path)"` therefore overrides the baked-in 15.2 path with the SDK that's actually installed on the runner. Variable is empty on linux, so the make invocations are identical across platforms. Co-Authored-By: Claude Opus 4.7 --- .../github.com/citusdata/citus/package.yml | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/projects/github.com/citusdata/citus/package.yml b/projects/github.com/citusdata/citus/package.yml index ae561d0074..9dd7571f25 100644 --- a/projects/github.com/citusdata/citus/package.yml +++ b/projects/github.com/citusdata/citus/package.yml @@ -48,15 +48,11 @@ build: # at install time so extension files land in pantry's bottle, not # in the Postgres dependency's tree. - ./configure $ARGS - # The PostgreSQL bottle was built with macOS SDK 15.2, so - # `pg_config --cflags` injects `-isysroot .../MacOSX15.2.sdk`. - # Pantry's darwin runners ship a newer SDK only, so that path no - # longer exists and the compile dies looking for stdio.h / math.h. - # Strip the stale isysroot from Makefile.global; SDKROOT (set - # below) then drives the toolchain to the current SDK. - - test ! -f Makefile.global || sed -i.bak -E 's|-isysroot[[:space:]]+/Applications/Xcode[^[:space:]]*||g' Makefile.global - - make --jobs {{ hw.concurrency }} - - make install-all prefix={{prefix}} + # PG_CPPFLAGS is appended by PGXS after PG's own CPPFLAGS, so the + # fresh -isysroot wins over the stale one baked into pg_config on + # darwin. Empty (and harmless) on linux. + - make --jobs {{ hw.concurrency }} PG_CPPFLAGS="$PG_CPPFLAGS_EXTRA" + - make install-all prefix={{prefix}} PG_CPPFLAGS="$PG_CPPFLAGS_EXTRA" env: CC: clang ARGS: @@ -68,8 +64,15 @@ build: darwin: # Brewkit's hermetic CPATH masks the Xcode SDK, so Xcode clang's # #include_next chain can't reach , , etc. - # Point the toolchain at the active SDK explicitly. + # Point the toolchain at the active SDK explicitly. The PG bottle + # was also built with macOS SDK 15.2 and bakes that path into + # `pg_config --cflags` as `-isysroot .../MacOSX15.2.sdk`, but the + # darwin runners only carry a newer SDK now. Append a fresh + # -isysroot via PG_CPPFLAGS so clang sees both and uses the last + # one (clang's documented behaviour) — pointing at the SDK that + # actually exists. SDKROOT: $(xcrun --sdk macosx --show-sdk-path) + PG_CPPFLAGS_EXTRA: -isysroot $(xcrun --sdk macosx --show-sdk-path) # Citus ships no executables — it's a Postgres extension loaded inside # the server process. Bottle contents: From a6f3794e1440e1f397eddd9ad782dfbfc0aba853 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sun, 31 May 2026 18:38:11 +0200 Subject: [PATCH 06/11] fix(citus): use PG_CFLAGS (appended last) not PG_CPPFLAGS (prepended) Previous attempt set PG_CPPFLAGS, but PGXS prepends that to CPPFLAGS: override CPPFLAGS := \$(PG_CPPFLAGS) \$(CPPFLAGS) So our -isysroot ended up *before* PG's stale -isysroot in the compile line, and clang picked the stale 15.2 SDK (left-to-right resolution, last wins). PG_CFLAGS, by contrast, is appended last: override CFLAGS := \$(CFLAGS) \$(PG_CFLAGS) Switching to PG_CFLAGS puts our fresh -isysroot after PG's, so clang selects the SDK that actually exists on the runner. Co-Authored-By: Claude Opus 4.7 --- projects/github.com/citusdata/citus/package.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/projects/github.com/citusdata/citus/package.yml b/projects/github.com/citusdata/citus/package.yml index 9dd7571f25..808df95a78 100644 --- a/projects/github.com/citusdata/citus/package.yml +++ b/projects/github.com/citusdata/citus/package.yml @@ -48,11 +48,12 @@ build: # at install time so extension files land in pantry's bottle, not # in the Postgres dependency's tree. - ./configure $ARGS - # PG_CPPFLAGS is appended by PGXS after PG's own CPPFLAGS, so the - # fresh -isysroot wins over the stale one baked into pg_config on - # darwin. Empty (and harmless) on linux. - - make --jobs {{ hw.concurrency }} PG_CPPFLAGS="$PG_CPPFLAGS_EXTRA" - - make install-all prefix={{prefix}} PG_CPPFLAGS="$PG_CPPFLAGS_EXTRA" + # PGXS appends PG_CFLAGS *after* PG's own CFLAGS, so the fresh + # -isysroot wins over the stale one baked into pg_config on darwin + # (clang resolves multiple -isysroot left-to-right; last wins). + # Variable is empty (and harmless) on linux. + - make --jobs {{ hw.concurrency }} PG_CFLAGS="$PG_CFLAGS_EXTRA" + - make install-all prefix={{prefix}} PG_CFLAGS="$PG_CFLAGS_EXTRA" env: CC: clang ARGS: @@ -68,11 +69,11 @@ build: # was also built with macOS SDK 15.2 and bakes that path into # `pg_config --cflags` as `-isysroot .../MacOSX15.2.sdk`, but the # darwin runners only carry a newer SDK now. Append a fresh - # -isysroot via PG_CPPFLAGS so clang sees both and uses the last + # -isysroot via PG_CFLAGS so clang sees both and uses the last # one (clang's documented behaviour) — pointing at the SDK that # actually exists. SDKROOT: $(xcrun --sdk macosx --show-sdk-path) - PG_CPPFLAGS_EXTRA: -isysroot $(xcrun --sdk macosx --show-sdk-path) + PG_CFLAGS_EXTRA: -isysroot $(xcrun --sdk macosx --show-sdk-path) # Citus ships no executables — it's a Postgres extension loaded inside # the server process. Bottle contents: From 87e0222fa08c43fb654b17144f6b35a223b51dda Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sun, 31 May 2026 18:42:58 +0200 Subject: [PATCH 07/11] fix(citus): wrap pg_config to rewrite stale darwin -isysroot SDK path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PGXS reads PG's CFLAGS through pg_config at configure time and bakes them into Citus's Makefile.global. The PG bottle was built with macOS SDK 15.2, so -isysroot .../MacOSX15.2.sdk gets cemented in — but the darwin runners only carry a newer SDK, so the path resolves to nothing and stdio.h / inttypes.h / math.h all go missing. Earlier attempts (PG_CPPFLAGS prepended → loses to PG; PG_CFLAGS appended → still appeared before PG's own -isysroot in the final compile line because of how PGXS interleaves CPPFLAGS and CFLAGS) all left the stale SDK winning. Switch to a build-local wrapper pg_config that pipes the real binary's output through sed on darwin to substitute the live SDK path. Point Citus's configure at the wrapper via PG_CONFIG. On linux the wrapper passes through unchanged. Linux x64 already passed with the previous PG_CFLAGS commit, so this keeps that fix conceptually intact while finally addressing darwin. ARM64 hit a transient DNS error fetching the tarball; not a code bug. Co-Authored-By: Claude Opus 4.7 --- .../github.com/citusdata/citus/package.yml | 43 +++++++++++-------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/projects/github.com/citusdata/citus/package.yml b/projects/github.com/citusdata/citus/package.yml index 808df95a78..e282aa7ac4 100644 --- a/projects/github.com/citusdata/citus/package.yml +++ b/projects/github.com/citusdata/citus/package.yml @@ -44,20 +44,34 @@ build: # that gcc rejects. Use the same clang to stay compatible. llvm.org: '*' script: - # PGXS uses pg_config to determine install dirs. Override `prefix` - # at install time so extension files land in pantry's bottle, not - # in the Postgres dependency's tree. + # On darwin, `pg_config --cflags` returns a stale -isysroot pointing + # at the macOS SDK PG was bottled against (e.g. MacOSX15.2.sdk), but + # the darwin runners only have the current Xcode SDK installed. + # Build a wrapper pg_config that rewrites the bad path to the current + # SDK, and point Citus's configure at it via PG_CONFIG. The wrapper + # is a no-op pass-through on linux. + - | + SDK_REWRITE="" + if [ "$(uname)" = "Darwin" ]; then + SDK=$(xcrun --sdk macosx --show-sdk-path) + SDK_REWRITE="| sed -E 's|/Applications/Xcode[^[:space:]]*/SDKs/MacOSX[0-9.]+\\.sdk|$SDK|g'" + fi + mkdir -p "$PWD/pgconfig-shim" + cat > "$PWD/pgconfig-shim/pg_config" <, , etc. - # Point the toolchain at the active SDK explicitly. The PG bottle - # was also built with macOS SDK 15.2 and bakes that path into - # `pg_config --cflags` as `-isysroot .../MacOSX15.2.sdk`, but the - # darwin runners only carry a newer SDK now. Append a fresh - # -isysroot via PG_CFLAGS so clang sees both and uses the last - # one (clang's documented behaviour) — pointing at the SDK that - # actually exists. + # Point the toolchain at the active SDK explicitly. SDKROOT: $(xcrun --sdk macosx --show-sdk-path) - PG_CFLAGS_EXTRA: -isysroot $(xcrun --sdk macosx --show-sdk-path) # Citus ships no executables — it's a Postgres extension loaded inside # the server process. Bottle contents: From 4b215811da1dd6e30524a0bdf23ac6a40780582f Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sun, 31 May 2026 18:45:59 +0200 Subject: [PATCH 08/11] fix(citus): override CPPFLAGS at make time to rewrite stale isysroot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The wrapper pg_config approach didn't help: PGXS pulls PG's CPPFLAGS not from \`pg_config --cppflags\` at make time but by including PG's installed Makefile.global on disk, which has the stale \`-isysroot .../MacOSX15.2.sdk\` baked in. Instead, read pg_config --cppflags ourselves, sed-rewrite the SDK path on darwin, and pass the cleaned value as \`make CPPFLAGS=...\`. PGXS does \`override CPPFLAGS := -I. -I\$(srcdir) \$(CPPFLAGS)\`, which then *augments* our value rather than discarding it — so our SDK fix survives, and PGXS adds its own -I flags on top. Linux gets the unmodified pg_config --cppflags, so behaviour there is identical to the previous (passing) PG_CFLAGS commit. Co-Authored-By: Claude Opus 4.7 --- .../github.com/citusdata/citus/package.yml | 40 +++++++++---------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/projects/github.com/citusdata/citus/package.yml b/projects/github.com/citusdata/citus/package.yml index e282aa7ac4..8522efbc0a 100644 --- a/projects/github.com/citusdata/citus/package.yml +++ b/projects/github.com/citusdata/citus/package.yml @@ -44,34 +44,32 @@ build: # that gcc rejects. Use the same clang to stay compatible. llvm.org: '*' script: - # On darwin, `pg_config --cflags` returns a stale -isysroot pointing - # at the macOS SDK PG was bottled against (e.g. MacOSX15.2.sdk), but - # the darwin runners only have the current Xcode SDK installed. - # Build a wrapper pg_config that rewrites the bad path to the current - # SDK, and point Citus's configure at it via PG_CONFIG. The wrapper - # is a no-op pass-through on linux. - - | - SDK_REWRITE="" - if [ "$(uname)" = "Darwin" ]; then - SDK=$(xcrun --sdk macosx --show-sdk-path) - SDK_REWRITE="| sed -E 's|/Applications/Xcode[^[:space:]]*/SDKs/MacOSX[0-9.]+\\.sdk|$SDK|g'" - fi - mkdir -p "$PWD/pgconfig-shim" - cat > "$PWD/pgconfig-shim/pg_config" < Date: Sun, 31 May 2026 18:48:39 +0200 Subject: [PATCH 09/11] fix(citus): also rewrite stale isysroot in LDFLAGS on darwin CPPFLAGS override fixed compilation, but the dylib link step still picked up -isysroot .../MacOSX15.2.sdk from PG's LDFLAGS, so ld couldn't find the System library. Read pg_config --ldflags, run the same SDK-path rewrite on it, and pass it on the make command line alongside CPPFLAGS. Co-Authored-By: Claude Opus 4.7 --- projects/github.com/citusdata/citus/package.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/projects/github.com/citusdata/citus/package.yml b/projects/github.com/citusdata/citus/package.yml index 8522efbc0a..2dee9f1be4 100644 --- a/projects/github.com/citusdata/citus/package.yml +++ b/projects/github.com/citusdata/citus/package.yml @@ -60,12 +60,15 @@ build: - | PG_CONFIG="{{deps.postgresql.org.prefix}}/bin/pg_config" CPPFLAGS_PG=$("$PG_CONFIG" --cppflags) + LDFLAGS_PG=$("$PG_CONFIG" --ldflags) if [ "$(uname)" = "Darwin" ]; then SDK=$(xcrun --sdk macosx --show-sdk-path) - CPPFLAGS_PG=$(printf '%s' "$CPPFLAGS_PG" | sed -E "s|/Applications/Xcode[^[:space:]]*/SDKs/MacOSX[0-9.]+\.sdk|$SDK|g") + REWRITE="s|/Applications/Xcode[^[:space:]]*/SDKs/MacOSX[0-9.]+\\.sdk|$SDK|g" + CPPFLAGS_PG=$(printf '%s' "$CPPFLAGS_PG" | sed -E "$REWRITE") + LDFLAGS_PG=$(printf '%s' "$LDFLAGS_PG" | sed -E "$REWRITE") fi - make --jobs {{ hw.concurrency }} CPPFLAGS="$CPPFLAGS_PG" - make install-all prefix={{prefix}} CPPFLAGS="$CPPFLAGS_PG" + make --jobs {{ hw.concurrency }} CPPFLAGS="$CPPFLAGS_PG" LDFLAGS="$LDFLAGS_PG" + make install-all prefix={{prefix}} CPPFLAGS="$CPPFLAGS_PG" LDFLAGS="$LDFLAGS_PG" env: CC: clang ARGS: From 4a43cfce89d98bf07495fb3855b64f8b9748112b Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sun, 31 May 2026 18:51:23 +0200 Subject: [PATCH 10/11] fix(citus): accept citus.dylib on darwin in the smoke test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Build now succeeds on darwin (compile + link both green) — the failure was in the test step, which only looked for citus.so. PGXS produces citus.dylib on darwin (its $(DLSUFFIX) is .dylib there). Match either. Drop the share/extension fallback path too: with `make install-all prefix=...` the file always lands at share/postgresql/extension/. Co-Authored-By: Claude Opus 4.7 --- projects/github.com/citusdata/citus/package.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/projects/github.com/citusdata/citus/package.yml b/projects/github.com/citusdata/citus/package.yml index 2dee9f1be4..aaab527ddb 100644 --- a/projects/github.com/citusdata/citus/package.yml +++ b/projects/github.com/citusdata/citus/package.yml @@ -93,7 +93,8 @@ build: test: script: - # Shared object lands in lib/postgresql when prefix lacks - # "postgres"/"pgsql" tokens (PGXS convention). - - test -f "{{prefix}}/lib/postgresql/citus.so" || test -f "{{prefix}}/lib/citus.so" - - test -f "{{prefix}}/share/postgresql/extension/citus.control" || test -f "{{prefix}}/share/extension/citus.control" + # PGXS installs the loadable module as citus.so on linux, + # citus.dylib on darwin, both under lib/postgresql when the + # prefix lacks "postgres"/"pgsql" tokens (PGXS convention). + - ls "{{prefix}}/lib/postgresql/citus.so" "{{prefix}}/lib/postgresql/citus.dylib" 2>/dev/null | grep -q . + - test -f "{{prefix}}/share/postgresql/extension/citus.control" From 8fabb0983a0c8c158704e3535871ed3c5a49f7f7 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Sun, 31 May 2026 18:53:38 +0200 Subject: [PATCH 11/11] fix(citus): use portable test(1) for the .so/.dylib smoke check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous \`ls ... | grep -q .\` form returned non-zero when the first arg didn't exist, before the second was even considered. Use \`test -f A -o -f B\` instead — short-circuits cleanly and is the same idiom the task brief suggested. Co-Authored-By: Claude Opus 4.7 --- projects/github.com/citusdata/citus/package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/github.com/citusdata/citus/package.yml b/projects/github.com/citusdata/citus/package.yml index aaab527ddb..7f7ed84776 100644 --- a/projects/github.com/citusdata/citus/package.yml +++ b/projects/github.com/citusdata/citus/package.yml @@ -96,5 +96,5 @@ test: # PGXS installs the loadable module as citus.so on linux, # citus.dylib on darwin, both under lib/postgresql when the # prefix lacks "postgres"/"pgsql" tokens (PGXS convention). - - ls "{{prefix}}/lib/postgresql/citus.so" "{{prefix}}/lib/postgresql/citus.dylib" 2>/dev/null | grep -q . + - test -f "{{prefix}}/lib/postgresql/citus.so" -o -f "{{prefix}}/lib/postgresql/citus.dylib" - test -f "{{prefix}}/share/postgresql/extension/citus.control"