llvmPackages: Extract the latest LLVM version from llvmPackages_latest

That way we only have to bump the latest LLVM version in one place and
avoid forgetting about the second occurrence like I did in #116646.
This commit is contained in:
Michael Weiss
2021-06-03 12:18:13 +02:00
parent 7b3fe5e16a
commit df88d517d3
+3 -1
View File
@@ -11415,6 +11415,8 @@ in
llvm_5 = llvmPackages_5.llvm;
llvmPackages = let
latest_version = lib.toInt
(lib.versions.major llvmPackages_latest.llvm.version);
# This returns the minimum supported version for the platform. The
# assumption is that or any later version is good.
choose = platform:
@@ -11423,7 +11425,7 @@ in
else if platform.isAndroid then 12
else if platform.isLinux then (if platform.isRiscV then 9 else 7)
else if platform.isWasm then 8
else 11; # latest
else latest_version;
# 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
# taking the min bound of that.