Skip to content

Commit 9fd753e

Browse files
trofiSomeoneSerge
authored andcommitted
cuda-modules: fix sort predicate stability
Incorrect sorting predicate was found as part of NixOS/nix#12106 where `nix` was crashing on the code like: $ nix eval --expr 'builtins.sort (a: b: true) [ 1 2 3 ]' ... Aborted (core dumped) Note: the crash happens here because sorting predicate does not implement `isLess` and triggers assertion failures for `std::stable_sort` that backs `builtins.sort`. THe change restore `isLess` semantic for `preferable`.
1 parent 8fa343c commit 9fd753e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkgs/development/cuda-modules/generic-builders/multiplex.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ let
8181
redistArch = flags.getRedistArch hostPlatform.system;
8282

8383
preferable =
84-
p1: p2: (isSupported p2 -> isSupported p1) && (strings.versionAtLeast p1.version p2.version);
84+
p1: p2: (isSupported p2 -> isSupported p1) && (strings.versionOlder p2.version p1.version);
8585

8686
# All the supported packages we can build for our platform.
8787
# perSystemReleases :: List Package

0 commit comments

Comments
 (0)