From 6d9255a8f266f01da399bc75ff79ed55f95834af Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Tue, 25 Nov 2025 19:31:58 +0000 Subject: [PATCH] cudaPackages.buildRedist: put removeStubsFromRunpathHook in propagated-build-inputs Signed-off-by: Connor Baker --- .../cuda-modules/buildRedist/buildRedistHook.bash | 4 +--- .../development/cuda-modules/buildRedist/default.nix | 12 +++++------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/pkgs/development/cuda-modules/buildRedist/buildRedistHook.bash b/pkgs/development/cuda-modules/buildRedist/buildRedistHook.bash index d4393e0ae234..30b5ab5ca1e8 100644 --- a/pkgs/development/cuda-modules/buildRedist/buildRedistHook.bash +++ b/pkgs/development/cuda-modules/buildRedist/buildRedistHook.bash @@ -164,9 +164,7 @@ checkCudaHasStubsIffIncludeRemoveStubsFromRunpathHook() { # The dependency should be recorded in both propagated-native-build-inputs and propagated-build-inputs, so the # hook is propagated regardless of which dependency array includes the stubs-providing output. hasRemoveStubsFromRunpathHook=0 - if - grep --silent --no-messages removeStubsFromRunpathHook "${!outputName:?}/nix-support/propagated-native-build-inputs" && - grep --silent --no-messages removeStubsFromRunpathHook "${!outputName:?}/nix-support/propagated-build-inputs" + if grep --silent --no-messages removeStubsFromRunpathHook "${!outputName:?}/nix-support/propagated-build-inputs" then hasRemoveStubsFromRunpathHook=1 fi diff --git a/pkgs/development/cuda-modules/buildRedist/default.nix b/pkgs/development/cuda-modules/buildRedist/default.nix index ce9c6a7e7a5a..831920a57e30 100644 --- a/pkgs/development/cuda-modules/buildRedist/default.nix +++ b/pkgs/development/cuda-modules/buildRedist/default.nix @@ -343,16 +343,14 @@ extendMkDerivation { inherit allowFHSReferences; inherit includeRemoveStubsFromRunpathHook; - postFixup = - postFixup - + optionalString finalAttrs.includeRemoveStubsFromRunpathHook '' + postFixup = postFixup + '' + if [[ -n "''${includeRemoveStubsFromRunpathHook:-}" ]] ; then nixLog "installing stub removal runpath hook" mkdir -p "''${!outputStubs:?}/nix-support" - printWords >>"''${!outputStubs:?}/nix-support/propagated-native-build-inputs" \ - "${getDev removeStubsFromRunpathHook.__spliced.buildHost or removeStubsFromRunpathHook}" printWords >>"''${!outputStubs:?}/nix-support/propagated-build-inputs" \ - "${getDev removeStubsFromRunpathHook.__spliced.hostTarget or removeStubsFromRunpathHook}" - ''; + "${getDev removeStubsFromRunpathHook}" + fi + ''; passthru = passthru // { inherit redistName release;