Skip to content

Feature: Compile statically to musl #119

Open
@ruffnext

Description

@ruffnext

Is your feature request related to a problem?

The currently required glibc version is too high (GLIBC 2.38)

$ strings libsurrealdb.so | grep GLIBC_2.38
GLIBC_2.38

However, the latest Debian LTS(debian 12) only supports glibc up to 2.35

Which causes it to fail to start on most environments.

At the same time, this also makes the it unable to run in the Alpine container, because Alpine uses musl

Describe the solution

Compile statically to musl, use following command to compile

RUSTFLAGS="-C target-feature=-crt-static" cargo build --release --target x86_64-unknown-linux-musl

Alternative methods

To avoid glibc issue, I upgraded my docker from debian:12 to debian:testing.

SurrealDB version

surreal 2.2.2 for linux on amd64

SurrealDB Java SDK version

surrealdb.java 1.0.0 for linux on amd64 using OpenJDK 17

Contact Details

[email protected]

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct (repository /surrealdb.java)

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions