err931 opened a new issue, #2758:
URL: https://github.com/apache/kvrocks/issues/2758

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/kvrocks/issues) and found no similar issues.
   
   
   ### Motivation
   
   Driven by my intellectual curiosity, I experimented with building Kvrocks on 
Alpine Linux, which uses `musl libc` as its C library. During this process, I 
encountered several build errors, and I would like to share the solutions I 
discovered with the Kvrocks development team.
   
   ## Version
   
   - Kvrocks: v2.11.0
   
   ## Specs
   
   - OS: Alpine Linux 3.21.2
   - Compiler: gcc (Alpine 14.2.0)
   
   ## Error Details
   
   1. **Backtrace unavailable.**
   
    Since `libbacktrace` is an extension of glibc and not defined in `musl 
libc`, the line `find_package(Backtrace REQUIRED)` in `CMakeLists.txt` should 
be removed. Additionally, the dependency 
[cpptrace](https://github.com/jeremy-rifkin/cpptrace#library-back-ends) 
suggests using `libdwarf` for symbol resolution, which should be set as the 
default option.
   
   2. **`#include <execinfo.h>` unavailable in musl.**
   
    This header file is not available in `musl libc`. Adding a guard as shown 
below can resolve the issue:
   
   - **`src/cli/signal_util.h`**
   
   ```cpp
   #ifdef __GLIBC__
   #include <execinfo.h>
   #endif
   ```
   
   3. **`google/glog v0.7.x` causes build errors with `musl libc`.**
   
    **This is an issue on the `google/glog v0.7.x` side, not Kvrocks.** We need 
to wait for bug fixes from the dependent library.
   
   Best regards,
   
   ### Solution
   
   mentioned above
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to