1
2import Base: UUID
3import Pkg.Artifacts: artifact_meta, find_artifacts_toml, load_artifacts_toml
4import Pkg.BinaryPlatforms: platform_key_abi
5import TOML
6
7pkg_uuid = UUID(ARGS[1])
8dir = ARGS[2]
9
10artifacts_toml = find_artifacts_toml(dir)
11
12if artifacts_toml == nothing
13 print("")
14 exit()
15end
16
17platform = platform_key_abi()
18
19# Older Julia doesn't provide select_downloadable_artifacts or .pkg/select_artifacts.jl,
20# so gather the artifacts the old-fashioned way
21artifact_dict = load_artifacts_toml(artifacts_toml; pkg_uuid=pkg_uuid)
22
23results = Dict()
24for name in keys(artifact_dict)
25 # Get the metadata about this name for the requested platform
26 meta = artifact_meta(name, artifact_dict, artifacts_toml; platform=platform)
27
28 # If there are no instances of this name for the desired platform, skip it
29 meta === nothing && continue
30
31 results[name] = meta
32end
33TOML.print(results)