From 7a66dcf83f948c506472dec40f73330c4a9a37d1 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Thu, 18 Apr 2024 15:46:47 +0000 Subject: [PATCH] cuda-modules: use stdenv instead of backendStdenv for *Platform access --- .../cuda-modules/cuda-library-samples/extension.nix | 7 +------ pkgs/development/cuda-modules/cuda-samples/extension.nix | 2 -- pkgs/development/cuda-modules/cuda-samples/generic.nix | 3 ++- pkgs/development/cuda-modules/cutensor/extension.nix | 2 -- pkgs/development/cuda-modules/flags.nix | 2 -- .../development/cuda-modules/generic-builders/manifest.nix | 2 +- .../cuda-modules/generic-builders/multiplex.nix | 2 -- pkgs/development/cuda-modules/tensorrt/fixup.nix | 4 ++-- 8 files changed, 6 insertions(+), 18 deletions(-) diff --git a/pkgs/development/cuda-modules/cuda-library-samples/extension.nix b/pkgs/development/cuda-modules/cuda-library-samples/extension.nix index eb291cd4da09..1184547c7f93 100644 --- a/pkgs/development/cuda-modules/cuda-library-samples/extension.nix +++ b/pkgs/development/cuda-modules/cuda-library-samples/extension.nix @@ -1,9 +1,4 @@ -{ - lib, - # NOTE: We would use backendStdenv to get the hostPlatform, but it's not available in the callPackage context - # we're using to call this file. - stdenv, -}: +{ lib, stdenv }: let inherit (stdenv) hostPlatform; diff --git a/pkgs/development/cuda-modules/cuda-samples/extension.nix b/pkgs/development/cuda-modules/cuda-samples/extension.nix index e4a02e9a5e0c..0a8a3f9ff6ea 100644 --- a/pkgs/development/cuda-modules/cuda-samples/extension.nix +++ b/pkgs/development/cuda-modules/cuda-samples/extension.nix @@ -1,8 +1,6 @@ { cudaVersion, lib, - # NOTE: We would use backendStdenv to get the hostPlatform, but it's not available in the callPackage context - # we're using to call this file. stdenv, }: let diff --git a/pkgs/development/cuda-modules/cuda-samples/generic.nix b/pkgs/development/cuda-modules/cuda-samples/generic.nix index a6a382c8a219..7b3a46acea92 100644 --- a/pkgs/development/cuda-modules/cuda-samples/generic.nix +++ b/pkgs/development/cuda-modules/cuda-samples/generic.nix @@ -11,6 +11,7 @@ hash, lib, pkg-config, + stdenv, }: let inherit (lib) lists strings; @@ -63,7 +64,7 @@ backendStdenv.mkDerivation (finalAttrs: { installPhase = '' runHook preInstall - install -Dm755 -t $out/bin bin/${backendStdenv.hostPlatform.parsed.cpu.name}/${backendStdenv.hostPlatform.parsed.kernel.name}/release/* + install -Dm755 -t $out/bin bin/${stdenv.hostPlatform.parsed.cpu.name}/${stdenv.hostPlatform.parsed.kernel.name}/release/* runHook postInstall ''; diff --git a/pkgs/development/cuda-modules/cutensor/extension.nix b/pkgs/development/cuda-modules/cutensor/extension.nix index ee9b31972e18..5fdf356df916 100644 --- a/pkgs/development/cuda-modules/cutensor/extension.nix +++ b/pkgs/development/cuda-modules/cutensor/extension.nix @@ -17,8 +17,6 @@ flags, lib, mkVersionedPackageName, - # NOTE: We would use backendStdenv to get the hostPlatform, but it's not available in the callPackage context - # we're using to call this file. stdenv, }: let diff --git a/pkgs/development/cuda-modules/flags.nix b/pkgs/development/cuda-modules/flags.nix index 7bba27a2f3e3..3a6bafdd8246 100644 --- a/pkgs/development/cuda-modules/flags.nix +++ b/pkgs/development/cuda-modules/flags.nix @@ -7,8 +7,6 @@ cudaForwardCompat ? (config.cudaForwardCompat or true), lib, cudaVersion, - # NOTE: We cannot refer to backendStdenv as flags exists outside the fixed-point; - # otherwise, we would use that to get the hostPlatform. stdenv, # gpus :: List Gpu gpus, diff --git a/pkgs/development/cuda-modules/generic-builders/manifest.nix b/pkgs/development/cuda-modules/generic-builders/manifest.nix index ce45ada68fc2..006abb456cdc 100644 --- a/pkgs/development/cuda-modules/generic-builders/manifest.nix +++ b/pkgs/development/cuda-modules/generic-builders/manifest.nix @@ -39,7 +39,7 @@ let sourceTypes ; - inherit (backendStdenv) hostPlatform; + inherit (stdenv) hostPlatform; # Get the redist architectures for which package provides distributables. # These are used by meta.platforms. diff --git a/pkgs/development/cuda-modules/generic-builders/multiplex.nix b/pkgs/development/cuda-modules/generic-builders/multiplex.nix index fd06d19e60f0..ce50653bb5d4 100644 --- a/pkgs/development/cuda-modules/generic-builders/multiplex.nix +++ b/pkgs/development/cuda-modules/generic-builders/multiplex.nix @@ -3,8 +3,6 @@ lib, cudaVersion, flags, - # NOTE: We would use backendStdenv to get the hostPlatform, but it's not available in the callPackage context - # we're using to call this file (cudaPackages.callPackage). stdenv, # Expected to be passed by the caller mkVersionedPackageName, diff --git a/pkgs/development/cuda-modules/tensorrt/fixup.nix b/pkgs/development/cuda-modules/tensorrt/fixup.nix index fb843aa4e1e1..42359aedac11 100644 --- a/pkgs/development/cuda-modules/tensorrt/fixup.nix +++ b/pkgs/development/cuda-modules/tensorrt/fixup.nix @@ -1,5 +1,4 @@ { - backendStdenv, cudaVersion, final, lib, @@ -7,6 +6,7 @@ package, patchelf, requireFile, + stdenv, ... }: let @@ -17,7 +17,7 @@ let strings versions ; - inherit (backendStdenv) hostPlatform; + inherit (stdenv) hostPlatform; # targetArch :: String targetArch = attrsets.attrByPath [ hostPlatform.system ] "unsupported" { x86_64-linux = "x86_64-linux-gnu";