Merge pull request #123200 from s1341/fix_max_llvm_packages

Fix max llvm packages from string comparison to int comparison
This commit is contained in:
John Ericson 2021-05-16 03:11:12 -07:00 committed by GitHub
commit 39ca99761d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11224,16 +11224,17 @@ in
# This returns the minimum suported version for the platform. The # This returns the minimum suported version for the platform. The
# assumption is that or any later version is good. # assumption is that or any later version is good.
choose = platform: choose = platform:
/**/ if platform.isDarwin then "7" /**/ if platform.isDarwin then 7
else if platform.isFreeBSD then "7" else if platform.isFreeBSD then 7
else if platform.isAndroid then "12" else if platform.isAndroid then 12
else if platform.isLinux then "7" else if platform.isLinux then 7
else if platform.isWasm then "8" else if platform.isWasm then 8
else "latest"; else 11; # latest
# We take the "max of the mins". Why? Since those are lower bounds of the # We take the "max of the mins". Why? Since those are lower bounds of the
# supported version set, this is like intersecting those sets and then # supported version set, this is like intersecting those sets and then
# taking the min bound of that. # taking the min bound of that.
minSupported = lib.max (choose stdenv.hostPlatform) (choose stdenv.targetPlatform); minSupported = toString (lib.trivial.max (choose stdenv.hostPlatform) (choose
stdenv.targetPlatform));
in pkgs.${"llvmPackages_${minSupported}"}; in pkgs.${"llvmPackages_${minSupported}"};
llvmPackages_5 = recurseIntoAttrs (callPackage ../development/compilers/llvm/5 { llvmPackages_5 = recurseIntoAttrs (callPackage ../development/compilers/llvm/5 {