cudaPackages.fixups -> pkgs.cudaFixups

This commit is contained in:
Connor Baker 2025-05-15 21:00:40 +00:00
parent c5dad2886a
commit 765529dfff
4 changed files with 12 additions and 17 deletions

View file

@ -1,5 +1,6 @@
{ lib }: let
lib = import ../../../../lib;
in
lib.concatMapAttrs ( lib.concatMapAttrs (
fileName: _type: fileName: _type:
let let

View file

@ -5,9 +5,9 @@
autoPatchelfHook, autoPatchelfHook,
backendStdenv, backendStdenv,
callPackage, callPackage,
cudaFixups,
cudaLib, cudaLib,
fetchurl, fetchurl,
fixups,
lib, lib,
markForCudatoolkitRootHook, markForCudatoolkitRootHook,
flags, flags,
@ -45,7 +45,7 @@ let
# Last step before returning control to `callPackage` (adds the `.override` method) # Last step before returning control to `callPackage` (adds the `.override` method)
# we'll apply (`overrideAttrs`) necessary package-specific "fixup" functions. # we'll apply (`overrideAttrs`) necessary package-specific "fixup" functions.
# Order is significant. # Order is significant.
maybeFixup = fixups.${pname} or null; maybeFixup = cudaFixups.${pname} or null;
fixup = if maybeFixup != null then callPackage maybeFixup { } else { }; fixup = if maybeFixup != null then callPackage maybeFixup { } else { };
# Get the redist systems for which package provides distributables. # Get the redist systems for which package provides distributables.

View file

@ -2721,6 +2721,8 @@ with pkgs;
cudaLib = import ../development/cuda-modules/lib; cudaLib = import ../development/cuda-modules/lib;
cudaFixups = import ../development/cuda-modules/fixups;
cudaPackages_11_0 = callPackage ./cuda-packages.nix { cudaMajorMinorVersion = "11.0"; }; cudaPackages_11_0 = callPackage ./cuda-packages.nix { cudaMajorMinorVersion = "11.0"; };
cudaPackages_11_1 = callPackage ./cuda-packages.nix { cudaMajorMinorVersion = "11.1"; }; cudaPackages_11_1 = callPackage ./cuda-packages.nix { cudaMajorMinorVersion = "11.1"; };
cudaPackages_11_2 = callPackage ./cuda-packages.nix { cudaMajorMinorVersion = "11.2"; }; cudaPackages_11_2 = callPackage ./cuda-packages.nix { cudaMajorMinorVersion = "11.2"; };

View file

@ -26,7 +26,6 @@
cudaMajorMinorVersion, cudaMajorMinorVersion,
lib, lib,
newScope, newScope,
pkgs,
stdenv, stdenv,
}: }:
let let
@ -39,9 +38,6 @@ let
versions versions
; ;
# MUST be defined outside fix-point (cf. "NAMESET STRICTNESS" above)
fixups = import ../development/cuda-modules/fixups { inherit lib; };
# Since Jetson capabilities are never built by default, we can check if any of them were requested # Since Jetson capabilities are never built by default, we can check if any of them were requested
# through final.config.cudaCapabilities and use that to determine if we should change some manifest versions. # through final.config.cudaCapabilities and use that to determine if we should change some manifest versions.
# Copied from backendStdenv. # Copied from backendStdenv.
@ -54,19 +50,15 @@ let
passthruFunction = final: { passthruFunction = final: {
# NOTE: # NOTE:
# It is important that cudaLib (and fixups, which will be addressed later) are not part of the package set # It is important that cudaLib and cudaFixups are not part of the package set fixed-point. As described by
# fixed-point. # @SomeoneSerge:
# As described by @SomeoneSerge:
# > The layering should be: configuration -> (identifies/is part of) cudaPackages -> (is built using) cudaLib. # > The layering should be: configuration -> (identifies/is part of) cudaPackages -> (is built using) cudaLib.
# > No arrows should point in the reverse directions. # > No arrows should point in the reverse directions.
# That is to say that cudaLib should only know about package sets and configurations, because it implements # That is to say that cudaLib should only know about package sets and configurations, because it implements
# functionality for interpreting configurations, resolving them against data, and constructing package sets. # functionality for interpreting configurations, resolving them against data, and constructing package sets.
inherit # This decision is driven both by a separation of concerns and by "NAMESET STRICTNESS" (see above).
cudaMajorMinorVersion
fixups inherit cudaMajorMinorVersion;
lib
pkgs
;
cudaNamePrefix = "cuda${cudaMajorMinorVersion}"; cudaNamePrefix = "cuda${cudaMajorMinorVersion}";