Repository navigation
Conversation
Four eval-time tests from adopting the Rust pack on a second consumer (single-crate library, no binaries, heavily feature-gated): - a pkgs without devkit's overlay must name overlays.default rather than dying on `undefined variable 'vig-utils'` inside devtools.nix - a tree with no Cargo.lock must fail through fmt too, which took only `src` and so passed while the other five derivations failed - checks must include a doctest entry, which #1400's stage table assigns to pre-push and #1429 did not ship - cargoExtraArgs must reach commonArgs, so the checks can build features other than the default set A dependency-free fixture crate keeps the lockfile a literal, so all four run at eval — no vendoring, no network, no compile. Refs: #1450
Two guards and two additions, all from a second consumer's adoption. The guards replace failures that were opaque or partial: - a pkgs without devkit's overlay now names overlays.default and says which outputs need it, instead of dying on `undefined variable 'vig-utils'` inside devtools.nix. Checked lazily, on the dev shell alone: checks and packages never reach mkProjectShell and are usable against a plain nixpkgs, so an eager throw would break a working configuration to improve a message. - a source tree with no Cargo.lock now says so, and says why a git-tree source is the reason. The check sits on cleanSrc so fmt fails with the rest rather than passing alone and making a total failure look partial. The additions close gaps the suite did not admit to: - checks.doctest runs `cargo test --doc`, which #1400 assigned to pre-push. nextest cannot run doctests and cargoDoc only lints rustdoc, so adopting the pack silently dropped them. - cargoExtraArgs reaches every derivation, so the checks can build features other than the default set. Composed with `-p <crate>` in buildCrate rather than overwritten, so a workspace's per-crate builds cannot end up with a different feature set from the checks that ran against them. Refs: #1450
Folded into the existing Rust language pack entry rather than opened as a separate one: the fixes land before the pack has shipped, so a reader of the released notes never saw the behaviour being corrected. Refs: #1450
gerchowl
force-pushed
the
feature/1450-rust-pack-consumer-hardening
branch
from
August 12, 2026 09:45
441540f to
4be5e00
Compare
gerchowl
added a commit
to gerchowl/squelch
that referenced
this pull request
Aug 12, 2026
…around The pack now takes feature selection as a first-class argument, so the checks build --all-features through the supported seam rather than by smuggling it through buildEnv, which is documented as carrying CMAKE_*/PKG_CONFIG_PATH and merely happens to be a raw commonArgs merge. Also picks up the doctest check, so squelch's three doctests run in nix flake check — they were not executed by any check before, since nextest cannot run doctests and the doc check only lints rustdoc. Points at vig-os/devkit#1452 (which targets the pack branch) until that merges.
gerchowl
added a commit
to gerchowl/squelch
that referenced
this pull request
Aug 12, 2026
…rged vig-os/devkit#1452 landed on feature/1400-rust-language-pack, so the branch this repo was pinned to no longer exists. Points at the pack branch itself; a release tag once the pack lands on devkit's dev.
gerchowl
added a commit
that referenced
this pull request
Aug 12, 2026
…craneArgs Follow-ups from the second-consumer review in #1452, both on things that review either surfaced or deliberately left to me. THE SENTINEL NEEDED ITS OTHER HALF. #1452's overlay guard is right and the error is good, but `hasOverlay = pkgs ? vig-utils` is a PROXY: it infers "the overlay was applied" from one package name. Proxies drift. If devkit's overlay ever renames or drops vig-utils, the guard starts throwing "you did not apply the overlay" at consumers who did — and the shipped test would still pass, because it asserts a throw. That is the rule this whole branch is built on, applied to the branch itself: a gate is unverified until it has fired on known-bad input AND stayed quiet on known-good. The guard arrived with only the first half. The new positive test evaluates rust.devShell WITH the overlay, so the day the sentinel stops tracking what it stands for, something fails. BUILDENV WAS A LIE OF OMISSION. #1452 found that feature selection had exactly one seam reaching buildDepsOnly, and it was an argument documented as holding CMAKE_* and PKG_CONFIG_PATH. They added a real `cargoExtraArgs` and left the naming question to me, correctly. It is now `craneArgs`, documented as what it is: raw attrs merged last into every crane derivation, beating everything above them. `buildEnv` stays accepted as a deprecated alias so the second consumer's flake keeps evaluating — merged after craneArgs, on the reasoning that anyone still passing the old name means it. Reviewed the rest of #1452 by running it rather than reading it: the pinned crane does expose cargoDocTest, filesender's check set is 11 with `doctest` present and executing (zero doctests there, so vacuous on this consumer but live on squelch's three), and the rust suite is 16 green, 19 with these two. Refs: #1450, #1400
This was referenced Aug 13, 2026
8 tasks
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.
Targets
feature/1400-rust-language-pack, notdev— these are fixes to the pack before it ships, so a reader of the released notes never sees the behaviour being corrected.Everything here came out of adopting #1429 on a second consumer,
gerchowl/squelch: a single-crate library, no binaries, heavily feature-gated (browser/logsdefault;gh-cli,endpoint,serdeoptional), wired from scratch rather than migrated. Full adoption report is the comment on #1429. Closes #1450.Two guards
Both replace a failure that was opaque, partial, or both. Both follow the
toolchainHasherror's shape, which is the best error in the pack: say what happened, say why no default could be right, give the exact line to add.pkgswithoutoverlays.default.mkProjectShellpullsnix/devtools.nix, which resolvesvig-utilsfrom devkit's overlay. Without it the shell died onundefined variable 'vig-utils'— an error inside devkit, naming something the consumer has never seen, from a file they did not open.The reason this is a guard and not a docs fix:
checksandpackagesnever touchmkProjectShell, so they evaluate fine without the overlay. Unguarded, that is a repo with a greennix flake checkand a dev shell that has never once evaluated. Checked lazily, on the dev shell alone — an eager throw would break a configuration that legitimately uses only the checks.Missing
Cargo.lock. A flake'ssrcis the git tree, so a repo that gitignores its lockfile — the long-standing library convention, and whatcargo new --libwrote for years — hands crane a source without one. crane's own message is good, but only reachable from the derivations that vendor:cargoFmttakessrcalone and passed, which made a total failure look partial. The guard sits oncleanSrcsofmtfails with the rest.Two gaps the suite did not admit to
checks.doctest. #1400's stage table assigns pre-pushnextestandcargo test --doc. nextest cannot run doctests (process-per-test has nowhere to put them) andcargoDoconly lints rustdoc, so nothing executed them — a consumer whose doctests ran undercargo testlost them on adoption, silently.cranealready shipscargoDocTest; this is oneoptionalAttrsblock.cargoExtraArgs. The checks built default features only, and nothing reachedbuildDepsOnly/nextest/doc/ the package builds —clippyExtraArgscovers clippy alone, and carries lint flags rather than feature selection. On squelch that was 55 of 59 tests, with the gated code never compiled and therefore never linted. The suite reported success over the gap.Composed with
-p <crate>inbuildCraterather than overwriting it, so a workspace's per-crate builds cannot end up with a different feature set from the checks that ran against them.The seam that worked before this was
buildEnv = { cargoExtraArgs = …; }, sincebuildEnvis a rawcommonArgsmerge wearing an env-var name. Left in place, now commented as what it actually is.Verified
uv run pytest tests/test_flake_modules.py -k "rust or mk_rust"— 13 passed, including the zero-module parity invariant.--override-input devkitpointed at this branch:nix flake checkgreen on 6 checks,doctestexecuting squelch's 3 doctests, andcargoExtraArgs = "--all-features"replacing thebuildEnvworkaround.Note on scope
The fixture crate is written to
tmp_pathat test time rather than committed undertests/fixtures/, deliberately: aCargo.tomlinside devkit would make devkit look like a Rust consumer to its own language detection.Refs: #1450