summary refs log tree commit diff
path: root/pkgs/development/tools/rust/cargo-llvm-cov/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/tools/rust/cargo-llvm-cov/default.nix')
-rw-r--r--pkgs/development/tools/rust/cargo-llvm-cov/default.nix21
1 files changed, 17 insertions, 4 deletions
diff --git a/pkgs/development/tools/rust/cargo-llvm-cov/default.nix b/pkgs/development/tools/rust/cargo-llvm-cov/default.nix
index 5a22a41d243..0da95637741 100644
--- a/pkgs/development/tools/rust/cargo-llvm-cov/default.nix
+++ b/pkgs/development/tools/rust/cargo-llvm-cov/default.nix
@@ -21,11 +21,12 @@
 , fetchFromGitHub
 , rustPlatform
 , rustc
+, git
 }:
 
 let
   pname = "cargo-llvm-cov";
-  version = "0.5.32";
+  version = "0.5.37";
 
   owner = "taiki-e";
   homepage = "https://github.com/${owner}/${pname}";
@@ -36,7 +37,7 @@ let
   cargoLock = fetchurl {
     name = "Cargo.lock";
     url = "https://crates.io/api/v1/crates/${pname}/${version}/download";
-    sha256 = "sha256-8waZZyEvdPBJo722/FOQtarJdWR3FPZv9Cw2Pf/waqs=";
+    sha256 = "sha256-UJXZ7FhbkIcVAv4PymO4sCqhJ0KFORCCO3w0w9W46qQ=";
     downloadToTemp = true;
     postFetch = ''
       tar xzf $downloadedFile ${pname}-${version}/Cargo.lock
@@ -54,7 +55,8 @@ rustPlatform.buildRustPackage {
     inherit owner;
     repo = pname;
     rev = "v${version}";
-    sha256 = "sha256-aG6XNIgSTdce62gQMG3pNIKtP+jQUmVx+7NdHOkvmlQ=";
+    sha256 = "sha256-aJIMG2gaotu1XdNxcE2xJS78qAqlNzF3p2RMvqBraTk=";
+    leaveDotGit = true;
   };
 
   # Upstream doesn't include the lockfile so we need to add it back
@@ -62,13 +64,24 @@ rustPlatform.buildRustPackage {
     cp ${cargoLock} source/Cargo.lock
   '';
 
-  cargoSha256 = "sha256-jUrjGH1c4i+lOv5wHiNQwZifZh7uTVuu2NCSGtK0ohc=";
+  cargoSha256 = "sha256-dbC8OcH/Ae98SUx9d4rsBdhYQfzsWZpiGqJoIGPDSbY=";
 
   # `cargo-llvm-cov` reads these environment variables to find these binaries,
   # which are needed to run the tests
   LLVM_COV = "${llvm}/bin/llvm-cov";
   LLVM_PROFDATA = "${llvm}/bin/llvm-profdata";
 
+  nativeCheckInputs = [
+    git
+  ];
+
+  preCheck = ''
+    # `cargo-llvm-cov`'s tests rely on `git ls-files` so the staging area needs
+    # to not have everything staged as deleted, which is how `leaveDotGit` in
+    # `fetchFromGitHub` leaves the staging area for reproducibility reasons.
+    git restore --staged .
+  '';
+
   meta = {
     inherit homepage;
     changelog = homepage + "/blob/v${version}/CHANGELOG.md";