Skip to content

[misc] Kvrocks building problems and solutions on Alpine Linux #2758

@err931

Description

@err931

Search before asking

  • I had searched in the 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 suggests using libdwarf for symbol resolution, which should be set as the default option.

  1. #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
#ifdef __GLIBC__
#include <execinfo.h>
#endif
  1. 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions