Skip to content

Commit c25bd24

Browse files
committed
fix(ci): use macos-15 for PostgreSQL x86_64 build with cross-compilation
macos-13 runners are deprecated. Cross-compile x86_64 on macos-15 ARM runner via -arch x86_64 passed through PG_EXTRA_CFLAGS. Also pass PG_EXTRA_CFLAGS to linker for arch flag propagation.
1 parent 7fb4e61 commit c25bd24

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ jobs:
282282
- os: macos-15
283283
arch: arm64
284284
name: macos
285-
- os: macos-13
285+
- os: macos-15
286286
arch: x86_64
287287
name: macos
288288
steps:
@@ -309,7 +309,7 @@ jobs:
309309

310310
- name: build and package postgresql extension (macos)
311311
if: matrix.name == 'macos'
312-
run: make postgres-package PG_CONFIG=$(brew --prefix postgresql@17)/bin/pg_config PG_EXTRA_CFLAGS="-I$(brew --prefix gettext)/include"
312+
run: make postgres-package PG_CONFIG=$(brew --prefix postgresql@17)/bin/pg_config PG_EXTRA_CFLAGS="-I$(brew --prefix gettext)/include ${{ matrix.arch == 'x86_64' && '-arch x86_64' || '' }}"
313313

314314
- uses: actions/upload-artifact@v4.6.2
315315
with:

docker/Makefile.postgresql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ postgres-build: postgres-check
111111
$(CC) $(PG_CPPFLAGS) $(PG_CFLAGS) -c $$src -o $${src%.c}.o || exit 1; \
112112
done
113113
@echo "Linking $(PG_EXTENSION_LIB)..."
114-
$(CC) $(PG_LDFLAGS) -o $(PG_EXTENSION_LIB) $(PG_OBJS)
114+
$(CC) $(PG_LDFLAGS) $(PG_EXTRA_CFLAGS) -o $(PG_EXTENSION_LIB) $(PG_OBJS)
115115
@echo "Build complete: $(PG_EXTENSION_LIB)"
116116

117117
# Install extension to PostgreSQL

0 commit comments

Comments
 (0)