Repository navigation
fix(nix): forward the .vig-os hook knobs through mkRustProject - #1835
Merged
Merged
Conversation
This was referenced Oct 5, 2026
gerchowl
added a commit
that referenced
this pull request
Oct 5, 2026
## Description `mkRustProject`'s `nextest` check runs inside the Nix build sandbox, where tests that need a PTY, process groups, signals or the network cannot pass. Before this PR a consumer had two options: `nextest = false`, which also dropped every test the sandbox *can* run, or an undocumented `craneArgs` patch. This adds a named seam for it. **Stack 2/6** for #1833. Base: #1835 (`bugfix/1810-rust-project-hook-knobs`). ## Type of Change - [x] `feat` -- New feature - [x] `test` -- Adding or updating tests ## Changes Made - `nix/mk-rust-project.nix`: new `sandboxExcludes ? [ ]`, a list of nextest filterset expressions. They are rendered into a single `-E 'not (a) and not (b)'`, because nextest *unions* repeated `-E` flags, so per-exclusion flags would still run everything. The filter is composed with any `cargoNextestExtraArgs` the consumer passes through `craneArgs`, never assigned over it. - Malformed input (not a list, or an empty entry) fails eval with `sandboxExcludes must be …`. - Only `checks.nextest` is affected. The excluded tests stay in `just test` and CI through the Rust `justfile.project` that #1496 (stack 3/6) seeds. The adopter docs for the seam land with #1831 (stack 4/6). ## Changelog Entry ### Added - **`mkRustProject` `sandboxExcludes` for tests the Nix sandbox cannot run** ([#1834](#1834)) - A list of nextest filterset expressions (e.g. `[ "test(pty_)" "binary(supervisor)" ]`) that `checks.nextest` skips, for suites that need a PTY, process groups, signals or the network - The excluded tests stay in `just test` and CI; only the sandboxed flake check skips them, so a repo no longer has to choose between `nextest = false` and a red `nix flake check` ## Testing - [x] `test_mk_rust_project_sandbox_excludes_skip_tests_in_the_nextest_check` **builds** `checks.nextest` on a fixture crate whose `needs_a_pty` test always panics. Without the exclusion the build must fail on that test (the control); with `sandboxExcludes = [ "test(needs_a_pty)" ]` it must succeed. Only nextest itself can prove that the filter expression matches. - [x] `…_compose_with_crane_args`: two exclusions and a consumer's `--no-fail-fast` all reach the check phase. - [x] `…_rejects_a_malformed_sandbox_excludes`: a non-list and an empty entry are refused by name. - [x] `tests/test_flake_modules.py`: 36 passed locally. ## Checklist - [x] My code follows the project's style guidelines - [x] I have performed a self-review of my code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have updated `CHANGELOG.md` in the `[Unreleased]` section (and pasted the entry above) - [x] I have added tests that prove my fix is effective or that my feature works Refs: #1834, #1833
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.
Description
lib.mkRustProjectbuilds its dev shell throughmkProjectShellbut did not accept the four.vig-oshook settings. A Rust flake therefore had nowhere to passbranchTypes/commitTypes/refsPolicy/refsOptionalTypes. ItsDEVKIT_*settings were silently ignored by the generated branch guard and commit-message hook, and the manifest bindings the flake reads went unused, which fails deadnix on the first commit touchingflake.nix.Stack 1/6 for #1833 (Rust cold adoption). Base:
dev.Type of Change
fix-- Bug fixtest-- Adding or updating testsChanges Made
nix/mk-rust-project.nix: newbranchTypes,commitTypes,refsPolicy,refsOptionalTypesarguments (defaultnull), forwarded verbatim tomkProjectShell, which already documents and validates them.nix/mk-rust-project.nixandflake.nixuseinherit (rust) checks packages;(statix [04]).#rusttemplate in Rust pack: L1/L4/L7 never shipped — the pack cannot be adopted cold #1496 (stack 3/6), because no Rust flake scaffold exists before that PR.Changelog Entry
Fixed
mkRustProjectforwards the.vig-oshook settings (#1810)lib.mkRustProjectacceptsbranchTypes,commitTypes,refsPolicyandrefsOptionalTypesand passes them tomkProjectShell, so a Rust repo'sDEVKIT_BRANCH_TYPES/DEVKIT_COMMIT_TYPES/DEVKIT_REFS_POLICY/DEVKIT_REFS_OPTIONAL_TYPESreach the flake-generated branch guard and commit-message hook instead of being silently ignored# deadnix: skipthe manifest bindings it reads, which made the first commit touchingflake.nixfail deadnixTesting
test_mk_rust_project_forwards_the_vig_os_hook_knobsbuilds the Rust dev shell's generated hook config and checks the rendered argv:--typescarries the custom type,--refs-optional-typesischore,record(taking precedence overrefsPolicy = "required"), and the branch guard carries the custom branch type. It failed first withunexpected argument 'branchTypes'.mk_rust_projecttests intests/test_flake_modules.pypass locally (8 passed).Checklist
CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Refs: #1810, #1833