How to complie and debug FDB (on mac os)?

Hi there ! Excited to see FDB open source .
Unfortunately I could not compile the code that I cloned to the local (after some tries).
Is there any instructions on how to debug the FDB (on mac )?
The Repo is a bit short description on how to compiling and debuging.
Thanks in advance !

I have some experience building FDB on macs. Can you post anything about the problems youā€™ve had or the errors youā€™ve encountered? I may be able to help.

Iā€™m also trying to build from source on my mac but was running into some issues with the python bindings.

Iā€™m trying to build foundationdb from source on Mac, but running into an error in ā€œfdb_python_checkā€

$ make
Checking       hgVersion.h
Checking       fdb_python
bindings/python/fdb/impl.py:1525:38: W606 'async' and 'await' are reserved keywords starting with Python 3.7
bindings/python/fdb/impl.py:1525:68: W606 'async' and 'await' are reserved keywords starting with Python 3.7
bindings/python/fdb/impl.py:1526:38: W606 'async' and 'await' are reserved keywords starting with Python 3.7
bindings/python/fdb/impl.py:1529:38: W606 'async' and 'await' are reserved keywords starting with Python 3.7
bindings/python/fdb/impl.py:1532:60: W606 'async' and 'await' are reserved keywords starting with Python 3.7
make: *** [fdb_python_check] Error 1

Iā€™ve installed the listed requirements:

  • Java 8
  • Mono
  • Boost

But wasnā€™t sure if there were specific Python version requirements.

$ python -V
Python 2.7.14

Ah, nice. It looks like our python style checker has found something! That would be a great issue or PR. I guess they added a new warning or something, and we should probably fix this.

We do offer a compiled Python package on our download page. (It is not available on PyPI at this time. Sorry.) You can also disable the check by either:

  1. Removing fdb_python_check from the dependency list of fdb_python in the Python local makefile (line 32).
  2. Suppressing ā€˜W606ā€™ from the warning check by adding it to the ā€œignoreā€ list of setup.cfg.

Neither one of those are probably the right thing to do long term, but hopefully, it is enough to get you unstuck.

thanks !
I follow the repo instruction :
1.make $BOOOSTDIR for boost 1.52.0
2.download and install mono (vistual studio channel on)
3. run make
then :
MacBook-Pro:foundationdb xiejk$ pwd
/Users/xiejk/work/goproject/src/github.com/foundationdb
MacBook-Pro:foundationdb xiejk$ make
Makefile:145: flow/actorcompiler/generated.mk: No such file or directory
Makefile:145: flow/coveragetool/generated.mk: No such file or directory
Makefile:145: fdbclient/vexillographer/generated.mk: No such file or directory
Makefile:145: flow/generated.mk: No such file or directory
Makefile:145: fdbrpc/generated.mk: No such file or directory
Makefile:145: fdbclient/generated.mk: No such file or directory
Makefile:145: fdbbackup/generated.mk: No such file or directory
Makefile:145: fdbserver/generated.mk: No such file or directory
Makefile:145: fdbcli/generated.mk: No such file or directory
Makefile:145: bindings/c/generated.mk: No such file or directory
Makefile:145: bindings/java/generated.mk: No such file or directory
Makefile:145: fdbmonitor/generated.mk: No such file or directory
Makefile:145: bindings/flow/tester/generated.mk: No such file or directory
Makefile:145: bindings/flow/generated.mk: No such file or directory
Makefile:145: FDBLibTLS/generated.mk: No such file or directory
Creating FDBLibTLS/generated.mk
Creating bindings/flow/generated.mk
Creating bindings/flow/tester/generated.mk
Creating fdbmonitor/generated.mk
Creating bindings/java/generated.mk
Creating bindings/c/generated.mk
Creating fdbcli/generated.mk
Creating fdbserver/generated.mk
Creating fdbbackup/generated.mk
Creating fdbclient/generated.mk
Creating fdbrpc/generated.mk
Creating flow/generated.mk
Creating fdbclient/vexillographer/generated.mk
Creating flow/coveragetool/generated.mk
Creating flow/actorcompiler/generated.mk
Building bin/actorcompiler.exe
make: /usr/bin/dmcs: No such file or directory
make: *** [bin/actorcompiler.exe] Error 1

and this is only the make stage .
I still do not know how to debug it .
PS:
use which ide and set what parameters

That appears to be an issue with our use of mono. Try changing line 18 of the Makefile to MCS := $(shell which mcs) (instead of dmcs). I believe that mcs is the preferred tool for newer versions of mono. This might be a good PR, too, if that fixes it, but, if Iā€™m honest, Iā€™m not an expert on whatā€™s doing with the mono project at the moment.

thanks for hint .
fixed it .
use export PATH=/Library/Frameworks/Mono.framework/Versions/Current/bin/:${PATH}
seems after installing mono the default bin file not located in /usr/bin
But another error occurs:
fdbserver/OldTLogServer.actor.cpp:439:4: error: ā€˜~LogDataā€™ has a non-throwing exception specification but can still throw [-Werror,-Wexceptions]
ASSERT(tLogData->bytesDurable <= tLogData->bytesInput);
^
./flow/Error.h:84:81: note: expanded from macro ā€˜ASSERTā€™
#define ASSERT( condition ) if (!((condition) || isAssertDisabled(LINE))) { throw internal_error(); }
^
fdbserver/OldTLogServer.actor.cpp:435:3: note: destructor has a implicit non-throwing exception specification
~LogData() {
^
1 error generated.
make: *** [.objs/fdbserver/OldTLogServer.actor.g.cpp.o] Error 1

I believe that this is the same problem that is raised in issue #207. GitHub user spullara suggests that it has something to do with a newer version of clang turning a warning into an error, and he has a proposed patch to get you unstuck.

Good to know . thanks !

A fix to which I just merged. (Thanks @schafdog!)

Hi everyone.
Iā€™m from Wavefront team.
I have just cloned FoundationDB from master, but couldnā€™t compile it. It shows this error

Compiling fdbrpc/TLSConnection.actor.g.cpp
fdbrpc/TLSConnection.actor.cpp:363:16: error: passing an object that undergoes default argument promotion to ā€˜va_startā€™ has undefined behavior [-Werror,-Wvarargs]
va_start( ap, is_error );
^
fdbrpc/TLSConnection.actor.cpp:348:74: note: parameter of type ā€˜boolā€™ is declared here
static void TLSConnectionLogFunc( const char* event, void* uid_ptr, bool is_error, ā€¦ ) {
^
1 error generated.
make: *** [.objs/fdbrpc/TLSConnection.actor.g.cpp.o] Error 1

My OS is macOS and I have all requirements(boost, xcode, mono, jdk).

Can you help me to figure out the error and compile it?

Regards,
Harutyun H.

If you arenā€™t interested in working through all of the warnings-turned-errors, then Iā€™d suggest just removing the -Werror from the Makefile and building.

But be cautioned that running on MacOS isnā€™t a thing thatā€™s done frequently, and thereā€™s signs that it might need some love. A previous MacOS thread suggests that simulation is probably still crashing, which means actually doing development on MacOS would first require fixing simulation, and thereā€™s a bug report open for crashes in fdbcli as well.

Iā€™d suggest building and developing via Docker for Mac with the provided Dockerfile.

1 Like