Skip to content

mkRustProject: per-test exclusion seam for tests the Nix sandbox cannot run (PTY, signals, process groups) #1834

Open

Description

@gerchowl

Description

mkRustProject's nextest and doctest checks run inside the Nix build sandbox. Some test suites cannot run there: tests that need a PTY, process groups or signals (CLI wrappers, supervisors), plus anything that touches the network or $HOME. On darwin the sandbox is stricter still. Today a consumer has two choices: switch the whole check off (nextest = false), which also stops nix flake check from running every test that would work, or patch it through craneArgs. That route is undocumented, and it leaves the excluded tests with no home at all.

Split out of the open question on #1833.

Proposed Solution

  • A nextestExtraArgs / sandboxExcludes seam on mkRustProject: a list of nextest filter expressions (e.g. test(pty_), binary(supervisor)) that the sandboxed checks.nextest skips.
  • The excluded tests stay first-class outside the sandbox: the seeded Rust justfile.project (Rust pack: L1/L4/L7 never shipped — the pack cannot be adopted cold #1496) runs the full suite with cargo nextest run, so just test and CI still execute them.
  • Document the seam in the pack's README section, including the darwin note.

Alternatives Considered

  • crateOverrides.<name>.doCheck = false: per-crate and all-or-nothing, so it doesn't help a workspace with one PTY test.
  • #[ignore] + --run-ignored in just test: works, but it hijacks #[ignore]'s meaning and is invisible from the flake.

Changelog Category

Added

Refs: #1833

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:workspaceeffort:smallfeaturepriority:medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions