Repository navigation
Conversation
Export shared Rust checks as a flake-parts module. Add Cargo Shear and Cargo Sort patch fixtures whose expected failures are asserted by Nix.
| pkgs.cargo-nextest | ||
| ]; | ||
| buildPhaseCargoCommand = '' | ||
| cargo llvm-cov nextest --workspace --no-report --remap-path-prefix |
There was a problem hiding this comment.
cargo llvm-cov nextest aborts with "failed to find llvm-tools-preview, please install llvm-tools-preview, or set LLVM_COV and LLVM_PROFDATA environment variables": the repo toolchain is rust-bin.stable.latest.default (no llvm-tools component), coverage.nix sets neither env var nor adds pkgs.llvm, and the Nix sandbox has no rustup for cargo-llvm-cov's fallback, so checks.coverage cannot build at all.
| checks.coverage = pkgs.runCommand "coverage" { nativeBuildInputs = [ pkgs.lcov ]; } '' | ||
| mkdir -p "$out" | ||
| cp ${collection}/coverage.lcov "$out/coverage.lcov" | ||
| lcov --summary "$out/coverage.lcov" --fail-under-lines 100 |
There was a problem hiding this comment.
lcov --summary --fail-under-lines 100 requires 100% line coverage, but the collected tracefile falls short of it: tests/cli.rs spawns the binary with env_clear(), dropping LLVM_PROFILE_FILE so the children's profiles are lost before cargo llvm-cov report merges them, and the check fails even when llvm-tools are available.
| pkgs.cargo-mutants | ||
| pkgs.cargo-nextest | ||
| ]; | ||
| buildPhaseCargoCommand = "cargo mutants --workspace --in-place --test-tool nextest"; |
There was a problem hiding this comment.
cargo mutants --workspace --in-place --test-tool nextest leaves match-guard and operator mutants in resolve_commits/add_revision in src/history.rs surviving the test suite, so cargo-mutants exits non-zero and the checks.mutants buildPhase fails.
There was a problem hiding this comment.
also, is the per-commit diff from cpsbt#21 planned on top of this?
| "aarch64-linux" | ||
| "x86_64-linux" | ||
| ]; | ||
| flake.flakeModules.checks = import ./nix/checks; |
There was a problem hiding this comment.
flake.flakeModules.checks is only exported, never imported: of the check files, flake.nix's imports pull in only cargo-shear.nix, cargo-sort.nix and negative-tests.nix, so checks.build, checks.tests, checks.doctests, checks.clippy, checks.doc, checks.coverage, checks.mutants and the quick/lint/nightly aggregates never appear in the flake's checks output, and nix flake check — the per-commit validation this repo's CI runs via validate-commits-bootstrap — never evaluates them.
There was a problem hiding this comment.
on which checks: #24 already scopes this, the parts that are the same in concurrent-psbt and fungi, or where fungi improves on them
we should extract flake-parts that are already the same between both, or where this repo's version improves upon the concurrent psbt repo, and extract them into a separate repo
could that comparison go in #24, with the PR body saying which ones this extracts?
hartig could be the first consumer
| pkgs.cargo-mutants | ||
| pkgs.cargo-nextest | ||
| ]; | ||
| buildPhaseCargoCommand = "cargo mutants --workspace --in-place --test-tool nextest"; |
There was a problem hiding this comment.
also, is the per-commit diff from cpsbt#21 planned on top of this?
| @@ -0,0 +1,13 @@ | |||
| { | |||
There was a problem hiding this comment.
fungi runs these per workspace (cargoWorkspaces), while this expects a single one, so fungi couldn't import it as is
Yes, Hartig is the intened first consumer per talks with yuval on signal |
Adds a reusable flake-parts module so Fungi repositories can share build, lint, test, coverage, and mutation checks instead of maintaining separate copies.
Adds two negative patch checks:
Nix applies each patch to a separate source copy. testBuildFailure' verifies the expected exit code and error message. The working checkout stays unchanged.
Related to fungi-protocol/fungi#24.
Please reviewrs state the exact nix checks that should be added and also wwhould workflows be added or any neccessary CI work that is shared across all fungi repos a