Skip to content

Commit 57110b4

Browse files
authored
[BinaryPlatforms]: Remove overzealous verification (#37705)
Some of these verifications are a little over-zealous. We don't actually need `cuda` or `march` verification in here, since these will be primarily externally-driven tags.
1 parent 4767300 commit 57110b4

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

base/binaryplatforms.jl

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -231,18 +231,10 @@ end
231231
# Simple equality definition; for compatibility testing, use `platforms_match()`
232232
Base.:(==)(a::AbstractPlatform, b::AbstractPlatform) = tags(a) == tags(b)
233233

234-
const ARCHITECTURE_FLAGS = Dict(
235-
"x86_64" => ["x86_64", "avx", "avx2", "avx512"],
236-
"i686" => ["prescott"],
237-
"armv7l" => ["armv7l", "neon", "vfp4"],
238-
"armv6l" => ["generic"],
239-
"aarch64" => ["armv8", "thunderx2", "carmel"],
240-
"powerpc64le" => ["generic"],
241-
)
242234
function validate_tags(tags::Dict)
243235
throw_invalid_key(k) = throw(ArgumentError("Key \"$(k)\" cannot have value \"$(tags[k])\""))
244236
# Validate `arch`
245-
if tags["arch"] keys(ARCHITECTURE_FLAGS)
237+
if tags["arch"] ("x86_64", "i686", "armv7l", "armv6l", "aarch64", "powerpc64le")
246238
throw_invalid_key("arch")
247239
end
248240
# Validate `os`
@@ -301,16 +293,6 @@ function validate_tags(tags::Dict)
301293
if "cxxstring_abi" in keys(tags) && tags["cxxstring_abi"] ("cxx03", "cxx11")
302294
throw_invalid_key("cxxstring_abi")
303295
end
304-
305-
# Validate `march` is one of our recognized microarchitectures for the architecture we're advertising
306-
if "march" in keys(tags) && tags["march"] ARCHITECTURE_FLAGS[tags["arch"]]
307-
throw(ArgumentError("\"march\" cannot have value \"$(tags["march"])\" for arch $(tags["arch"])"))
308-
end
309-
310-
# Validate `cuda` is a parsable `VersionNumber`
311-
if "cuda" in keys(tags) && tryparse(VersionNumber, tags["cuda"]) === nothing
312-
throw_version_number("cuda")
313-
end
314296
end
315297

316298
function set_compare_strategy!(p::Platform, key::String, f::Function)

test/binaryplatforms.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,6 @@ end
181181
# Test extended attributes
182182
@test R("x86_64-linux-gnu-march+avx2") == P("x86_64", "linux"; march="avx2")
183183
@test R("x86_64-linux-gnu-march+x86_64-cuda+10.1") == P("x86_64", "linux"; march="x86_64", cuda="10.1")
184-
@test_throws ArgumentError R("x86_64-linux-gnu-march+generic";)
185-
@test_throws ArgumentError R("x86_64-linux-gnu-cuda+version")
186184

187185
# Round-trip our little homie through `triplet()`
188186
@test parse(Platform, triplet(HostPlatform())) == HostPlatform()

0 commit comments

Comments
 (0)