eBay / Jungle

An embedded key-value store library specialized for building state machine and log store
Apache License 2.0
224 stars 54 forks source link

alpine musl build error #143

Open calvin2021y opened 2 years ago

calvin2021y commented 2 years ago
In file included from jungle/src/logger.cc:24:

jungle/src/backtrace.h:36:10: fatal error: 'execinfo.h' file not found
#include <execinfo.h>
         ^~~~~~~~~~~~
calvin2021y commented 2 years ago

@greensky00

any tips to fix this ?

greensky00 commented 2 years ago

@calvin2021y Sorry for the late reply. Actually backtrace.h was intended to work on either x86 Linux or Mac, so it should be disabled on platforms that do not support it (execinfo.h). Let me add a compiler flag to manually disable it, and push the PR shortly.

calvin2021y commented 2 years ago

alpine and musl do support backtrace and unwind, but some header is diff from glibc.

greensky00 commented 2 years ago

@calvin2021y Please check if https://github.com/eBay/Jungle/pull/145 and adding -DLOGGER_NO_BACKTRACE=1 flag works for you.

calvin2021y commented 2 years ago

Thanks for the solution.

alpine is fixed for x86 and aarch64.

macOS show this error:

jungle/src/backtrace.h:330:24: error: use of undeclared identifier 'abi'
            char *cc = abi::__cxa_demangle(func_mangled.c_str(), 0, 0, &status);

maybe need change to this:

#include <cxxabi.h>
#ifndef LOGGER_NO_BACKTRACE
#include <execinfo.h>
#endif
greensky00 commented 2 years ago

Now it should work on Mac with the flag, please check it again.

calvin2021y commented 2 years ago

Thanks for the update. some how I can not apply https://github.com/eBay/Jungle/pull/145.patch

check from the code it should be fixed. I will update and test late after you merge.

calvin2021y commented 2 years ago

one question about Log store mode:

it only can append data into store with a bigger SN. (can be discontinuous)

it can not delete by SN number, but can truncation by SN number ?

I also want to know if there will be supported with IO_uring async DISK io instead thread.

greensky00 commented 2 years ago

it can not delete by SN number, but can truncation by SN number ?

Right, it is not possible to delete a sequence number in the middle; you can only truncate it.

And currently there is no support for AsyncIO.