Skip to content

Commit

Permalink
Download artifacts when platform tag changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy committed Dec 23, 2021
1 parent 7ad956b commit 547b476
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/LAMMPS_jll/.pkg/platform_augmentation.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Base.BinaryPlatforms
using Preferences
import Pkg

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

function augment_platform!(platform)
BinaryPlatforms.add_tag!(platform.tags, "mpi", string(abi))
if !haskey(platform, "mpi")
platform["mpi"] = string(abi)
end
return platform
end

Expand Down

0 comments on commit 547b476

Please sign in to comment.