Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Artifacts: Change Dict{AbstractPlatform} to Dict{Platform} to reduce Pkg invalidations #54073

Merged
Merged
Prev Previous commit
Next Next commit
Revert "Make compatible with BinaryBuilderBase.AnyPlatform"
This reverts commit a6c9841.
  • Loading branch information
mkitti committed Jun 18, 2024
commit 843b80b9d4b349c7761ec7dcacaf30474da66d14
6 changes: 3 additions & 3 deletions base/Base.jl
Original file line number Diff line number Diff line change
@@ -467,6 +467,9 @@ using .Order
include("sort.jl")
using .Sort

# BinaryPlatforms, used by Artifacts. Needs `Sort`.
include("binaryplatforms.jl")

# Fast math
include("fastmath.jl")
using .FastMath
@@ -503,9 +506,6 @@ using .StackTraces
# experimental API's
include("experimental.jl")

# BinaryPlatforms, used by Artifacts. Needs `Sort`.
include("binaryplatforms.jl")

# utilities
include("deepcopy.jl")
include("download.jl")
15 changes: 5 additions & 10 deletions base/binaryplatforms.jl
Original file line number Diff line number Diff line change
@@ -178,7 +178,6 @@ end

# Allow us to easily serialize Platform objects
function Base.show(io::IO, p::Platform)
os(p) == "any" && return print(io, "any")
print(io, "Platform(")
show(io, arch(p))
print(io, ", ")
@@ -190,7 +189,6 @@ end

# Make showing the platform a bit more palatable
function Base.show(io::IO, ::MIME"text/plain", p::Platform)
os(p) == "any" && return print(io, "any")
str = string(platform_name(p), " ", arch(p))
# Add on all the other tags not covered by os/arch:
other_tags = sort!(filter!(kv -> kv[1] ∉ ("os", "arch"), collect(tags(p))))
@@ -550,29 +548,26 @@ function triplet(p::AbstractPlatform)
end

function os_str(p::AbstractPlatform)
_os = os(p)
if _os == "linux"
if os(p) == "linux"
return "-linux"
elseif _os == "macos"
elseif os(p) == "macos"
osvn = os_version(p)
if osvn !== nothing
return "-apple-darwin$(osvn.major)"
else
return "-apple-darwin"
end
elseif _os == "windows"
elseif os(p) == "windows"
return "-w64-mingw32"
elseif _os == "freebsd"
elseif os(p) == "freebsd"
osvn = os_version(p)
if osvn !== nothing
return "-unknown-freebsd$(osvn.major).$(osvn.minor)"
else
return "-unknown-freebsd"
end
elseif _os == "openbsd"
elseif os(p) == "openbsd"
return "-unknown-openbsd"
elseif _os == "any"
return ""
else
return "-unknown"
end