cudaPackages: multiplex builder always provides attributes#406207
cudaPackages: multiplex builder always provides attributes#406207ConnorBaker merged 2 commits intoNixOS:masterfrom
Conversation
d8270fe to
4bc9a05
Compare
…n no attributes Signed-off-by: Connor Baker <ConnorBaker01@gmail.com>
4bc9a05 to
143898c
Compare
| ${majorMinorVersion} = | ||
| # Only keep the existing package if it is newer than the one we are considering. | ||
| if existingPackage != null && lib.versionOlder package.version existingPackage.version then | ||
| # Only keep the existing package if it is newer than the one we are considering or it is supported on the | ||
| # current platform and the one we are considering is not. | ||
| if | ||
| existingPackage != null | ||
| && ( | ||
| packageOlder package existingPackage | ||
| || (!packageSupportedPlatform package && packageSupportedPlatform existingPackage) | ||
| ) |
There was a problem hiding this comment.
There was a problem hiding this comment.
Unfortunately, though, we won't be able to see trofi's commit message in git-blame 9fd753e
There was a problem hiding this comment.
Added a comment to reference it when calling lib.sort.
There was a problem hiding this comment.
I'd still recover the named function
| # allPackages :: List (Package + { redistArch: String }) | ||
| allPackages = | ||
| let | ||
| redistArchs = lib.attrNames evaluatedModules.config.${pname}.releases; | ||
| in | ||
| lib.concatMap ( | ||
| redistArch: | ||
| let | ||
| packages = evaluatedModules.config.${pname}.releases.${redistArch}; | ||
| in | ||
| lib.concatMap ( | ||
| package: lib.optionals (satisfiesCudaVersion package) [ ({ inherit redistArch; } // package) ] | ||
| ) packages | ||
| ) redistArchs; | ||
|
|
||
| packageOlder = p1: p2: lib.versionOlder p1.version p2.version; | ||
| packageSupportedPlatform = p: p.redistArch == redistArch; |
There was a problem hiding this comment.
Or you keep the previous version but rename it to allPackages', and add allPackages = allPackages' ++ [(head ...)] where ... is flattened releases. The previous filter was more readable than 2x concatMap
There was a problem hiding this comment.
Re-introduced allReleases and introduced allReleases' to make it more clear what's happening.
There was a problem hiding this comment.
By "previous" I meant the one you introduced in the previous PR, where you only keep the matching platform's packages. That part looked fairly simple and comprehensible, we could keep it and append just one potentially-unsupported package at the end
There was a problem hiding this comment.
Your call though, I can also look in more detail at the current version?
There was a problem hiding this comment.
I'd say look more closely at the current version since it makes sure that the incompatible package used at least matches the version.
There was a problem hiding this comment.
match the version
Good point. FYI my plan for the fallback is to runCommand pname { ... } "false", but it might be easier to do after the evalModules schema update
…her than no attributes fixup! cudaPackages: simplify multiplex builder's allPackages Signed-off-by: Connor Baker <ConnorBaker01@gmail.com>
|
Merging to unbreak Darwin eval. |
#405707 broke evaluation of at least one attribute on Darwin (
python3Packages.jax-cuda12-pjrt) because the multiplex builder would only add attributes for packages on supported platforms and access tocudaPackageswas not guarded by platform checks.As a quick fix, this PR changes the behavior of the multiplex builder so that it will add attributes for packages supporting the current CUDA version, even if they are unsupported on the current platform.
Tested with
nix-build ci -A eval.full --max-jobs 24 --cores 16 --arg chunkSize 10000 --arg evalSystems '["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"]'EDIT:
The above didn't error on
master, so I don't know that it's a good indication that this fixes the eval error.However, I did verify manually:
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.