feat(build): add fully-static musl fj binary #61

Merged
Claude-Run merged 1 commit from feat/FJCLI-46-static-musl-build into main 2026-07-02 16:27:32 +02:00
Member

Port the fully-static x86_64-unknown-linux-musl build from the old forgejo-mcp repo to the merged fj binary so the combined CLI + fj mcp serve runs on any Linux host without a matching glibc/OpenSSL.

oci-build/Dockerfile.static adapts the glibc Dockerfile to the workspace: it adds the musl rustup target and musl-tools inline on the glibc builder image (no rust-builder-musl image exists yet), sets musl-gcc as the C compiler/linker with OPENSSL_STATIC=1, and builds all four workspace crates for the musl target with --features update-check. OpenSSL is vendored via a new musl-target openssl dep in crates/fj/Cargo.toml; libgit2/libssh2/zlib fall back to their bundled sources because the cross-target triple makes pkg-config skip system probing. The result links OpenSSL/libgit2/libssh2/zlib statically (verified: file reports static-pie, ldd reports statically linked).

.forgejo/workflows/build-binary-static.yml mirrors build-binary.yml (dry-run/release/latest trains, write-once release semantics, per-arch latest manifest) and publishes fj-linux-x86_64-static plus a .sha256 sidecar on the same trains as the glibc artifact.

crates/fj/src/version.rs latest_arch() maps a musl BUILD_TARGET to the linux-x86_64-static arch and fj-linux-x86_64-static artifact, so a static binary self-updates to another static build and reads its own version-linux-x86_64-static.json manifest.

#FJCLI-46

Port the fully-static x86_64-unknown-linux-musl build from the old forgejo-mcp repo to the merged `fj` binary so the combined CLI + `fj mcp serve` runs on any Linux host without a matching glibc/OpenSSL. oci-build/Dockerfile.static adapts the glibc Dockerfile to the workspace: it adds the musl rustup target and musl-tools inline on the glibc builder image (no rust-builder-musl image exists yet), sets musl-gcc as the C compiler/linker with OPENSSL_STATIC=1, and builds all four workspace crates for the musl target with --features update-check. OpenSSL is vendored via a new musl-target `openssl` dep in crates/fj/Cargo.toml; libgit2/libssh2/zlib fall back to their bundled sources because the cross-target triple makes pkg-config skip system probing. The result links OpenSSL/libgit2/libssh2/zlib statically (verified: `file` reports static-pie, `ldd` reports statically linked). .forgejo/workflows/build-binary-static.yml mirrors build-binary.yml (dry-run/release/latest trains, write-once release semantics, per-arch latest manifest) and publishes `fj-linux-x86_64-static` plus a `.sha256` sidecar on the same trains as the glibc artifact. crates/fj/src/version.rs `latest_arch()` maps a musl BUILD_TARGET to the `linux-x86_64-static` arch and `fj-linux-x86_64-static` artifact, so a static binary self-updates to another static build and reads its own `version-linux-x86_64-static.json` manifest. #FJCLI-46
feat(build): add fully-static musl fj binary
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 1m7s
Create release / Create release from merged PR (pull_request) Has been skipped
7b655757ff
Port the fully-static x86_64-unknown-linux-musl build from the old forgejo-mcp repo to the merged `fj` binary so the combined CLI + `fj mcp serve` runs on any Linux host without a matching glibc/OpenSSL.

oci-build/Dockerfile.static adapts the glibc Dockerfile to the workspace: it adds the musl rustup target and musl-tools inline on the glibc builder image (no rust-builder-musl image exists yet), sets musl-gcc as the C compiler/linker with OPENSSL_STATIC=1, and builds all four workspace crates for the musl target with --features update-check. OpenSSL is vendored via a new musl-target `openssl` dep in crates/fj/Cargo.toml; libgit2/libssh2/zlib fall back to their bundled sources because the cross-target triple makes pkg-config skip system probing. The result links OpenSSL/libgit2/libssh2/zlib statically (verified: `file` reports static-pie, `ldd` reports statically linked).

.forgejo/workflows/build-binary-static.yml mirrors build-binary.yml (dry-run/release/latest trains, write-once release semantics, per-arch latest manifest) and publishes `fj-linux-x86_64-static` plus a `.sha256` sidecar on the same trains as the glibc artifact.

crates/fj/src/version.rs `latest_arch()` maps a musl BUILD_TARGET to the `linux-x86_64-static` arch and `fj-linux-x86_64-static` artifact, so a static binary self-updates to another static build and reads its own `version-linux-x86_64-static.json` manifest.

#FJCLI-46
Claude-Run deleted branch feat/FJCLI-46-static-musl-build 2026-07-02 16:27:32 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pandoras-box/forgejo-cli!61
No description provided.