@@ -443,7 +443,7 @@ function artifact_hash(name::String, artifacts_toml::String;
443
443
return nothing
444
444
end
445
445
446
- return SHA1 (meta[" git-tree-sha1" ])
446
+ return SHA1 (meta[" git-tree-sha1" ]:: String )
447
447
end
448
448
449
449
function select_downloadable_artifacts (artifact_dict:: Dict , artifacts_toml:: String ;
@@ -642,10 +642,9 @@ function artifact_slash_lookup(name::String, artifact_dict::Dict,
642
642
if meta === nothing
643
643
error (" Cannot locate artifact '$(name) ' for $(triplet (platform)) in '$(artifacts_toml) '" )
644
644
end
645
- hash = SHA1 (meta[" git-tree-sha1" ])
645
+ hash = SHA1 (meta[" git-tree-sha1" ]:: String )
646
646
return artifact_name, artifact_path_tail, hash
647
647
end
648
-
649
648
"""
650
649
macro artifact_str(name)
651
650
@@ -707,17 +706,16 @@ macro artifact_str(name, platform=nothing)
707
706
708
707
# If `name` is a constant, (and we're using the default `Platform`) we can actually load
709
708
# and parse the `Artifacts.toml` file now, saving the work from runtime.
710
- if isa (name, AbstractString) && platform === nothing
711
- # To support slash-indexing, we need to split the artifact name from the path tail:
709
+ if platform === nothing
712
710
platform = HostPlatform ()
711
+ end
712
+ if isa (name, AbstractString) && isa (platform, AbstractPlatform)
713
+ # To support slash-indexing, we need to split the artifact name from the path tail:
713
714
artifact_name, artifact_path_tail, hash = artifact_slash_lookup (name, artifact_dict, artifacts_toml, platform)
714
715
return quote
715
716
Base. invokelatest (_artifact_str, $ (__module__), $ (artifacts_toml), $ (artifact_name), $ (artifact_path_tail), $ (artifact_dict), $ (hash), $ (platform), Val ($ (LazyArtifacts))):: String
716
717
end
717
718
else
718
- if platform === nothing
719
- platform = :($ (HostPlatform)())
720
- end
721
719
return quote
722
720
local platform = $ (esc (platform))
723
721
local artifact_name, artifact_path_tail, hash = artifact_slash_lookup ($ (esc (name)), $ (artifact_dict), $ (artifacts_toml), platform)
0 commit comments