comdb2
comdb2 copied to clipboard
Fix compilation errors on macOS
This fixes a bunch of compilation errors on macOS. As these patches treat macOS as it was a Linux target, it is possible that some of the platform-specific definitions will not work 100% the same way as they do on Linux, but I could successfully start a server:
$ sudo ./comdb2 asdf
[ERROR] getaddrinfo: nodename nor servname provided, or not known
[ERROR] getaddrinfo: nodename nor servname provided, or not known
FULL CLUSTER CACHE COHERENCY
LOG DELETE ENABLED
LOG DELETE POLICY: delete all eligible log files
Recovery pass #0
.. done
Recovery pass #1
running forward pass from 1:1421516 -> 1:1427372
0% 10% 20% 60% 70% 80% 90% 100% .. done
Recovery pass #2
running backward pass from 1:1421516 <- 1:1427372
0% 40% 50% 60% 70% 100% .. done
Recovery pass #3
running forward pass from 1:1421480 -> 1:1427372
0% 10% 20% 60% 70% 80% 90% 100% .. done
Libevent 2.1.12-stable with backend method kqueue
unix_connect unix fd:30
process_reg_reply: svc:replication accepting on unix socket fd:30
bdb_open_int line 5945 calling rep_start as master with egen 8
I AM NEW MASTER NODE <redacted>
user authentication disabled (bdberr: 15)
DBA user 'dba' already exists
I AM READY.
Thanks @lkollar . #3245 fixes those compilation warnings. I'll get that one in first, and this one can follow - hopefully while keeping -Werror
@lkollar - can you see if this builds for you now without errors while keeping -Werror
?
It builds for me with
/Users/mponomarenko/comdb2/src $ gcc -v
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: x86_64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
There is still a large number of "unsused but set" warnings when compiling on m1 on master. I started fixing them but there are so many, and in some places it's not clear what the correct thing to do is (other than just suppressing it with (void)varname
) so I ended up setting -Wno-unused-but-set-variable
on Clang instead. This is a bit nicer than removing -Werror
. My unfinished attempt at fixing these is in https://github.com/lkollar/comdb2/commit/30d17937e28427862ccde5919ccd7cd2c2b91836 on a different branch if you are interested.
Let me take another stab at the m1 mac warnings. I do use that for development occasionally.
Ok - seeing the warnings you mentioned with a newer XCode. Going through them.