diff --git a/docs/quality.md b/docs/quality.md index a5dc82a..a2efaee 100644 --- a/docs/quality.md +++ b/docs/quality.md @@ -190,6 +190,10 @@ cargo install knots --version 1.16.0 --locked --root .work/tools KNOTS_BIN=.work/tools/bin/knots scripts/crap-report.sh ``` +`cargo-llvm-cov` also needs the `llvm-tools-preview` toolchain component. The +`nix develop` shell includes it. With rustup, run +`rustup component add llvm-tools-preview` once. CI does not install it. + The script builds an instrumented binary and runs the whole test suite, which takes several minutes, and writes `crap.md` and `crap.json` below `target/crap/`. CI does not run it. Add meaningful tests or simplify risky code. Never game the score diff --git a/flake.nix b/flake.nix index cd32a22..2320e08 100644 --- a/flake.nix +++ b/flake.nix @@ -19,7 +19,12 @@ inherit system; overlays = [ rust-overlay.overlays.default ]; }; - rust = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; + # The pinned toolchain, plus llvm-tools for `scripts/crap-report.sh`. CI and + # rustup users install only the components in rust-toolchain.toml. + toolchain = (builtins.fromTOML (builtins.readFile ./rust-toolchain.toml)).toolchain; + rust = pkgs.rust-bin.fromRustupToolchain (toolchain // { + components = toolchain.components ++ [ "llvm-tools-preview" ]; + }); in { default = pkgs.mkShell { packages = [