@@ -577,7 +577,7 @@ function choose_shards(p::AbstractPlatform;
577
577
GCC_builds:: Vector{GCCBuild} = available_gcc_builds,
578
578
LLVM_builds:: Vector{LLVMBuild} = available_llvm_builds,
579
579
Rust_builds:: Vector{RustBuild} = available_rust_builds,
580
- Go_build :: VersionNumber = maximum ( getversion .( available_go_builds)) ,
580
+ Go_builds :: Vector{GoBuild} = available_go_builds,
581
581
archive_type:: Symbol = (use_squashfs[] ? :squashfs : :unpacked ),
582
582
bootstrap_list:: Vector{Symbol} = bootstrap_list,
583
583
# Because GCC has lots of compatibility issues, we always default to
@@ -589,6 +589,8 @@ function choose_shards(p::AbstractPlatform;
589
589
# Rust can have compatibility issues between versions, but by default choose
590
590
# the newest one.
591
591
preferred_rust_version:: VersionNumber = maximum (getversion .(Rust_builds)),
592
+ # Always default to the latest Go version
593
+ preferred_go_version:: VersionNumber = maximum (getversion .(Go_builds)),
592
594
)
593
595
594
596
function find_shard (name, version, archive_type; target = nothing )
@@ -687,6 +689,13 @@ function choose_shards(p::AbstractPlatform;
687
689
end
688
690
689
691
if :go in compilers
692
+ # Make sure the selected Go toolchain version is available
693
+ if preferred_go_version in getversion .(Go_builds)
694
+ Go_build = preferred_go_version
695
+ else
696
+ error (" Requested Go toolchain $(preferred_go_version) not available in $(Go_builds) " )
697
+ end
698
+
690
699
push! (shards, find_shard (" Go" , Go_build, archive_type))
691
700
end
692
701
else
0 commit comments