feat(flake): build comment-checker from source, drop fetchurl hashes - #83
Merged
Conversation
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.
Summary
The flake now builds the
comment-checkerbinary from this repo's own source viarustPlatform.buildRustPackage, pinned to the repository'srust-toolchain.tomltoolchain. Previously the flake downloaded a GitHub release asset through a fixed-outputfetchurland baked its four SRI hashes into the flake; when the release assets were re-uploaded, those hashes drifted and the flake served a stale binary for weeks without any gate noticing (#81).With a source build there is no hash to drift, and no stale fork can re-enter: the derivation always carries the current tree. The release-then-sync machinery is deleted (the sync script itself, the SRI helpers, the hash check and its error classes, the release-side sync step). The version binding stays so the existing version-sync surface keeps bumping it in lockstep with npm and cargo.
Why a source build
github:systemfsoftware/comment-checkeras the repo's own source) would freeze the version and cyclenix flake update— measured, rejected.doCheck = falsein the derivation: crate tests run in CI, not inside the nix build (and no tests ride the flake gate).Cargo.toml,Cargo.lock,crates/, and.cargo/in the store source, so the derivation builds exactly the pinned manifest.CI nix gate
The new
nixjob on pull requests and master now does all three:nix flake check— evaluation of the flake.nix build --no-link .#packages.x86_64-linux.comment-checker-bwrap— a real build of the shipped derivation. (Eval-only gating is what let a droppedCargo.tomlslip past in review; the gate now compiles the actual binary.)--versionequals the workspaceCargo.tomlversion, so the next release cannot ship a flake that reports a different version than npm/cargo.Validation
nix build --no-link .#comment-checkercompiles end-to-end under the pinned toolchain (exit 0).check-versions: ok npm=0.3.2 workspace=0.3.2. The review that caught the filter and gate defects ran both the fixed derivation build and the eval-only failure mode locally before the fixes.Related: #81