Add static coglet binaries for Linux - #3184
michaeldwan wants to merge 3 commits into
Conversation
The coglet crate gains a `coglet` executable. It supports `coglet --version`, which prints the crate version; any other arguments print usage and exit 2. `mise run build:coglet:binary` cross-compiles it with cargo-zigbuild for x86_64 and aarch64 musl, producing statically linked executables at dist/coglet_Linux_x86_64 and dist/coglet_Linux_arm64 that run in any Linux image, with or without Python. The musl targets are added to the Rust toolchain in mise.toml. Refs: 346s7yn1v8ww34r6
A `build-coglet-binary` job runs `mise run build:coglet:binary`, checks that the x86_64 binary runs, and uploads both Linux binaries as the CogletBinaries artifact. It is part of the CI Complete gate, so a broken binary build fails CI. Refs: w43pxy6jzvxb6zex
Tagged releases build the static coglet binaries and attach them as coglet_Linux_x86_64 and coglet_Linux_arm64, next to the CLI binaries and wheels. Their sha256 sums are appended to checksums.txt. Refs: tbjybk16tyb19hvv
There was a problem hiding this comment.
Adds static musl coglet binaries (coglet_Linux_x86_64 / coglet_Linux_arm64) via cargo zigbuild, with a new mise run build:coglet:binary task, a CI job that builds/uploads them, and release wiring to attach them and append their checksums. Structure, naming, and reuse of existing COGLET_VERSION are all consistent with the repo. One suggestion below; also noting (not blocking) that this new job is a required ci-complete gate that rebuilds two release-mode musl targets on every PR since dist/ is never present in a fresh checkout.
| run: mise run build:coglet:binary | ||
| - name: Check coglet binary runs | ||
| run: | | ||
| file dist/coglet_Linux_x86_64 dist/coglet_Linux_arm64 |
There was a problem hiding this comment.
The file check prints the binary type but nothing fails if the binaries are dynamically linked — yet "static musl" is the entire point of this artifact. If the musl build ever regresses (e.g. a dependency forces a dynamic link), CI still passes and releases ship non-static binaries. Assert it:
| file dist/coglet_Linux_x86_64 dist/coglet_Linux_arm64 | |
| file dist/coglet_Linux_x86_64 dist/coglet_Linux_arm64 | |
| file dist/coglet_Linux_x86_64 | grep -q "statically linked" | |
| file dist/coglet_Linux_arm64 | grep -q "statically linked" | |
| dist/coglet_Linux_x86_64 --version |
|
Review: 1 finding (1 suggestion). I'm Bonk, and I've done a quick review of your PR. Summary: Adds static musl Findings:
Non-blocking note (not posted): the new Everything else checked out: |
Adds a standalone
cogletexecutable for Linux, built as static musl binaries for x86_64 and arm64. For now it only supportscoglet --version.mise run build:coglet:binarybuildsdist/coglet_Linux_x86_64anddist/coglet_Linux_arm64with cargo-zigbuild.build-coglet-binaryCI job builds both and uploads them as an artifact.checksums.txt.