Skip to content

Commit 547b476

Browse files
committed
Download artifacts when platform tag changes
1 parent 7ad956b commit 547b476

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

test/LAMMPS_jll/.pkg/platform_augmentation.jl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Base.BinaryPlatforms
22
using Preferences
3+
import Pkg
34

45
function known_abis()
56
return (:MicrosoftMPI, :MPICH, :MPItrampoline)
@@ -19,11 +20,23 @@ function set_abi(abi)
1920
end
2021
set_preferences!(LAMMPS_UUID, "abi" => string(abi), force=true)
2122
@warn "The MPI abi has changed, you will need to restart Julia for the change to take effect" abi
23+
# Note: We either need to use `LazyArtifacts` or at this point ensure that we download artifacts
24+
# for the new ABI.
25+
# Issues: On 1.7 this seems to not work since while we are calling "select_artifacts.jl" we somewhere
26+
# discard the platform we pass to instantiate
27+
# On 1.6 "select_artifacts.jl" does not exist, and thus on first call we might have choosen the
28+
# wrong artifact to begin with an error there.
29+
let platform = HostPlatform()
30+
platform["mpi"] = string(abi)
31+
Pkg.API.instantiate(; platform, verbose=true)
32+
end
2233
return abi
2334
end
2435

2536
function augment_platform!(platform)
26-
BinaryPlatforms.add_tag!(platform.tags, "mpi", string(abi))
37+
if !haskey(platform, "mpi")
38+
platform["mpi"] = string(abi)
39+
end
2740
return platform
2841
end
2942

0 commit comments

Comments
 (0)