From 87be4d1a52d6bd1680a47153f020affc166d1a07 Mon Sep 17 00:00:00 2001 From: Jade Ellis Date: Thu, 24 Jul 2025 23:22:07 +0100 Subject: [PATCH] feat: Almost-functional musl builds on Alpine Lots of fiddling, still can't get stuff to work Next step is a debian builder copying the static libs from alpine --- Cargo.lock | 23 ++--------------------- Cargo.toml | 2 +- docker/musl.Dockerfile | 5 ++--- 3 files changed, 5 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 837e033a..e5c111d7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -525,24 +525,6 @@ dependencies = [ "which", ] -[[package]] -name = "bindgen" -version = "0.71.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3" -dependencies = [ - "bitflags 2.9.1", - "cexpr", - "clang-sys", - "itertools 0.13.0", - "proc-macro2", - "quote", - "regex", - "rustc-hash 2.1.1", - "shlex", - "syn", -] - [[package]] name = "bindgen" version = "0.72.0" @@ -4146,7 +4128,7 @@ dependencies = [ [[package]] name = "rust-librocksdb-sys" version = "0.38.0+10.4.2" -source = "git+https://forgejo.ellis.link/continuwuation/rust-rocksdb-zaidoon1?rev=01e1128898fc4bbb776e7a6deec2aa3b675b0442#01e1128898fc4bbb776e7a6deec2aa3b675b0442" +source = "git+https://forgejo.ellis.link/continuwuation/rust-rocksdb-zaidoon1?rev=99b0319416b64830dd6f8943e1f65e15aeef18bc#99b0319416b64830dd6f8943e1f65e15aeef18bc" dependencies = [ "bindgen 0.72.0", "bzip2-sys", @@ -4163,7 +4145,7 @@ dependencies = [ [[package]] name = "rust-rocksdb" version = "0.42.1" -source = "git+https://forgejo.ellis.link/continuwuation/rust-rocksdb-zaidoon1?rev=01e1128898fc4bbb776e7a6deec2aa3b675b0442#01e1128898fc4bbb776e7a6deec2aa3b675b0442" +source = "git+https://forgejo.ellis.link/continuwuation/rust-rocksdb-zaidoon1?rev=99b0319416b64830dd6f8943e1f65e15aeef18bc#99b0319416b64830dd6f8943e1f65e15aeef18bc" dependencies = [ "libc", "rust-librocksdb-sys", @@ -6347,7 +6329,6 @@ version = "2.0.15+zstd.1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb81183ddd97d0c74cedf1d50d85c8d08c1b8b68ee863bdee9e706eedba1a237" dependencies = [ - "bindgen 0.71.1", "cc", "pkg-config", ] diff --git a/Cargo.toml b/Cargo.toml index e95567bd..e7abca01 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -391,7 +391,7 @@ features = [ [workspace.dependencies.rust-rocksdb] git = "https://forgejo.ellis.link/continuwuation/rust-rocksdb-zaidoon1" -rev = "01e1128898fc4bbb776e7a6deec2aa3b675b0442" +rev = "99b0319416b64830dd6f8943e1f65e15aeef18bc" default-features = false features = [ "multi-threaded-cf", diff --git a/docker/musl.Dockerfile b/docker/musl.Dockerfile index b55aecb0..2221525b 100644 --- a/docker/musl.Dockerfile +++ b/docker/musl.Dockerfile @@ -13,7 +13,7 @@ FROM --platform=$BUILDPLATFORM rust:${RUST_VERSION}-alpine${ALPINE_VERSION} AS t RUN --mount=type=cache,target=/etc/apk/cache apk add \ build-base pkgconfig make jq bash \ curl git file \ - llvm-dev clang clang-dev lld + llvm-dev clang clang-static lld # Developer tool versions @@ -37,8 +37,7 @@ COPY --from=xx / / ARG TARGETPLATFORM # Install libraries linked by the binary -RUN --mount=type=cache,target=/etc/apk/cache xx-apk add musl-dev liburing-dev clang-dev - +RUN --mount=type=cache,target=/etc/apk/cache xx-apk add musl-dev gcc g++ liburing-dev # Set up Rust toolchain WORKDIR /app