fix(rust/crane): make sure cargo only builds the package we want

This commit is contained in:
Yusuf Bera Ertan 2022-02-27 18:37:39 +03:00
parent 309af8d366
commit 2fe01e1715
No known key found for this signature in database
GPG Key ID: 1D8F8FAF2294D6EA

View File

@ -37,14 +37,16 @@ let
'';
# The deps-only derivation will use this as a prefix to the `pname`
depsNameSuffix = "-deps";
# Make sure cargo only builds the package we want
cargoExtraArgs = "--package ${pname}";
deps = produceDerivation "${pname}${depsNameSuffix}" (crane.buildDepsOnly {
inherit pname version src cargoVendorDir preBuild;
inherit pname version src cargoVendorDir cargoExtraArgs preBuild;
pnameSuffix = depsNameSuffix;
});
in
produceDerivation pname (crane.buildPackage {
inherit pname version src cargoVendorDir preBuild;
inherit pname version src cargoVendorDir cargoExtraArgs preBuild;
cargoArtifacts = deps;
});
in