Skip to content

Commit

Permalink
cudaPackages now evaluates deeply
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorBaker committed May 4, 2024
1 parent 84421fc commit d00b56c
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions pkgs/development/cuda-modules/package-sets.nix
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,19 @@ let
packages;
in
{
inherit lib pkgs;
lib = dontRecurseIntoAttrs lib;
pkgs = dontRecurseIntoAttrs pkgs;
data = dontRecurseIntoAttrs config.data;
utils = dontRecurseIntoAttrs config.utils;

__attrsFailEvaluation = true;
# Maintain a reference to the final cudaPackages.
# Without this, if we use `final.callPackage` and a package accepts `cudaPackages` as an argument,
# it's provided with `cudaPackages` from the top-level scope, which is not what we want. We want to
# provide the `cudaPackages` from the final scope -- that is, the *current* scope.
cudaPackages = dontRecurseIntoAttrs final // {
# Don't continually recurse into the cudaPackages attribute set trying to evaluate it.
__attrsFailEvaluation = true;
};

# CUDA versions
cudaVersion = final.cudaMajorMinorVersion;
Expand All @@ -327,12 +335,6 @@ let
# Utility functions
cudaOlder = versionOlder final.cudaVersion;
cudaAtLeast = versionAtLeast final.cudaVersion;

# Maintain a reference to the final cudaPackages.
# Without this, if we use `final.callPackage` and a package accepts `cudaPackages` as an argument,
# it's provided with `cudaPackages` from the top-level scope, which is not what we want. We want to
# provide the `cudaPackages` from the final scope -- that is, the *current* scope.
cudaPackages = final;
}
// (packagesFromDirectoryRecursive {
inherit (final) callPackage;
Expand Down

0 comments on commit d00b56c

Please sign in to comment.