!eWOErHSaiddIbsUNsJ:nixos.org

NixOS CUDA

288 Members
CUDA packages maintenance and support in nixpkgs | https://github.com/orgs/NixOS/projects/27/ | https://nixos.org/manual/nixpkgs/unstable/#cuda58 Servers

Load older messages


SenderMessageTime
12 Mar 2025
@ss:someonex.netSomeoneSerge (back on matrix) Oh! I think I know why it was ${pset} = ... 01:01:30
@ss:someonex.netSomeoneSerge (back on matrix)Uhm no nevermind still doesn't make sense01:03:57
@ruroruro:matrix.orgruro Or maybe s/packageSets/recursivePackages/g and s/evalPackageSetPlatforms/recursivePackagePlatforms/g... 01:06:25
@ss:someonex.netSomeoneSerge (back on matrix)Oh! I didn't do it! xD01:08:11
@ss:someonex.netSomeoneSerge (back on matrix)Git blame shows this was inherited from Frederik's refactoring01:08:46
@ss:someonex.netSomeoneSerge (back on matrix)

recursivePackages

Right now the difference isn't just that it's "recursive" but also that we filter out the unsupported platforms, which we don't do for the packageJobs Can't say this was originally intended but you found a use for that 🤷

01:11:28
@ss:someonex.netSomeoneSerge (back on matrix)Btw it was also maybe a bad move (on my side this time I think) to make these filtered jobs override the manually specified packageJobs01:14:19
@ruroruro:matrix.orgruro If you mean the attrset with explicitly specified packages, then it makes sense not to filter out platforms when they are explicitly spelled out. If you mean packageJobs in release.nix, then I think that it does filter it out by using release-lib.getPlatforms. 01:15:00
@ruroruro:matrix.orgruroYes. I actually flipped the order when I implemented the filtering logic, but this change got thrown out with it.01:15:47
@ruroruro:matrix.orgruro * Yes. I also noticed this and so I actually flipped the order (and changed the // to lib.recursiveUpdate) when I implemented the filtering logic, but this change got thrown out with it. 01:18:29
@ruroruro:matrix.orgruro * Yes. I also noticed this and so I actually flipped the order (and changed the // to lib.recursiveUpdate) when I originally implemented the filtering logic, but this change got thrown out with it. 01:18:44
@ss:someonex.netSomeoneSerge (back on matrix) No I meant its counterpart in release-cuda.nix, the attrset with ... = linux definitions 01:18:55
@ss:someonex.netSomeoneSerge (back on matrix)

(and changed the // to lib.recursiveUpdate)

Just in case, this doesn't merge lists

01:19:38
@ruroruro:matrix.orgruro Yeah. Then I think that it makes sense not to filter them out automatically. If someone explicitly added somepackage = linux; then I think that we should have an eval error if somepackage doesn't support linux. 01:20:14
@ss:someonex.netSomeoneSerge (back on matrix)Yes that was the intent01:20:37
@ruroruro:matrix.orgruroYes. That was the intended effect.01:20:38
@ruroruro:matrix.orgruro So that, for example, someone could do cudaPackages.some_package = [ ]; or something. 01:21:27
@ruroruro:matrix.orgruro * So that, for example, someone could do cudaPackages.some_package = [ ]; in the "explicit" attrset or something. 01:21:42
@ss:someonex.netSomeoneSerge (back on matrix)I see01:21:46
@ruroruro:matrix.orgruroIf you want, I can add it back in. But I think that this reordering was one of the reasons for the indentation change that you wanted to avoid)))01:23:08
@ss:someonex.netSomeoneSerge (back on matrix) Well, ok. Let's swap the order. And for the packageSets variable and for evalPackageSet they actually don't seem to be doing anything useful. The packageSets there really only serves the purpose of automatically identifying the cuda package sets, so let's rename it to cudaPackageSets as, I think, you've already suggested. Let's not introduce the extra variable for evalPackageSet nor for its image, but instead just use packagePlatforms directly in jobs = let in HERE // { ... = linuxl } 01:24:30
@ss:someonex.netSomeoneSerge (back on matrix) * Well, ok. Let's swap the order. And for the packageSets variable and for evalPackageSet they actually don't seem to be doing anything useful. The packageSets there really only serves the purpose of automatically identifying the cuda package sets, so let's rename it to cudaPackageSets as, I think, you've already suggested. Let's not introduce the extra variable for evalPackageSet nor for its image, but instead just use packagePlatforms directly in jobs = let in HERE // { ... = linuxl } 01:24:37
@ss:someonex.netSomeoneSerge (back on matrix) * Well, ok. Let's swap the order. And for the packageSets variable and for evalPackageSet they actually don't seem to be doing anything useful. The packageSets there really only serves the purpose of automatically identifying the cuda package sets, so let's rename it to cudaPackageSets as, I think, you've already suggested. Let's not introduce the extra variable for evalPackageSet nor for its image, but instead just use packagePlatforms directly in jobs = let in HERE // { ... = linux; } 01:24:42
@ss:someonex.netSomeoneSerge (back on matrix)wdyt?01:24:45
@ss:someonex.netSomeoneSerge (back on matrix)If we want to add any other package set well we just add another function call there 🤷01:25:52
@ss:someonex.netSomeoneSerge (back on matrix) Ah we maybe want to give a name to mapTestOn . packagePlatforms? 01:28:28
@ruroruro:matrix.orgruro

How about

  # Package sets to evaluate whole
  # Derivations from these package sets are selected based on the value
  # of their meta.{hydraPlatforms,platforms,badPlatforms} attributes
  autoPackageSets = builtins.filter (lib.strings.hasPrefix "cudaPackages") (builtins.attrNames pkgs);
  autoPackagePlatforms = lib.genAttrs autoPackageSets (pset: packagePlatforms pkgs.${pset});

  # Explicitly select additional packages to also evaluate
  # The desired platforms must be set explicitly here
  explicitPackagePlatforms = (
    # This comment prevents nixfmt from changing the indentation level, lol
    {
      blah = linux;
      ...
    });
  
  # Explicitly specified platforms take precedence over the platforms
  # automatically inferred by release-lib.packagePlatforms
  allPackagePlatforms = lib.recursiveUpdate autoPackagePlatforms explicitPackagePlatforms;
  jobs = mapTestOn allPackagePlatforms;
01:36:27
@ruroruro:matrix.orgruroAlso, if you have any ideas on how to remove the "load-bearing comment" without changing the indentation - be my guest)))01:38:26
@ruroruro:matrix.orgruro *

How about

  # Package sets to evaluate whole
  # Derivations from these package sets are selected based on the value
  # of their meta.{hydraPlatforms,platforms,badPlatforms} attributes
  autoPackageSets = builtins.filter (lib.strings.hasPrefix "cudaPackages") (builtins.attrNames pkgs);
  autoPackagePlatforms = lib.genAttrs autoPackageSets (pset: packagePlatforms pkgs.${pset});

  # Explicitly select additional packages to also evaluate
  # The desired platforms must be set explicitly here
  explicitPackagePlatforms =
    # This comment prevents nixfmt from changing the indentation level, lol
    {
      blah = linux;
      ...
    };
  
  # Explicitly specified platforms take precedence over the platforms
  # automatically inferred by release-lib.packagePlatforms
  allPackagePlatforms = lib.recursiveUpdate autoPackagePlatforms explicitPackagePlatforms;
  jobs = mapTestOn allPackagePlatforms;
01:41:00
@ruroruro:matrix.orgruro *

How about

  # Package sets to evaluate whole
  # Derivations from these package sets are selected based on the value
  # of their meta.{hydraPlatforms,platforms,badPlatforms} attributes
  autoPackageSets = builtins.filter (lib.strings.hasPrefix "cudaPackages") (builtins.attrNames pkgs);
  autoPackagePlatforms = lib.genAttrs autoPackageSets (pset: packagePlatforms pkgs.${pset});

  # Explicitly select additional packages to also evaluate
  # The desired platforms must be set explicitly here
  explicitPackagePlatforms =
    # This comment prevents nixfmt from changing the indentation level, lol
    {
      blah = linux;
      ...
    };
  
  # Explicitly specified platforms take precedence over the platforms
  # automatically inferred in autoPackagePlatforms
  allPackagePlatforms = lib.recursiveUpdate autoPackagePlatforms explicitPackagePlatforms;
  jobs = mapTestOn allPackagePlatforms;
01:41:55

Show newer messages


Back to Room ListRoom Version: 9