Skip to content

build(ci): switch Linux release binaries to musl static linking - #56

Merged
aptend merged 1 commit into
matrixorigin:mainfrom
aptend:build/musl-static-binary
Mar 19, 2026
Merged

aptend merged 1 commit into
matrixorigin:mainfrom
aptend:build/musl-static-binary

Conversation

@aptend

@aptend aptend commented Mar 19, 2026 •

Copy link
Copy Markdown
Collaborator

What type of PR is this?

  • build / ci (build or CI changes)

Which issue(s) this PR fixes

Fixes #

What this PR does / why we need it

Switch Linux release binaries from dynamically-linked glibc (-gnu) to
fully static musl (-musl), eliminating glibc version compatibility issues.

Problem

The x86_64-unknown-linux-gnu binary compiled on ubuntu-latest (glibc 2.39)
cannot run on older systems (e.g. CentOS 7 / glibc 2.17, Ubuntu 20.04 / glibc 2.31).
Verified locally:

# gnu binary on CentOS 7 (glibc 2.17):
GLIBC_2.27 not found, GLIBC_2.29 not found, ... GLIBC_2.39 not found → crash

# musl binary on same system:
memoria 0.2.0 → works

No OpenSSL changes needed — project already uses rustls + reqwest/rustls-tls.

Changes

  • CI (release-rust.yml): change Linux targets to x86_64-unknown-linux-musl
    and aarch64-unknown-linux-musl; add strip step (binary: ~27 MB → ~22 MB);
    install binutils-aarch64-linux-gnu for aarch64 strip support
  • Cross.toml: update target section to aarch64-unknown-linux-musl
  • Makefile (memoria/Makefile): add build-musl, build-aarch64-musl,
    build-all-musl targets for local cross-compilation mirroring CI;
    aarch64 uses CARGO_TARGET_DIR=target/cross to avoid glibc cache conflicts
    between native and cross builds
  • Install scripts: update resolve_target in scripts/install.sh and
    plugins/openclaw/scripts/install-openclaw-memoria.sh to use musl triple
  • Docs: update README.md and skills/setup/SKILL.md download examples

- Change x86_64/aarch64 Linux release targets from gnu to musl to
  produce fully static binaries with no glibc dependency
- Add strip step in CI Package job to reduce binary size (~27MB → ~22MB)
- Add binutils-aarch64-linux-gnu install step for aarch64 strip support
- Add build-musl / build-aarch64-musl / build-all-musl targets to
  memoria/Makefile for local cross-compilation (mirrors CI exactly);
  aarch64 uses a separate CARGO_TARGET_DIR to avoid glibc cache conflicts
  between native and cross builds
- Update Cross.toml target section to aarch64-unknown-linux-musl
- Update install scripts (scripts/install.sh,
  plugins/openclaw/scripts/install-openclaw-memoria.sh) to resolve
  correct musl target triple when downloading release binaries
- Update README.md and skills/setup/SKILL.md download examples

Made-with: Cursor
@aptend
aptend force-pushed the build/musl-static-binary branch from 832f7b9 to 9942d8c Compare March 19, 2026 10:22
@aptend
aptend enabled auto-merge (squash) March 19, 2026 10:24
@aptend
aptend disabled auto-merge March 19, 2026 10:28
@aptend
aptend merged commit b651cd1 into matrixorigin:main Mar 19, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant