Skip to content

Commit e3361c6

Browse files
committed
Also mount a host shard when requesting OCaml.
1 parent d1531ab commit e3361c6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Rootfs.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,8 +742,15 @@ function choose_shards(p::AbstractPlatform;
742742
error("Requested OCaml toolchain $(preferred_ocaml_version) not available in $(OCaml_builds)")
743743
end
744744

745+
# Add a host-native shard, which we often need to bootstrap
745746
push!(shards, find_shard("OCaml", OCaml_build, archive_type;
746-
target = isa(p, AnyPlatform) ? default_host_platform : p))
747+
target=default_host_platform))
748+
749+
# If needed, add a cross-compiling target shard
750+
if !isa(p, AnyPlatform) && !platforms_match(p, default_host_platform)
751+
push!(shards, find_shard("OCaml", OCaml_build, archive_type;
752+
target=p))
753+
end
747754
end
748755
else
749756
function find_latest_version(name)

0 commit comments

Comments
 (0)