From cdb722fa01b243c104b74efcb896462d218ff8d7 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Wed, 20 Aug 2025 22:05:44 +0800 Subject: [PATCH] rustPlatform: run cargoDepsHook inside cargoSetupPostUnpackHook --- pkgs/build-support/rust/build-rust-package/default.nix | 5 ----- pkgs/build-support/rust/hooks/cargo-setup-hook.sh | 2 ++ 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/pkgs/build-support/rust/build-rust-package/default.nix b/pkgs/build-support/rust/build-rust-package/default.nix index 1e500cd82c97..7ad39a58935c 100644 --- a/pkgs/build-support/rust/build-rust-package/default.nix +++ b/pkgs/build-support/rust/build-rust-package/default.nix @@ -162,11 +162,6 @@ lib.extendMkDerivation { patches = cargoPatches ++ patches; - postUnpack = '' - eval "$cargoDepsHook" - '' - + (args.postUnpack or ""); - configurePhase = args.configurePhase or '' runHook preConfigure diff --git a/pkgs/build-support/rust/hooks/cargo-setup-hook.sh b/pkgs/build-support/rust/hooks/cargo-setup-hook.sh index 1c779a6541d8..4ba6760a1a23 100644 --- a/pkgs/build-support/rust/hooks/cargo-setup-hook.sh +++ b/pkgs/build-support/rust/hooks/cargo-setup-hook.sh @@ -1,6 +1,8 @@ cargoSetupPostUnpackHook() { echo "Executing cargoSetupPostUnpackHook" + eval "${cargoDepsHook-}" + # Some cargo builds include build hooks that modify their own vendor # dependencies. This copies the vendor directory into the build tree and makes # it writable. If we're using a tarball, the unpackFile hook already handles