@@ -577,7 +577,7 @@ function choose_shards(p::AbstractPlatform;
577577 GCC_builds:: Vector{GCCBuild} = available_gcc_builds,
578578 LLVM_builds:: Vector{LLVMBuild} = available_llvm_builds,
579579 Rust_builds:: Vector{RustBuild} = available_rust_builds,
580- Go_build :: VersionNumber = maximum ( getversion .( available_go_builds)) ,
580+ Go_builds :: Vector{GoBuild} = available_go_builds,
581581 archive_type:: Symbol = (use_squashfs[] ? :squashfs : :unpacked ),
582582 bootstrap_list:: Vector{Symbol} = bootstrap_list,
583583 # Because GCC has lots of compatibility issues, we always default to
@@ -589,6 +589,8 @@ function choose_shards(p::AbstractPlatform;
589589 # Rust can have compatibility issues between versions, but by default choose
590590 # the newest one.
591591 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)),
592594 )
593595
594596 function find_shard (name, version, archive_type; target = nothing )
@@ -687,6 +689,13 @@ function choose_shards(p::AbstractPlatform;
687689 end
688690
689691 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+
690699 push! (shards, find_shard (" Go" , Go_build, archive_type))
691700 end
692701 else
0 commit comments