Skip to content

Commit 1489820

Browse files
committed
Gracefully handle missing Rust toolchain on platforms
1 parent 76a9f10 commit 1489820

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/Rootfs.jl

+9-2
Original file line numberDiff line numberDiff line change
@@ -666,9 +666,16 @@ function choose_shards(p::AbstractPlatform;
666666
error("Requested Rust toolchain $(preferred_rust_version) not available in $(Rust_builds)")
667667
end
668668

669+
base_shard = find_shard("RustBase", Rust_build, archive_type)
670+
toolchain_shard = find_shard("RustToolchain", Rust_build, archive_type; target=p)
671+
672+
if isnothing(toolchain_shard)
673+
error("Requested Rust toolchain $(preferred_rust_version) not available on platform $(triplet(p))")
674+
end
675+
669676
append!(shards, [
670-
find_shard("RustBase", Rust_build, archive_type),
671-
find_shard("RustToolchain", Rust_build, archive_type; target=p),
677+
base_shard,
678+
toolchain_shard,
672679
])
673680

674681
if !platforms_match(p, default_host_platform)

0 commit comments

Comments
 (0)