Repository navigation
fix: release binaries that run without Nix - #26
Merged
Merged
Conversation
The release binaries were built with Nix and loaded libraries from /nix/store: libiconv on macOS, the dynamic loader on Linux. They only started on machines with those exact Nix paths. Build them with plain cargo on the GitHub runners instead: macOS for Apple Silicon and Intel, and static musl binaries for x86-64 and arm64 Linux, which run on any distribution. Name them after their target (e.g. keysafe-aarch64-apple-darwin), so `cargo binstall keysafe` downloads them. The binaries are now built on every CI run and checked to start on their own, not only when a release is cut. The README installs from crates.io and shows the crates.io badges.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The 0.3.0 release binaries only run on machines with Nix:
keysafe-aarch64-darwin/nix/store/…-libiconv/lib/libiconv.2.dylibkeysafe-x86_64-linux/nix/store/…-glibc/lib/ld-linux-x86-64.so.2On any other machine they fail to start. crates.io is not affected, since
cargo installbuilds locally.Fix
Build with plain cargo on the GitHub runners, not
nix build:ubuntu-latestx86_64-unknown-linux-muslubuntu-24.04-armaarch64-unknown-linux-muslmacos-15aarch64-apple-darwinmacos-15x86_64-apple-darwinAssets are named after their target (
keysafe-<target>). With[package.metadata.binstall]inCargo.toml,cargo binstall keysafeinstalls the prebuilt binary, from the next release on.The binaries are built on every CI run, not only on releases, and each is checked to start on its own: static on Linux, and no
/nix/storeinotool -Lon macOS. They're uploaded only when a release is created.The Nix package (
nix profile install github:keysafe-dev/keysafe) is unchanged.README
cargo install keysafe,cargo binstall keysafe, Nix, and acurldownload using thereleases/latest/downloadURL.This is a
fix:, so release-please will propose 0.3.1 with working downloads.