Skip to content

Mac os x build failed #7

@arrowcircle

Description

@arrowcircle

Hey! When I try to build electricsql locally on macos, it fails trying to compile lib pg query:

src/postgres/src_port_snprintf.c:374:1: error: static declaration of 'strchrnul' follows non-static declaration
  374 | strchrnul(const char *s, int c)
      | ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_string.h:198:9: note: previous declaration is here
  198 |         strchrnul(const char *__s, int __c);
      |         ^
src/postgres/src_port_snprintf.c:438:27: warning: 'strchrnul' is only available on macOS 15.4 or newer [-Wunguarded-availability-new]
  438 |                         const char *next_pct = strchrnul(format + 1, '%');
      |                                                ^~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_string.h:198:9: note: 'strchrnul' has been marked as being introduced in macOS 15.4 here, but the deployment target is macOS 15.0.0
  198 |         strchrnul(const char *__s, int __c);
      |         ^
src/postgres/src_port_snprintf.c:438:27: note: enclose 'strchrnul' in a __builtin_available check to silence this warning
  438 |                         const char *next_pct = strchrnul(format + 1, '%');
      |                                                ^~~~~~~~~
  439 |
  440 |                         /* Dump literal data we just scanned over */
  441 |                         dostr(format, next_pct - format, target);
  442 |                         if (target->failed)
  443 |                                 break;
  444 |
  445 |                         if (*next_pct == '\0')
  446 |                                 break;
  447 |                         format = next_pct;
      |
1 warning and 1 error generated.
make[1]: *** [src/postgres/src_port_snprintf.o] Error 1
make: *** [c_src/libpg_query/libpg_query.a] Error 2
could not compile dependency :pg_query_ex, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile pg_query_ex --force", update it with "mix deps.update pg_query_ex" or clean it with "mix deps.clean pg_query_ex"
==> electric
** (Mix) Could not compile with "make" (exit status: 2).
You need to have gcc and make installed. Try running the
commands "gcc --version" and / or "make --version". If these programs
are not installed, you will be prompted to install them.
gcc --version
Apple clang version 17.0.0 (clang-1700.0.13.3)
Target: arm64-apple-darwin24.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin11.3.0

Any ideas how to fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions