mirror of
https://github.com/ipetkov/crane.git
synced 2024-11-26 17:13:16 +03:00
buildPackage: don't inherit installPhase when calling buildDepsOnly (#297)
This commit is contained in:
parent
445a3d2229
commit
0c9f468ff0
@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||
|
||||
### [0.12.1] - 2023-04-10
|
||||
|
||||
### Changed
|
||||
* **Breaking**: When setting a default value for `cargoArtifacts`,
|
||||
`buildPackage` will now ignore `installPhase` and `installPhaseCommand` when
|
||||
calling `buildPackage`. To bring back the old behavior, please specify
|
||||
`cargoArtifacts` explicitly
|
||||
|
||||
### Added
|
||||
* `vendorMultipleCargoDeps` can now be used to vendor crates from multiple
|
||||
distinct `Cargo.lock` files. Notably this allows for building the standard
|
||||
|
@ -177,8 +177,10 @@ install hooks.
|
||||
`target` directory, which will be reused at the start of the derivation.
|
||||
Useful for caching incremental cargo builds.
|
||||
- Default value: the result of `buildDepsOnly` after applying the arguments
|
||||
set (with the respective default values). `installCargoArtifactsMode` will
|
||||
be set to `"use-zstd"` if not specified.
|
||||
set (with the respective default values).
|
||||
- `installCargoArtifactsMode` will be set to `"use-zstd"` if not specified.
|
||||
- `installPhase` and `installPhaseCommand` will be removed (in favor of their
|
||||
default values provided by `buildDepsOnly`)
|
||||
* `cargoBuildCommand`: A cargo invocation to run during the derivation's build
|
||||
phase
|
||||
- Default value: `"cargo build --profile release"`
|
||||
|
@ -15,8 +15,10 @@
|
||||
, ...
|
||||
}@args:
|
||||
let
|
||||
inherit (builtins) removeAttrs;
|
||||
|
||||
crateName = crateNameFromCargoToml args;
|
||||
cleanedArgs = builtins.removeAttrs args [
|
||||
cleanedArgs = removeAttrs args [
|
||||
"cargoBuildCommand"
|
||||
"cargoExtraArgs"
|
||||
"cargoTestCommand"
|
||||
@ -34,9 +36,14 @@ mkCargoDerivation (cleanedArgs // memoizedArgs // {
|
||||
doCheck = args.doCheck or true;
|
||||
doInstallCargoArtifacts = args.doInstallCargoArtifacts or false;
|
||||
|
||||
cargoArtifacts = args.cargoArtifacts or (buildDepsOnly (args // memoizedArgs // {
|
||||
installCargoArtifactsMode = args.installCargoArtifactsMode or "use-zstd";
|
||||
}));
|
||||
cargoArtifacts = args.cargoArtifacts or (
|
||||
let
|
||||
depsArgs = args // memoizedArgs // {
|
||||
installCargoArtifactsMode = args.installCargoArtifactsMode or "use-zstd";
|
||||
};
|
||||
in
|
||||
buildDepsOnly (removeAttrs depsArgs [ "installPhase" "installPhaseCommand" ])
|
||||
);
|
||||
|
||||
buildPhaseCargoCommand = args.buildPhaseCargoCommand or ''
|
||||
cargoBuildLog=$(mktemp cargoBuildLogXXXX.json)
|
||||
|
Loading…
Reference in New Issue
Block a user