Skip to content

Commit 7203d19

Browse files
KristofferCKristofferC
authored andcommitted
minimal changes to avoid Artifacts to get invalidated by some common definitions in ecosystem (#49603)
(cherry picked from commit 43c9202)
1 parent bc90bbe commit 7203d19

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

base/binaryplatforms.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,19 +1015,19 @@ function platforms_match(a::AbstractPlatform, b::AbstractPlatform)
10151015

10161016
# Throw an error if `a` and `b` have both set non-default comparison strategies for `k`
10171017
# and they're not the same strategy.
1018-
if a_comp != compare_default && b_comp != compare_default && a_comp != b_comp
1018+
if a_comp !== compare_default && b_comp !== compare_default && a_comp !== b_comp
10191019
throw(ArgumentError("Cannot compare Platform objects with two different non-default comparison strategies for the same key \"$(k)\""))
10201020
end
10211021

10221022
# Select the custom comparator, if we have one.
10231023
comparator = a_comp
1024-
if b_comp != compare_default
1024+
if b_comp !== compare_default
10251025
comparator = b_comp
10261026
end
10271027

10281028
# Call the comparator, passing in which objects requested this comparison (one, the other, or both)
10291029
# For some comparators this doesn't matter, but for non-symmetrical comparisons, it does.
1030-
if !(comparator(ak, bk, a_comp == comparator, b_comp == comparator)::Bool)
1030+
if !(comparator(ak, bk, a_comp === comparator, b_comp === comparator)::Bool)
10311031
return false
10321032
end
10331033
end
@@ -1073,7 +1073,9 @@ function select_platform(download_info::Dict, platform::AbstractPlatform = HostP
10731073
# of generally choosing the latest release (e.g. a `libgfortran5` tarball
10741074
# rather than a `libgfortran3` tarball)
10751075
p = last(sort(ps, by = p -> triplet(p)))
1076-
return download_info[p]
1076+
1077+
# @invokelatest here to not get invalidated by new defs of `==(::Function, ::Function)`
1078+
return @invokelatest getindex(download_info, p)
10771079
end
10781080

10791081
# precompiles to reduce latency (see https://github.com/JuliaLang/julia/pull/43990#issuecomment-1025692379)

0 commit comments

Comments
 (0)