From 67f100acc040ef424e623d393d2b485cc4ce5c77 Mon Sep 17 00:00:00 2001 From: Ivan Petkov Date: Sat, 23 Sep 2023 16:23:33 -0700 Subject: [PATCH] buildPackage: fix issue with inheriting default depsOnly artifacts (#397) --- CHANGELOG.md | 5 +++++ lib/buildPackage.nix | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22c89ff..65984bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## Unreleased +### Fixed + +* Fixed a bug where `buildPackage` would fail to inherit artifacts from + dependency crates if `cargoArtifacts` was not explicitly specified. + ## [0.14.0] - 2023-09-21 ### Added diff --git a/lib/buildPackage.nix b/lib/buildPackage.nix index c7970b3..d4fd5fc 100644 --- a/lib/buildPackage.nix +++ b/lib/buildPackage.nix @@ -40,8 +40,10 @@ mkCargoDerivation (cleanedArgs // memoizedArgs // { cargoArtifacts = args.cargoArtifacts or ( buildDepsOnly (args // memoizedArgs // { installCargoArtifactsMode = args.installCargoArtifactsMode or "use-zstd"; - # NB: we intentionally don't run any hooks here since we don't want to actually install - installPhase = "mkdir -p $out"; + # NB: we intentionally don't run any caller-provided hooks here since they might fail + # if they require any files that have been omitted by the source dummification. + # However, we still _do_ want to run the installation hook with the actual artifacts + installPhase = "prepareAndInstallCargoArtifactsDir"; }) );