Re: PostgreSQL does not compile on macOS SDK 15.0
Aleksander Alekseev <aleksander@timescale.com>
From: Aleksander Alekseev <aleksander@timescale.com>
To: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Stan Hu <stanhu@gmail.com>
Date: 2024-06-25T13:49:32Z
Lists: pgsql-hackers
Attachments
- v1-0001-Dirty-fix.patch (application/octet-stream) patch v1-0001
Hi, > IMO the right way to test PostgreSQL against the recent beta version > of MacOS SDK would be replacing (via a symlink perhaps) the SDK > provided by the "Command Line Tools for Xcode" package > (/Library/Developer/CommandLineTools/SDKs/). Or alternatively finding > the official way of installing the beta version of this package. As it turned out there is Command_Line_Tools_for_Xcode_16_beta.dmg package available. It can be downloaded from https://developer.apple.com/ after logging it. I installed it and also did: ``` cd /Library/Developer/CommandLineTools/SDKs sudo mkdir __ignore__ sudo mv MacOSX14.* __ignore__ ``` ... to make sure Postgres will not find the older version of SDK (it did until I made this step). Now I get the following output from `meson --setup ...`: ``` The Meson build system Version: 0.61.2 Source dir: /Users/eax/projects/c/postgresql Build dir: /Users/eax/projects/c/postgresql/build Build type: native build Project name: postgresql Project version: 17beta2 C compiler for the host machine: cc (clang 16.0.0 "Apple clang version 16.0.0 (clang-1600.0.20.10)") C linker for the host machine: cc ld64 1115.5.3 Host machine cpu family: x86_64 Host machine cpu: x86_64 Run-time dependency threads found: YES Message: darwin sysroot: /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk ... ``` ... and get the error reported by Stan. Also I can confirm that the proposed workaround fixes it. Attached is the result of `git format-patch` for convenience. Personally I'm not extremely happy with this workaround though. An alternative solution would be adding the "pg_" prefix to our type declarations. Another question is whether we should fix this while the SDK is in beta or only after it is released. Thoughts? I added the patch to the nearest commitfest so that it wouldn't be lost [1]. [1]: https://commitfest.postgresql.org/48/5073/ -- Best regards, Aleksander Alekseev
Commits
-
Cope with <regex.h> name clashes.
- 9c273679b36b 17.0 landed
- 31423bc4489d 16.4 landed
- 467d77bb1634 15.8 landed
- c2342a925b70 14.13 landed
- 440aedc0fb18 13.16 landed
- 274a8195d479 12.20 landed
- 2a5ef0983040 18.0 landed