-
-
Notifications
You must be signed in to change notification settings - Fork 505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci(macos): Avoid linking against Homebrew #1755
base: master
Are you sure you want to change the base?
Conversation
Homebrew binaries are always compiled for exactly the version they're installed on making them very unportable. When a wheel is "repaired" by cibuildwheel, delocate-wheel pulls in _psycopg's dependencies (libpq.dylib, libssl.dylib and libcrypto.dylib) which, on a GitHub Actions macOS 14 runner, are provided by Homebrew and are therefore only macOS >= 14 compatible. The resultant wheel is therefore incompatible with all but the latest macOS versions. Build all dependencies from source so that we can set the deployment target to something sensible.
I've temporarily disabled all the other bits of CI just to make verifying quicker. I'll revert all that if/when we get closer to merging. I wanted to gauge whether you think this is worth the trouble before finishing it off? I can't imagine you'd be particularly comfortable with having a rather hairy build step that you can't run locally. Here's a sample build with the macOS versions in the wheel tags back to normal. |
Yes, this seems useful, and it's what we do for Linux: see the If you complete this operation it would be useful to port it to psycopg 3 too (which has a script pretty much identical). Hint: you can use Thank you very much for your initiative! |
export LDFLAGS="-L$fake_prefix/lib" | ||
export CPPFLAGS="-I$fake_prefix/include" | ||
cd postgresql-16.6 | ||
./configure --without-icu --prefix="$fake_prefix" --with-ssl=openssl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No gssapi/ldap support?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I was going to ask about which --with-xxx
features to use but you beat me to it. I see build_libpq.sh
makes that decision for me anyway.
What is, on macOS, the default socket dir? In other words:
what path is searched for in macOS? If it's not psycopg2/scripts/build/build_libpq.sh Lines 148 to 152 in e83754a
|
Thanks for pointing that out. Yes, adding macOS support to that script sounds better than doing it all over again in YAML.
I wasn't aware that there was such thing as a socket dir but does this answer your question? > psql "host='' port=9999"
psql: error: connection to server on socket "/tmp/.s.PGSQL.9999" failed: No such file or directory
Is the server running locally and accepting connections on that socket? (That's homebrew's |
Do you mind if I bump the OpenLDAP version? I need this fix or the check for POSIX regex throws a false negative. (It's probably |
Homebrew binaries are always compiled for exactly the version they're installed on making them very unportable. When a wheel is "repaired" by cibuildwheel, delocate-wheel pulls in _psycopg's dependencies (libpq.dylib, libssl.dylib and libcrypto.dylib) which, on a GitHub Actions macOS 14 runner, are provided by Homebrew and are therefore only macOS >= 14 compatible. The resultant wheel is therefore incompatible with all but the latest macOS versions.
Build all dependencies from source so that we can set the deployment target to something sensible. Fixes #1753.