-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add cargoLlvmCov * cargoHelperFunctionsHook: prefer `--release` over `--profile release` Some tools (e.g. cargo-llvm-cov) don't understand `--profile release` as an alias for `--release`, so `cargoWithProfile` should prefer passing `--release` when `$CARGO_PROFILE` == "release" --------- Co-authored-by: Ivan Petkov <[email protected]>
- Loading branch information
Showing
8 changed files
with
136 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ mkCargoDerivation | ||
, cargo-llvm-cov | ||
}: | ||
|
||
{ cargoExtraArgs ? "" | ||
, 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 = ""; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters