-
Notifications
You must be signed in to change notification settings - Fork 28
Compilation Error on macOS Sequoia 15.4 Due to strchrnul Conflict #88
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
Comments
Ran into this issue but the node_modules/libpg-query/build... isn't available as it isn't built yet. Haven't found a solution to install libpg-query on 15.4 yet. |
It seems like the |
Our team is facing this issue. As a workaround I had to run a Linux container and work on it using Remote Explorer in VSCode. We'd be really grateful for a new version released using the versión of libpg_query compatible with Mac Os 15.4 |
we have a few devs blocked by this compilation/build step on a repo, any updates on when a new version of this library will be published? |
Hi there,
I'm encountering a compilation error when attempting to install
libpg-query-node
on macOS Sequoia 15.4. This issue appears to stem from a recent change in the macOS system headers, which now include thestrchrnul
function, conflicting with the version defined within the library.Below, I've outlined the details of the issue, including the environment, reproduction steps, error message, root cause, a suggested fix, a temporary workaround, and references to similar problems in other projects. I hope this information assists in resolving the issue. Please let me know if you need any additional details!
Environment
Steps to Reproduce
libpg-query
.yarn install
to trigger the installation and compilation process.Error Message
During the build process with
node-pre-gyp
, the following error occurs:Cause of the Issue
The error arises from a conflict between the
strchrnul
function now provided by macOS 15.4's system headers and the static implementation defined inlibpg-query
. Prior to this macOS version,strchrnul
may not have been available in the system, prompting libraries to include their own versions. With Sequoia 15.4, the system's non-static declaration clashes with the library's static one, resulting in a redefinition error.Proposed Solution
To address this, I suggest wrapping the library's
strchrnul
definition in a conditional compilation directive to prevent redefinition when the system already provides it. Here's an example:Additionally, the build configuration should define
HAVE_STRCHRNUL
during compilation on systems like macOS 15.4 wherestrchrnul
is natively available. This approach ensures compatibility across different platforms.Temporary Workaround
As a short-term fix, users can:
node_modules/libpg-query/build/libpg_query/src/postgres/src_port_snprintf.c
.strchrnul
definition.This should allow the compilation to succeed locally until an official fix is released.
Related Issues
This problem isn't isolated to
libpg-query-node
. Similar compilation errors due tostrchrnul
conflicts have been reported in other projects on macOS 15.4, including:These cases reinforce that the issue stems from the updated system headers in macOS Sequoia 15.4.
Additional Note
The root of this issue may lie in the upstream
libpg_query
library, whichlibpg-query-node
depends on. For instance, a related problem was reported in sqlc-dev/sqlc Issue #3916 forpg_query_go
, anotherlibpg_query
wrapper. It might be worth applying the fix in thelibpg_query
repository first (e.g., at github.com/pganalyze/libpg_query) and then updatinglibpg-query-node
to use the patched version.Thank you for taking the time to review this issue. I’m happy to assist further if needed and look forward to a resolution!
The text was updated successfully, but these errors were encountered: