crane/lib/cargoLlvmCov.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
643 B
Nix
Raw Normal View History

{ mkCargoDerivation
, cargo-llvm-cov
}:
{ cargoExtraArgs ? "--locked"
, cargoLlvmCovCommand ? "test"
, cargoLlvmCovExtraArgs ? "--lcov --output-path $out"
, ...
}@origArgs:
let
args = builtins.removeAttrs origArgs [
"cargoExtraArgs"
"cargoLlvmCovCommand"
"cargoLlvmCovExtraArgs"
];
in
mkCargoDerivation (args // {
pnameSuffix = "-llvm-cov";
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ cargo-llvm-cov ];
doInstallCargoArtifacts = false;
buildPhaseCargoCommand = ''
cargoWithProfile llvm-cov "${cargoLlvmCovCommand}" ${cargoExtraArgs} ${cargoLlvmCovExtraArgs}
'';
installPhaseCommand = "";
})