From ec28f43a92c2004cd4e7417a52de495096809811 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Wed, 16 Jul 2025 22:07:21 -0700 Subject: [PATCH] fixDarwinDylibNames: use callPackage; use targetPackages.stdenv.cc for targetPrefix This was the only place in the codebase which used `darwin.binutils.targetPrefix`. Others use `stdenv.cc.targetPrefix`; on static builds, that produces an empty `targetPrefix` where previously it was including the platform name. Still others use this one (`targetPackages.stdenv.cc.targetPrefix`) and that produces no rebuilds. --- pkgs/top-level/all-packages.nix | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4eeae5c1dece..90aec23b0d9e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -892,11 +892,18 @@ with pkgs; name = "set-java-classpath-hook"; } ../build-support/setup-hooks/set-java-classpath.sh; - fixDarwinDylibNames = makeSetupHook { - name = "fix-darwin-dylib-names-hook"; - substitutions = { inherit (darwin.binutils) targetPrefix; }; - meta.platforms = lib.platforms.darwin; - } ../build-support/setup-hooks/fix-darwin-dylib-names.sh; + fixDarwinDylibNames = callPackage ( + { + lib, + targetPackages, + makeSetupHook, + }: + makeSetupHook { + name = "fix-darwin-dylib-names-hook"; + substitutions = { inherit (targetPackages.stdenv.cc) targetPrefix; }; + meta.platforms = lib.platforms.darwin; + } ../build-support/setup-hooks/fix-darwin-dylib-names.sh + ) { }; writeDarwinBundle = callPackage ../build-support/make-darwin-bundle/write-darwin-bundle.nix { };