Skip to content

fix(packaging): thin Postgres.app binaries and drop unshipped files - #384

Merged
EraPartner merged 3 commits into
mainfrom
claude/project-thread-nu4294
Oct 28, 2026
Merged

EraPartner merged 3 commits into
mainfrom
claude/project-thread-nu4294

Conversation

@EraPartner

Copy link
Copy Markdown
Owner

Summary

#383 fixed the first relink failure in the v2.0.0 release build. I downloaded the pinned Postgres.app 2.9.6 DMG (SHA-256 matches POSTGRES_APP_SHA256) and inspected its PostgreSQL 18 tree on Linux. That turned up three more failures queued behind the ICU one:

  • Universal binaries. All 217 Mach-O files are x86_64 + arm64. otool -L and otool -D print one block per slice, so linkedLibraries reads each slice header (the file's own staged path) as a dependency, and dynamicLibraryId reads it as an executable's library id. The relinker now thins each file to the build architecture with lipo before reading it.
  • Static archives. Six universal .a files are reported as Mach-O by file. They are link-time only and are now removed from the staged runtime.
  • PL/Python. plpython3.dylib and the three *_plpython3 transforms link /Library/Frameworks/Python.framework/Python. The runner doesn't have it, and Vision doesn't use it: migrations only create pg_trgm, pgcrypto and pg_stat_statements. Those modules and their extension scripts are now removed.

Also confirmed from the DMG:

Testing

  • bun run typecheck:electron, eslint and prettier pass.
  • node --test packaging/electron/out/scripts/*.test.js: 49 pass, 1 skipped. That includes a new test for the file removal.
  • The lipo and otool path only runs on macOS. The next release run is the real check.

Generated by Claude Code

Release run 48 failed with "ENOENT: lstat
packaging/electron/libicuuc.77.dylib". Postgres.app's ICU libraries
record bare install names (libicuuc.77.dylib), and the relinker passed
them to realpathSync, which resolved them against the build step's
working directory. Resolve a non-absolute dependency next to the image
that records it, and fail with a clear message if it is not there.
Inspecting the pinned Postgres.app 2.9.6 DMG showed three more relink
failures waiting behind the ICU one:

- Every Mach-O is universal (x86_64 + arm64). otool prints one block
  per slice, so the parsers read the slice headers as dependencies
  and library ids. Thin each file to the build architecture first.
- Six static archives are universal too, so `file` calls them Mach-O.
  They are link-time only; remove them.
- The PL/Python modules link /Library/Frameworks/Python.framework,
  which the runner does not have and Vision does not use. Remove them
  and their extension scripts.
@EraPartner
EraPartner enabled auto-merge (squash) October 28, 2026 18:03
@github-actions

Copy link
Copy Markdown

Coverage Report for backend

Status Category Percentage Covered / Total
🟢 Lines 91.06% (🎯 80%) 23170 / 25443
🟢 Statements 89.33% (🎯 78%) 24933 / 27910
🟢 Functions 91.44% (🎯 76%) 5004 / 5472
🟢 Branches 81.61% (🎯 68%) 17481 / 21419
File CoverageNo changed files found.
Generated in workflow #1948 for commit 3cb9a0c by the Vitest Coverage Report Action

@EraPartner
EraPartner merged commit d35d060 into main Oct 28, 2026
11 checks passed
@EraPartner
EraPartner deleted the claude/project-thread-nu4294 branch October 28, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants