mirror of
https://github.com/ipetkov/crane.git
synced 2024-11-30 05:57:28 +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
|
### [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
|
### Added
|
||||||
* `vendorMultipleCargoDeps` can now be used to vendor crates from multiple
|
* `vendorMultipleCargoDeps` can now be used to vendor crates from multiple
|
||||||
distinct `Cargo.lock` files. Notably this allows for building the standard
|
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.
|
`target` directory, which will be reused at the start of the derivation.
|
||||||
Useful for caching incremental cargo builds.
|
Useful for caching incremental cargo builds.
|
||||||
- Default value: the result of `buildDepsOnly` after applying the arguments
|
- Default value: the result of `buildDepsOnly` after applying the arguments
|
||||||
set (with the respective default values). `installCargoArtifactsMode` will
|
set (with the respective default values).
|
||||||
be set to `"use-zstd"` if not specified.
|
- `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
|
* `cargoBuildCommand`: A cargo invocation to run during the derivation's build
|
||||||
phase
|
phase
|
||||||
- Default value: `"cargo build --profile release"`
|
- Default value: `"cargo build --profile release"`
|
||||||
|
@ -15,8 +15,10 @@
|
|||||||
, ...
|
, ...
|
||||||
}@args:
|
}@args:
|
||||||
let
|
let
|
||||||
|
inherit (builtins) removeAttrs;
|
||||||
|
|
||||||
crateName = crateNameFromCargoToml args;
|
crateName = crateNameFromCargoToml args;
|
||||||
cleanedArgs = builtins.removeAttrs args [
|
cleanedArgs = removeAttrs args [
|
||||||
"cargoBuildCommand"
|
"cargoBuildCommand"
|
||||||
"cargoExtraArgs"
|
"cargoExtraArgs"
|
||||||
"cargoTestCommand"
|
"cargoTestCommand"
|
||||||
@ -34,9 +36,14 @@ mkCargoDerivation (cleanedArgs // memoizedArgs // {
|
|||||||
doCheck = args.doCheck or true;
|
doCheck = args.doCheck or true;
|
||||||
doInstallCargoArtifacts = args.doInstallCargoArtifacts or false;
|
doInstallCargoArtifacts = args.doInstallCargoArtifacts or false;
|
||||||
|
|
||||||
cargoArtifacts = args.cargoArtifacts or (buildDepsOnly (args // memoizedArgs // {
|
cargoArtifacts = args.cargoArtifacts or (
|
||||||
installCargoArtifactsMode = args.installCargoArtifactsMode or "use-zstd";
|
let
|
||||||
}));
|
depsArgs = args // memoizedArgs // {
|
||||||
|
installCargoArtifactsMode = args.installCargoArtifactsMode or "use-zstd";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
buildDepsOnly (removeAttrs depsArgs [ "installPhase" "installPhaseCommand" ])
|
||||||
|
);
|
||||||
|
|
||||||
buildPhaseCargoCommand = args.buildPhaseCargoCommand or ''
|
buildPhaseCargoCommand = args.buildPhaseCargoCommand or ''
|
||||||
cargoBuildLog=$(mktemp cargoBuildLogXXXX.json)
|
cargoBuildLog=$(mktemp cargoBuildLogXXXX.json)
|
||||||
|
Loading…
Reference in New Issue
Block a user