Skip to content

fix(nix): make the flake build again and check it in CI - #1272

Merged
kucherenko merged 4 commits into
masterfrom
fix/nix-package
Oct 30, 2026
Merged

kucherenko merged 4 commits into
masterfrom
fix/nix-package

Conversation

@kucherenko

@kucherenko kucherenko commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

nix run github:kucherenko/jscpd from the README doesn't build on master, for two reasons:

  • since e66eb72 the workspace patches paste with its own shim in rust/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, so pulp stops at unresolved import paste::paste. The dependency build keeps the real shim now
  • the flake took only the Cargo sources and the HTML templates, but the crates include more files at compile time: cpd its README.md and compare/page.html, basta its frameworks.yaml, cpd-reporter the Prism bundle from feat(html): show both fragments of a clone side by side, highlight the code #1265. The flake takes the whole rust/ folder now, so a new included file can't break it again

Cargo 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 Reviewable

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 kucherenko changed the title fix(nix): build from the whole rust folder, check the flake in CI fix(nix): make the flake build again and check it in CI Oct 30, 2026
@kucherenko
kucherenko marked this pull request as ready for review October 30, 2026 08:38
@kucherenko
kucherenko merged commit 0b51960 into master Oct 30, 2026
16 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.

1 participant