From 2fe01e1715c4dcbe22ea5ef37d502a6d6430d220 Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Sun, 27 Feb 2022 18:37:39 +0300 Subject: [PATCH] fix(rust/crane): make sure cargo only builds the package we want --- src/builders/rust/crane/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/builders/rust/crane/default.nix b/src/builders/rust/crane/default.nix index 8584e94f..28800453 100644 --- a/src/builders/rust/crane/default.nix +++ b/src/builders/rust/crane/default.nix @@ -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