Skip to content

Expose host-native CLI binary as the default flake package#126

Merged
adamwg merged 1 commit into
crossplane:mainfrom
negz:default-to-go
Jun 18, 2026
Merged

Expose host-native CLI binary as the default flake package#126
adamwg merged 1 commit into
crossplane:mainfrom
negz:default-to-go

Conversation

@negz

@negz negz commented Jun 18, 2026

Copy link
Copy Markdown
Member

Description of your changes

Fixes #125

The default package was the full release bundle: the CLI cross-compiled for all seven platforms, laid out under bin/<os>_<arch>/crossplane. This made nix build and nix run unhelpful for anyone consuming the CLI from another flake. nix run couldn't find a binary to run, and producing one binary meant a from-source build of all seven, six of which you'd throw away.

This PR makes default the host-native binary, built for the system Nix is running on, so nix build and nix run give you a single binary for your own machine. The multi-platform bundle moves to a new package named release.

The per-platform builder already existed to assemble the bundle, so default just wraps it for the host, deriving GOOS and GOARCH from stdenv.hostPlatform. The CI build-artifacts job now builds .#release explicitly so it still produces and uploads the full bundle. The push-artifacts app already referenced the release derivation directly, so the S3 push and promote flows are unaffected.

I have:

Need help with this checklist? See the cheat sheet.

The default package was the full release bundle: the CLI cross-compiled
for all seven platforms, laid out under bin/<os>_<arch>/crossplane. This
made nix build and nix run unhelpful for anyone consuming the CLI from
another flake. nix run couldn't find a binary to run, and producing one
binary meant a from-source build of all seven, six of which you'd throw
away.

This change makes default the host-native binary, built for the system
Nix is running on, so nix build and nix run give you a single binary for
your own machine. The multi-platform bundle moves to a new package named
release.

The per-platform builder already existed to assemble the bundle, so
default just wraps it for the host, deriving GOOS and GOARCH from
stdenv.hostPlatform. The CI build-artifacts job now builds .#release
explicitly so it still produces and uploads the full bundle. The
push-artifacts app already referenced the release derivation directly,
so the S3 push and promote flows are unaffected.

Fixes crossplane#125.

Signed-off-by: Nic Cope <nicc@rk0n.org>
@negz negz requested review from a team, jcogilvie and tampakrap as code owners June 18, 2026 05:19
@negz negz requested review from jbw976 and removed request for a team June 18, 2026 05:19
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 366db893-5eac-4c04-b0d2-2ca2aff87aab

📥 Commits

Reviewing files that changed from the base of the PR and between 62cadf8 and 5466a88.

⛔ Files ignored due to path filters (1)
  • nix/build.nix is excluded by none and included by none
📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • flake.nix

📝 Walkthrough

Walkthrough

flake.nix reassigns packages.<system>.default to build.binary (host-native binary) and adds a new packages.<system>.release attribute for the multi-platform bundle via build.release. The CI workflow's "Build Artifacts" step is updated to explicitly target .#release instead of the implicit default.

Changes

Flake default/release split and CI update

Layer / File(s) Summary
Split flake packages.default / packages.release and wire CI
flake.nix, .github/workflows/ci.yml
packages.<system>.default is repointed from build.release to build.binary { inherit version; }, a new packages.<system>.release attribute is defined using build.release { inherit version goPlatforms; }, and the CI "Build Artifacts" step is updated to invoke nix build .#release to consume the renamed bundle target.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and accurately describes the main change: exposing the host-native CLI binary as the default flake package, meeting the descriptive requirement under 72 characters.
Description check ✅ Passed The PR description is directly related to the changeset, providing thorough context about the motivation, implementation details, and affected CI workflows.
Linked Issues check ✅ Passed The PR fully addresses the objectives from issue #125: exposes host-native binary as default, moves multi-platform bundle to release package, and updates CI to build .#release explicitly.
Out of Scope Changes check ✅ Passed All changes are directly related to the objectives: updating flake.nix to restructure packages and modifying CI to reference the new release package explicitly.
Breaking Changes ✅ Passed This PR only modifies flake.nix and .github/workflows/ci.yml for Nix build configuration. No changes to files under apis/** or cmd/** remove/rename public fields/flags, add required fields/flags, o...
Feature Gate Requirement ✅ Passed PR only changes Nix flake package structure (default→binary, added release→bundle); no APIs affected, no experimental features added.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@adamwg adamwg merged commit 06c4f4a into crossplane:main Jun 18, 2026
10 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.

Flake should expose the host-native CLI binary as default

2 participants