Opened 11 months ago

Closed 7 months ago

Last modified 7 months ago

#67638 closed defect (fixed)

postgresql14 @14.8_0+clang15+llvm+perl+python3+tcl broken (by llvm15/16?)

Reported by: Gandoon (Erik Hedlund) Owned by: jyrkiwahlstedt
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc: mascguy (Christopher Nielsen)
Port: postgresql14 llvm15 llvm16

Description (last modified by Gandoon (Erik Hedlund))

It turns out that the +llvm option for postgresql14 might be broken. At least on some legacy systems, I run MacOS 10.15 for certain backwards compatibility reasons. I had the port installed as: postgresql14 @14.8_0+clang15+llvm+perl+python3+tcl but recently the llvm jit compilation functionality seems to have been broken. The output of a rev-upgrade was as follows:

$ port -v rev-upgrade
--->  Scanning binaries for linking errors
Could not open /opt/local/libexec/llvm-15/lib/libc++.1.dylib: Error opening or reading file (referenced from /opt/local/lib/postgresql14/llvmjit.so)
--->  Found 1 broken file, matching files to ports
--->  Found 1 broken port, determining rebuild order
You can always run 'port rev-upgrade' again to fix errors.
The following ports will be rebuilt: postgresql14 @14.8+clang15+llvm+perl+python3+tcl
Continue? [Y/n]: n

Trying to rebuild it yielded an error, and trying to build it with clang16 and llvm16 didn't make things better (see attached log).

I reverted to building the port without the +llvm option, and that works just fine. Any ideas?

Attachments (1)

postgresql14-main-20230616.log.xz (95.2 KB) - added by Gandoon (Erik Hedlund) 11 months ago.
Failing to build with +llvm

Download all attachments as: .zip

Change History (10)

Changed 11 months ago by Gandoon (Erik Hedlund)

Failing to build with +llvm

comment:1 Changed 11 months ago by Gandoon (Erik Hedlund)

Description: modified (diff)

comment:2 Changed 11 months ago by jmroot (Joshua Root)

Owner: set to jyrkiwahlstedt
Status: newassigned

comment:3 Changed 8 months ago by Gandoon (Erik Hedlund)

Maybe we can add postgresql15 to this? It also fails to build with +llvm. Without it builds just fine.

There seems to be an upstream bug somewhere (see: https://www.postgresql.org/message-id/17900-fddca512c008774c%40postgresql.org and possibly https://postgrespro.com/list/id/17927-2d7146227560bdf3@postgresql.org)

comment:4 Changed 8 months ago by dgilman (David Gilman)

PostgreSQL has to do a bunch of work to support LLVM 16+ so you will not see support for it until PostgreSQL 17 or later.

I had originally blacklisted clang 15 as LLVM/clang 15 used to not work for the same reasons LLVM 16 does not work. This is a bug, I will fix the portfile for all postgres versions.

However, I am still getting stuff to build correctly and don't see linking errors. I don't have the legacy system you do, though. Until the fix is pushed try port info postgresqlXX +llvm +clang14 and verify it is trying to build with clang-14 and link against llvm-14 in that output. If you don't see both, or are still getting errors after building, please write back.

comment:5 Changed 8 months ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:6 in reply to:  5 Changed 8 months ago by Gandoon (Erik Hedlund)

Replying to mascguy: Thanks, I was considering it myself and ended up building postgresql15 with clang/llvm 14 and it worked so I tried postgresql14 as well and it also worked, so that seems to be the silver bullet for my system. However, the output from port info postgresql15 +llvm gives a dependency on llvm 15, which indeed has been proven to be problematic on my system, so an explicit +clang14 solves that issue. On postgresql14 the same dependency is actually llvm 13, which needs to be remedied the same way if I want to build with clang/llvm 14.

The one thing that is interesting is that with earlier versions of clang/llvm 15 it worked just fine. It must be on the clang/llvm side something got messed up recently.

$ port -v installed postgresql14
The following ports are currently installed:
  postgresql14 @14.8_0+clang15+llvm+perl+python3+tcl requested_variants='+clang15+llvm+perl+python3+tcl' platform='darwin 19' archs='x86_64' date='2023-05-31T14:31:01+0200'
  postgresql14 @14.9_0+clang14+llvm+perl+python3+tcl (active) requested_variants='+clang14+llvm+perl+python3+tcl' platform='darwin 19' archs='x86_64' date='2023-09-13T13:12:42+0200'
. . .
$ port -v installed postgresql15
The following ports are currently installed:
  postgresql15 @15.4_0+clang14+llvm+perl+python3+tcl (active) requested_variants='+clang14+llvm+perl+python3+tcl' platform='darwin 19' archs='x86_64' date='2023-09-13T13:22:18+0200'
. . .

Tl;Dr:

Building postgresql 14 and 15 with +llvm now works on MacOS 10.15.7, as long as it is combined with +clang14 or earlier.

comment:7 Changed 7 months ago by dgilman (David Gilman)

Resolution: fixed
Status: assignedclosed

In bfbd57e500d63729bd89d599cfc23b3232abf387/macports-ports (master):

postgresql16: new port

Closes: #40501
Closes: #37929
Closes: #36511
Closes: #36128
Closes: #33145
Closes: #66529
Closes: #67638
Closes: #29752
Closes: #66689
Closes: #67203
Closes: #67713
Closes: #68119
Closes: #67339

comment:8 Changed 7 months ago by dgilman (David Gilman)

In 50802b3f437f12a0c0b11d39adb4d9ee29e08657/macports-ports (master):

postgresql14: backport fixes

Closes: #67638

comment:9 Changed 7 months ago by dgilman (David Gilman)

In 4c82843b6b0a2031fd2042a3bd1675a0628bd96c/macports-ports (master):

postgresql15: backport fixes

Closes: #67638

Note: See TracTickets for help on using tickets.