build: Calculate checksums after the nix fixup phase - #235
Conversation
crossplane/crossplane#7467 reported that checksums for the amd64 crank binaries in our releases are incorrect. It turns out this applies to both the CLI (now the crossplane binary from this repository) and the core crossplane controller binary (the crossplane binary in c/c). The issue is that Nix strips binaries in its `fixup` build phase, which runs after our `postInstall` hook. The stripping applies only to binaries for the host architecture, which in our release actions is always amd64. Calculate checksums in the `postFixup` phase so that we checksum the already stripped binary. Add a checksum verification step before uploading artifacts to catch any similar issues in the future. Signed-off-by: Adam Wolfe Gordon <awg@upbound.io>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe CI workflow adds validation for generated artifacts by comparing each file’s SHA-256 digest with its adjacent checksum file and failing the build when a mismatch is detected. ChangesArtifact validation
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
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. Comment |
|
Git push to origin failed for release-2.3 with exitcode 1 |
|
Git push to origin failed for release-2.4 with exitcode 1 |
Description of your changes
crossplane/crossplane#7467 reported that checksums for the amd64 crank binaries in our releases are incorrect. It turns out this applies to both the CLI (now the crossplane binary from this repository) and the core crossplane controller binary (the crossplane binary in c/c).
The issue is that Nix strips binaries in its
fixupbuild phase, which runs after ourpostInstallhook. The stripping applies only to binaries for the host architecture, which in our release actions is always amd64.Calculate checksums in the
postFixupphase so that we checksum the already stripped binary. Add a checksum verification step before uploading artifacts to catch any similar issues in the future.I have:
./nix.sh flake checkto ensure this PR is ready for review.- [ ] Added or updated unit tests.- [ ] Linked a PR or a docs tracking issue to document this change.backport release-x.ylabels to auto-backport this PR.