Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Artifacts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ function bind_artifact!(artifacts_toml::String, name::String, hash::SHA1;
meta = artifact_dict[name]
if !isa(meta, Vector)
error("Mapping for '$name' within $(artifacts_toml) already exists!")
elseif any(isequal(platform), unpack_platform(x, name, artifacts_toml) for x in meta)
elseif any(p -> platforms_match(platform, p), unpack_platform(x, name, artifacts_toml) for x in meta)
error("Mapping for '$name'/$(triplet(platform)) within $(artifacts_toml) already exists!")
end
end
Expand Down
6 changes: 6 additions & 0 deletions test/artifacts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,12 @@ end
@test ensure_artifact_installed("foo_txt", artifacts_toml; platform=linux64) == artifact_path(hash2)
@test ensure_artifact_installed("foo_txt", artifacts_toml; platform=win32) == artifact_path(hash)

# Default HostPlatform() adds a compare_strategy key that doesn't get picked up from
# the Artifacts.toml
testhost = Platform("x86_64", "linux", Dict("libstdcxx_version" => "1.2.3"))
BinaryPlatforms.set_compare_strategy!(testhost, "libstdcxx_version", BinaryPlatforms.compare_version_cap)
@test_throws ErrorException bind_artifact!(artifacts_toml, "foo_txt", hash; download_info=download_info, platform=testhost)

# Next, check that we can get the download_info properly:
meta = artifact_meta("foo_txt", artifacts_toml; platform=win32)
@test meta["download"][1]["url"] == "http://google.com/hello_world"
Expand Down