fix(release): correct $ORIGIN rpath and awk field ref in pg-tools step

- patchelf was passed '\$ORIGIN' (backslash-dollar inside single quotes),
  so the ELF rpath was a literal \$ORIGIN path — the loader never expanded
  it and the tools couldn't find libpq at runtime. Use '$ORIGIN'.
- macOS awk program had \$1, which awk rejects as a syntax error; use $1
  (verified locally: otool -> install_name_tool -> all 3 tools run).
This commit is contained in:
2026-08-05 21:22:28 +08:00
parent 1d72a174dd
commit 0d6c9a039a
+2 -2
View File
@@ -91,7 +91,7 @@ jobs:
# the app's resource dir via $ORIGIN rpath.
cp src/interfaces/libpq/libpq.so.5 "$OUT"/libpq.so.5
for b in pg_dump pg_restore psql; do
patchelf --set-rpath '\$ORIGIN' "$OUT/$b"
patchelf --set-rpath '$ORIGIN' "$OUT/$b"
done
;;
macos-latest|macos-15-intel)
@@ -108,7 +108,7 @@ jobs:
# Rewrite the absolute /tmp/pgbuild libpq install_name to a
# relative @loader_path so the tools find libpq next to themselves.
for b in pg_dump pg_restore psql; do
libpq=$(otool -L "$OUT/$b" | awk '/libpq/ {print \$1; exit}')
libpq=$(otool -L "$OUT/$b" | awk '/libpq/ {print $1; exit}')
install_name_tool -change "$libpq" "@loader_path/libpq.5.dylib" "$OUT/$b"
done
;;