-
-
Notifications
You must be signed in to change notification settings - Fork 253
Description
It is a about old Unix BSD vs. SystemV - POSIX and NFS safe locking problem.
Here:
https://jdebp.uk/Softwares/nosh/guide/commands/setlock.xml
https://news.ycombinator.com/item?id=35882320
and here:
https://stackoverflow.com/questions/59033269/using-flock-on-solaris-5-10
https://www.perkin.org.uk/posts/solaris-portability-flock.html
Please Help (!) needed for building pgbackrest on Solaris 11.4
It is pretty close to complete. (210 object files in ninja-log attached )
It seems because flock() calls, which are not available on POSIX strict compliant systems (like Solaris). It might need at least a build compilation option which uses the POSIX fcntl()-based locking instead of flock()
root@svdpgrxxpp:/build# meson setup --reconfigure /build/pgbackrest /build/pgbackrest-release-2.54.2
The Meson build system
Version: 1.2.2
Source dir: /build/pgbackrest-release-2.54.2
Build dir: /build/pgbackrest
Build type: native build
Project name: pgbackrest
Project version: 2.54.2
C compiler for the host machine: gcc (gcc 14.2.0 "gcc (GCC) 14.2.0")
C linker for the host machine: gcc ld.solaris 5.11-1.3302
Host machine cpu family: x86_64
Host machine cpu: x86_64
Compiler for C supports arguments -Wconversion: YES (cached)
Compiler for C supports arguments -Wduplicated-cond: YES (cached)
Compiler for C supports arguments -Wduplicated-branches: YES (cached)
Compiler for C supports arguments -Wformat-nonliteral: YES (cached)
Compiler for C supports arguments -Wformat=2: YES (cached)
Compiler for C supports arguments -Wformat-signedness: YES (cached)
Compiler for C supports arguments -Wpointer-arith: YES (cached)
Compiler for C supports arguments -Wstrict-prototypes: YES (cached)
Compiler for C supports arguments -Wvla: YES (cached)
Compiler for C supports arguments -Wwrite-strings: YES (cached)
Compiler for C supports arguments -Wno-clobbered: YES (cached)
Compiler for C supports arguments -Wno-missing-field-initializers: YES (cached)
Compiler for C supports arguments -Wno-implicit-fallthrough: YES (cached)
Compiler for C supports arguments -funroll-loops: YES (cached)
Compiler for C supports arguments -ftree-vectorize: YES (cached)
Program python3 found: YES (/usr/bin/python3.11)
Compiler for C supports arguments -fmacro-prefix-map=../pgbackrest-release-2.54.2/src/=: YES (cached)
Compiler for C supports arguments -fmacro-prefix-map=../pgbackrest-release-2.54.2/test/src/=test/: YES (cached)
Library backtrace found: NO
Library bz2 found: YES
Dependency liblz4 found: YES 1.9.4 (cached)
Dependency openssl found: YES 1.1.1w (cached)
Dependency libpq found: YES 17.2 (cached)
Dependency libxml-2.0 found: YES 2.11.5 (cached)
Dependency yaml-0.1 found: YES 0.2.5 (cached)
Dependency zlib found: YES 1.2.13 (cached)
Dependency libssh2 found: YES 1.11.0 (cached)
Dependency libzstd found: YES 1.5.6 (cached)
Configuring build.auto.h using configuration
Configuring build.auto.h using configuration
Configuring build.auto.h using configuration
Build targets in project: 10
Found ninja-1.12.1 at /usr/bin/ninja
root@svdpgrxxpp:/build# ninja -C /build/pgbackrest
ninja: Entering directory `/build/pgbackrest'
[177/248] Compiling C object src/pgbackrest.p/common_lock.c.o
FAILED: src/pgbackrest.p/common_lock.c.o
gcc -Isrc/pgbackrest.p -Isrc -I../pgbackrest-release-2.54.2/src -Isrc/command/help -Isrc/postgres -I/postgres/product/17.2/include -I/usr/include/libxml2 -fdiagnostics-color=always -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=c99 -O3 -Wconversion -Wduplicated-cond -Wduplicated-branches -Wformat-nonliteral -Wformat=2 -Wformat-signedness -Wpointer-arith -Wstrict-prototypes -Wvla -Wwrite-strings -Wno-clobbered -Wno-missing-field-initializers -Wno-implicit-fallthrough -funroll-loops -ftree-vectorize -fmacro-prefix-map=../pgbackrest-release-2.54.2/src/= -fmacro-prefix-map=../pgbackrest-release-2.54.2/test/src/=test/ -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -MD -MQ src/pgbackrest.p/common_lock.c.o -MF src/pgbackrest.p/common_lock.c.o.d -o src/pgbackrest.p/common_lock.c.o -c ../pgbackrest-release-2.54.2/src/common/lock.c
../pgbackrest-release-2.54.2/src/common/lock.c: In function ‘lockAcquire’:
../pgbackrest-release-2.54.2/src/common/lock.c:198:21: error: implicit declaration of function ‘flock’; did you mean ‘clock’? [-Wimplicit-function-declaration]
198 | if (flock(fd, LOCK_EX | LOCK_NB) == -1)
| ^~~~~
| clock
../pgbackrest-release-2.54.2/src/common/lock.c:198:31: error: ‘LOCK_EX’ undeclared (first use in this function); did you mean ‘LOCK_HELD’?
198 | if (flock(fd, LOCK_EX | LOCK_NB) == -1)
| ^~~~~~~
| LOCK_HELD
../pgbackrest-release-2.54.2/src/common/lock.c:198:31: note: each undeclared identifier is reported only once for each function it appears in
../pgbackrest-release-2.54.2/src/common/lock.c:198:41: error: ‘LOCK_NB’ undeclared (first use in this function)
198 | if (flock(fd, LOCK_EX | LOCK_NB) == -1)
| ^~~~~~~
../pgbackrest-release-2.54.2/src/common/lock.c: In function ‘lockRead’:
../pgbackrest-release-2.54.2/src/common/lock.c:311:27: error: ‘LOCK_EX’ undeclared (first use in this function); did you mean ‘LOCK_HELD’?
311 | if (flock(fd, LOCK_EX | LOCK_NB) == 0)
| ^~~~~~~
| LOCK_HELD
../pgbackrest-release-2.54.2/src/common/lock.c:311:37: error: ‘LOCK_NB’ undeclared (first use in this function)
311 | if (flock(fd, LOCK_EX | LOCK_NB) == 0)
| ^~~~~~~
[210/248] Compiling C object src/pgbackrest.p/config_parse.c.o
ninja: build stopped: subcommand failed.