Repository navigation
fix(nix): make the flake build again and check it in CI - #1272
Merged
Merged
Conversation
The README tells Nix users to run `nix run github:kucherenko/jscpd`, but no job builds the flake, and cargo never reads it. The new workflow builds the package, runs it and runs the flake checks on ubuntu and macOS. It runs when the flake, the toolchain or a Cargo manifest changes, and once a week for the rest.
The flake built from the Cargo sources and the HTML templates only. The crates include more files at compile time: cpd includes its README.md for the docs and compare/page.html, basta includes frameworks.yaml. None of them got into the Nix sources, so the build stopped at the first one it missed. The flake takes all of rust/ now, so a crate that starts to include a new file can't break it again.
crane builds the dependencies against a copy of the workspace in which every local crate is an empty stub, patches/paste included. That crate stands in for paste from crates.io since e66eb72, so pulp found no `paste::paste` and the dependency build failed on Linux and macOS. The flake puts the real patches/paste back into that copy.
kucherenko
marked this pull request as ready for review
October 30, 2026 08:38
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.
nix run github:kucherenko/jscpdfrom the README doesn't build on master, for two reasons:pastewith its own shim inrust/patches/paste(RUSTSEC-2024-0436). crane builds the dependencies against a copy of the workspace where every local crate is an empty stub, the shim too, sopulpstops atunresolved import paste::paste. The dependency build keeps the real shim nowCargo never reads flake.nix, so no job noticed. The new Nix workflow builds the package, runs it and runs the flake checks on ubuntu and macOS. It runs when the flake, the toolchain or a Cargo manifest changes, and once a week for the rest.
The first commit only adds the workflow, its run fails on master's flake - https://github.com/kucherenko/jscpd/actions/runs/41015139124. With the fixes and master merged in, the package builds and runs on both systems and the flake checks pass, 534 tests - https://github.com/kucherenko/jscpd/actions/runs/41026067790
This change is