Skip to content

Commit

Permalink
Artifacts: Change Dict{AbstractPlatform} to Dict{Platform} to reduce …
Browse files Browse the repository at this point in the history
…Pkg invalidations (#54073)

This pull request now only changes `dl_dict =
Dict{AbstractPlatform,Dict{String,Any}}()` to `dl_dict =
Dict{Platform,Dict{String,Any}}()` in `artifact_meta`.

This is possible since the other possible types for the key are either
`Platform` or `nothing` unless someone overrides
`Artifacts.unpack_platform`.
  • Loading branch information
mkitti committed Jun 19, 2024
1 parent 6f39acb commit a14cc38
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions stdlib/Artifacts/src/Artifacts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ that would be convenient to place within an immutable, life-cycled datastore.
module Artifacts

import Base: get, SHA1
using Base.BinaryPlatforms, Base.TOML
using Base.BinaryPlatforms: AbstractPlatform, Platform, HostPlatform
using Base.BinaryPlatforms: tags, triplet, select_platform
using Base.TOML: TOML

export artifact_exists, artifact_path, artifact_meta, artifact_hash,
select_downloadable_artifacts, find_artifacts_toml, @artifact_str
Expand Down Expand Up @@ -400,7 +402,7 @@ function artifact_meta(name::String, artifact_dict::Dict, artifacts_toml::String

# If it's an array, find the entry that best matches our current platform
if isa(meta, Vector)
dl_dict = Dict{AbstractPlatform,Dict{String,Any}}()
dl_dict = Dict{Platform,Dict{String,Any}}()
for x in meta
x = x::Dict{String, Any}
dl_dict[unpack_platform(x, name, artifacts_toml)] = x
Expand Down

0 comments on commit a14cc38

Please sign in to comment.