Skip to content

Commit

Permalink
nix: Add name parameter to buildCratesInLayers
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Spinale <nick@nickspinale.com>
  • Loading branch information
nspin committed May 29, 2024
1 parent 181b523 commit b1334ac
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions hacking/nix/rust-utils/build-crates-in-layers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ in
, rustEnvironment ? defaultRustEnvironment
, targetTriple ? defaultRustTargetTriple


, name ? if rootCrate != null then rootCrate.name else "build-crates"

, rootCrate ? null
, rootCrates ? if rootCrate != null then [ rootCrate ] else throw "must supply 'rootCrates' argument"

Expand Down Expand Up @@ -106,8 +109,6 @@ let

lastIntermediateLayer = f (lib.reverseList accumulatedLayers);

buildName = if rootCrate != null then rootCrate.name else "build-crates";

baseArgs = {
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ rustEnvironment.rustToolchain ] ++ lib.optionals verifyWithVerus [ verus ];
Expand Down Expand Up @@ -214,7 +215,7 @@ let
runClippyThisLayer = runClippy && layer.reals != {};
in
modifications.modifyDerivation (stdenv.mkDerivation (baseArgs // {
name = "${buildName}-intermediate";
name = "${name}-intermediate";

phases = [ "buildPhase" ];

Expand Down Expand Up @@ -259,7 +260,7 @@ in let
];

final = modifications.modifyDerivation (stdenv.mkDerivation (baseArgs // {
name = buildName;
name = name;

phases = [ "buildPhase" ];

Expand Down

0 comments on commit b1334ac

Please sign in to comment.