Skip to content

fix(macos): bundle OpenSSL so PostgreSQL starts without Homebrew - #51

Merged
nicoloboschi merged 1 commit into
mainfrom
fix/macos-bundled-openssl
Nov 4, 2026
Merged

nicoloboschi merged 1 commit into
mainfrom
fix/macos-bundled-openssl

Conversation

@nicoloboschi

Copy link
Copy Markdown
Collaborator

This is #42 by @vadimcomanescu, rebased onto main (author kept). The libxml2 commit is dropped because #47/#50 already fixed that. I couldn't push to the original branch since it lives in an organization fork.

The macOS PostgreSQL binaries load OpenSSL from /opt/homebrew/opt/openssl@3, so pg0 start fails on Macs without Homebrew. This bundles conda-forge's OpenSSL 3.5.9 (pinned by URL and sha256), rewrites every reference to @loader_path, re-signs ad hoc, and fails the build if any Homebrew or /usr/local path is left. Existing broken installs get re-extracted on the next start. See #42 for the full write-up.

Verified locally (arm64): 127 Mach-O files with 0 Homebrew//usr/local references, libpq loads @loader_path/../lib/libssl.3.dylib, SHOW ssl_library returns OpenSSL, and CREATE EXTENSION vector works.

The theseus-rs macOS PostgreSQL binaries load libssl/libcrypto from
/opt/homebrew/opt/openssl@3, so pg0 cannot start PostgreSQL on a Mac
without Homebrew (theseus-rs/postgresql-binaries#30).

For the apple-darwin targets, build.rs now copies libssl.3.dylib and
libcrypto.3.dylib from a pinned, checksummed conda-forge OpenSSL 3.5.9
package into the bundle's lib/, rewrites every reference to
@loader_path/../lib/, re-signs the changed files ad-hoc and fails the
build if any Mach-O still references /opt/homebrew or /usr/local.
An install extracted by an earlier pg0 is re-extracted once.
Linux and Windows builds are unchanged.
@nicoloboschi
nicoloboschi merged commit 7c0f5d6 into main Nov 4, 2026
15 checks passed
@nicoloboschi
nicoloboschi deleted the fix/macos-bundled-openssl branch November 4, 2026 14:41
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