-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
cudaPackages: multiplex builder always provides attributes #406207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,12 +52,20 @@ let | |
| lib.versionAtLeast cudaMajorMinorVersion package.minCudaVersion | ||
| && lib.versionAtLeast package.maxCudaVersion cudaMajorMinorVersion; | ||
|
|
||
| # Releases for our platform and CUDA version. | ||
| # See ../modules/${pname}/releases/releases.nix | ||
| # allPackages :: List Package | ||
| allPackages = lib.filter satisfiesCudaVersion ( | ||
| evaluatedModules.config.${pname}.releases.${redistArch} or [ ] | ||
| ); | ||
| # FIXME: do this at the module system level | ||
| propagatePlatforms = lib.mapAttrs (redistArch: lib.map (p: { inherit redistArch; } // p)); | ||
|
|
||
| # Releases for all platforms and all CUDA versions. | ||
| allReleases = propagatePlatforms evaluatedModules.config.${pname}.releases; | ||
|
|
||
| # Releases for all platforms and our CUDA version. | ||
| allReleases' = lib.mapAttrs (_: lib.filter satisfiesCudaVersion) allReleases; | ||
|
|
||
| # Packages for all platforms and our CUDA versions. | ||
| allPackages = lib.concatLists (lib.attrValues allReleases'); | ||
|
|
||
| packageOlder = p1: p2: lib.versionOlder p1.version p2.version; | ||
| packageSupportedPlatform = p: p.redistArch == redistArch; | ||
|
|
||
| # Compute versioned attribute name to be used in this package set | ||
| # Patch version changes should not break the build, so we only use major and minor | ||
|
|
@@ -77,8 +85,15 @@ let | |
| newestPackages | ||
| // { | ||
| ${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) | ||
| ) | ||
|
Comment on lines
87
to
+95
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately, though, we won't be able to see trofi's commit message in git-blame 9fd753e
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a comment to reference it when calling
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd still recover the named function |
||
| then | ||
| existingPackage | ||
| else | ||
| package; | ||
|
|
@@ -87,9 +102,8 @@ let | |
| in | ||
| # Sort the packages by version so the newest is first. | ||
| # NOTE: builtins.sort requires a strict weak ordering, so we must use versionOlder rather than versionAtLeast. | ||
| lib.sort (p1: p2: lib.versionOlder p2.version p1.version) ( | ||
| lib.attrValues newestForEachMajorMinorVersion | ||
| ); | ||
| # See https://github.com/NixOS/nixpkgs/commit/9fd753ea84e5035b357a275324e7fd7ccfb1fc77. | ||
| lib.sort (lib.flip packageOlder) (lib.attrValues newestForEachMajorMinorVersion); | ||
|
|
||
| extension = | ||
| final: _: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rebase --autosquash