Skip to content

Fix all postgresql server commands in launchctl wrappers and installation notes #28575

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

toy
Copy link
Contributor

@toy toy commented May 30, 2025

Description

Wrappers created for postgresqlNN-server before 16 use su instead of sudo to execute as postgres, but postgres has shell set to /usr/bin/false, so su commands fail. See https://trac.macports.org/ticket/68412 which fixed it for postgresql16-server and #14331 which fixed it for postgresql96-server.

While resolving build errors (following a nudge from @barracuda156):

  • Removed dependency of postgresql96-server on bash
  • Switched all postgresqlNN to use PortGroup openssl with branch 1, 1.1 or 3
  • Added patches to fix int64 checks (failing due to usage of exit function without header) and usage of incompatible function in xml.c (without const qualifier where one is expected, it apparently switched by default from a warning to an error in osx 14)
  • All versions compile succesfully on intel (osx13 runner), but versions <= 9.1 fail on amd (osx14 and osx15 runners) with errors:
    • clang: error: unsupported option '-mthreads' for target 'arm64-apple-darwin23.6.0' for <= 9.0
    • ../../../../src/include/storage/s_lock.h:937:2: error: PostgreSQL does not have native spinlock support on this platform. To continue the compilation, rerun configure using --disable-spinlocks. However, performance will be poor. Please report this to pgsql-bugs@postgresql.org. for 9.1

spinlock problem can probably be fixed by adding handling for arm64 as in 9.2 and problems with threads I didn't look into, but I would prefer to leave it for now

Type(s)
  • bugfix
  • enhancement
  • security fix
Tested on

macOS 14.7.5 23H527 arm64
Xcode 16.2 16C5032a

Verification

Have you

  • followed our Commit Message Guidelines?
  • squashed and minimized your commits?
  • checked that there aren't other open pull requests for the same change?
  • referenced existing tickets on Trac with full URL in commit message?
  • checked your Portfile with port lint?
  • tried existing tests with sudo port test?
  • tried a full install with sudo port -vst install?
  • tested basic functionality of all binary files?
  • checked that the Portfile's most important variants haven't been broken?

@macportsbot
Copy link

Notifying maintainers:
@jyrkiwahlstedt for port postgresql10-server, postgresql11-server, postgresql12-server, postgresql13-server, postgresql14-server, postgresql15-server, postgresql93-server, postgresql94-server, postgresql95-server.
@barracuda156 for port postgresql16-server, postgresql17-server.
@dgilman for port postgresql16-server, postgresql17-server.

@toy
Copy link
Contributor Author

toy commented May 30, 2025

Failures are due to failing to install dependencies for older versions, most if not all are already marked as known to be failing

@barracuda156
Copy link
Contributor

Failures are due to failing to install dependencies for older versions, most if not all are already marked as known to be failing

Just nobody bothered to fix them after breaking by openssl default version change. They should use openssl PG with 1.0 branch, as I recall. Not a path to openssl.dylib, which pick an incompatible 3.0. Maybe a few minor tweaks to the portfile. Last time when I needed some old postgresql9x, it did not take much to fix the build.

@toy toy force-pushed the fix-all-postgresql-server-commands branch from 8dda919 to 997334d Compare June 1, 2025 20:34
@dgilman
Copy link
Contributor

dgilman commented Jun 3, 2025

Thank you for the build fixes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants