@@ -576,7 +576,7 @@ function choose_shards(p::AbstractPlatform;
576
576
ps_build:: VersionNumber = v " 2024.08.10" ,
577
577
GCC_builds:: Vector{GCCBuild} = available_gcc_builds,
578
578
LLVM_builds:: Vector{LLVMBuild} = available_llvm_builds,
579
- Rust_build :: VersionNumber = maximum ( getversion .( available_rust_builds)) ,
579
+ Rust_builds :: Vector{RustBuild} = available_rust_builds,
580
580
Go_build:: VersionNumber = maximum (getversion .(available_go_builds)),
581
581
archive_type:: Symbol = (use_squashfs[] ? :squashfs : :unpacked ),
582
582
bootstrap_list:: Vector{Symbol} = bootstrap_list,
@@ -586,6 +586,9 @@ function choose_shards(p::AbstractPlatform;
586
586
# Because LLVM doesn't have compatibility issues, we always default
587
587
# to the newest version possible.
588
588
preferred_llvm_version:: VersionNumber = getversion (LLVM_builds[end ]),
589
+ # Rust can have compatibility issues between versions, but by default choose
590
+ # the newest one.
591
+ preferred_rust_version:: VersionNumber = maximum (getversion .(Rust_builds)),
589
592
)
590
593
591
594
function find_shard (name, version, archive_type; target = nothing )
@@ -654,6 +657,13 @@ function choose_shards(p::AbstractPlatform;
654
657
end
655
658
656
659
if :rust in compilers
660
+ # Make sure the selected Rust toolchain version is available
661
+ if preferred_rust_version in getversion .(Rust_builds)
662
+ Rust_build = preferred_rust_version
663
+ else
664
+ error (" Requested Rust toolchain $(preferred_rust_version) not available in $(Rust_builds) " )
665
+ end
666
+
657
667
append! (shards, [
658
668
find_shard (" RustBase" , Rust_build, archive_type),
659
669
find_shard (" RustToolchain" , Rust_build, archive_type; target= p),
0 commit comments