mirror of
https://github.com/ipetkov/crane.git
synced 2024-11-20 17:55:41 +03:00
Fix positioning of cargoExtraArgs in craneLib.cargoNextest (#678)
Both `cargo nextest run` and `cargo llvm-cov` do not place any cargo options/flags right behind `cargo <HERE> ...`. All cargo related flags can be added to the `cargoNextestExtraArgs` attribute. [Issue #675] After altering `checkPhaseCargoCommand` to use one of two explicit command strings inside if/else blocks, it is no longer necessary to default `cmd` to an empty value when `withLlvmCov` is set to `true`. --------- Co-authored-by: Ivan Petkov <ivanppetkov@gmail.com>
This commit is contained in:
parent
d0c8f4ed85
commit
4c6c77920b
@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||
### Fixed
|
||||
* Fixed vendoring dependencies from an alternative registry which they
|
||||
themselves have dependencies on crates from _other_ registries.
|
||||
* Fixed `cargoNextest`'s positioning of `cargoExtraArgs` to form a valid command
|
||||
invocation when specified.
|
||||
|
||||
## [0.18.0] - 2024-07-05
|
||||
|
||||
|
@ -624,6 +624,7 @@ Except where noted below, all derivation attributes are delegated to
|
||||
* `cargoNextestExtraArgs`: additional flags to be passed in the nextest invocation
|
||||
(e.g. specifying a profile)
|
||||
- Default value: `""`
|
||||
- Note that all flags from `cargo test` are supported.
|
||||
* `partitions`: The number of separate nextest partitions to run. Useful if the
|
||||
test suite takes a long time and can be parallelized across multiple build
|
||||
nodes.
|
||||
|
@ -27,7 +27,7 @@ let
|
||||
"withLlvmCov"
|
||||
];
|
||||
|
||||
mkUpdatedArgs = { cmd ? lib.optionalString (!withLlvmCov) "run", extraSuffix ? "", moreArgs ? "", withLlvmCov }: args // {
|
||||
mkUpdatedArgs = { cmd ? "run", extraSuffix ? "", moreArgs ? "", withLlvmCov }: args // {
|
||||
inherit cargoArtifacts;
|
||||
pnameSuffix = "-nextest${extraSuffix}";
|
||||
doCheck = args.doCheck or true;
|
||||
@ -44,10 +44,11 @@ let
|
||||
'';
|
||||
|
||||
checkPhaseCargoCommand = ''
|
||||
cargo ${cargoExtraArgs} \
|
||||
${lib.optionalString withLlvmCov "llvm-cov ${cargoLlvmCovExtraArgs}"} \
|
||||
nextest ${cmd} ''${CARGO_PROFILE:+--cargo-profile $CARGO_PROFILE} \
|
||||
${cargoNextestExtraArgs} ${moreArgs}
|
||||
${if withLlvmCov
|
||||
then "cargo llvm-cov nextest ${cargoLlvmCovExtraArgs}"
|
||||
else "cargo nextest ${cmd}"} \
|
||||
''${CARGO_PROFILE:+--cargo-profile $CARGO_PROFILE} \
|
||||
${cargoExtraArgs} ${cargoNextestExtraArgs} ${moreArgs}
|
||||
'';
|
||||
|
||||
nativeBuildInputs = (args.nativeBuildInputs or [ ])
|
||||
|
Loading…
Reference in New Issue
Block a user