feat(build): add fully-static musl fj binary #61
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/FJCLI-46-static-musl-build"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Port the fully-static x86_64-unknown-linux-musl build from the old forgejo-mcp repo to the merged
fjbinary so the combined CLI +fj mcp serveruns 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
openssldep 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:filereports static-pie,lddreports 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-staticplus a.sha256sidecar on the same trains as the glibc artifact.crates/fj/src/version.rs
latest_arch()maps a musl BUILD_TARGET to thelinux-x86_64-staticarch andfj-linux-x86_64-staticartifact, so a static binary self-updates to another static build and reads its ownversion-linux-x86_64-static.jsonmanifest.#FJCLI-46