Skip to content

Commit a6c9841

Browse files
committed
Make compatible with BinaryBuilderBase.AnyPlatform
1 parent 6aa03de commit a6c9841

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

base/Base.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,9 +463,6 @@ using .Order
463463
include("sort.jl")
464464
using .Sort
465465

466-
# BinaryPlatforms, used by Artifacts. Needs `Sort`.
467-
include("binaryplatforms.jl")
468-
469466
# Fast math
470467
include("fastmath.jl")
471468
using .FastMath
@@ -505,6 +502,9 @@ using .StackTraces
505502
# experimental API's
506503
include("experimental.jl")
507504

505+
# BinaryPlatforms, used by Artifacts. Needs `Sort`.
506+
include("binaryplatforms.jl")
507+
508508
# utilities
509509
include("deepcopy.jl")
510510
include("download.jl")

base/binaryplatforms.jl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ end
178178

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

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

550552
function os_str(p::AbstractPlatform)
551-
if os(p) == "linux"
553+
_os = os(p)
554+
if _os == "linux"
552555
return "-linux"
553-
elseif os(p) == "macos"
556+
elseif _os == "macos"
554557
osvn = os_version(p)
555558
if osvn !== nothing
556559
return "-apple-darwin$(osvn.major)"
557560
else
558561
return "-apple-darwin"
559562
end
560-
elseif os(p) == "windows"
563+
elseif _os == "windows"
561564
return "-w64-mingw32"
562-
elseif os(p) == "freebsd"
565+
elseif _os == "freebsd"
563566
osvn = os_version(p)
564567
if osvn !== nothing
565568
return "-unknown-freebsd$(osvn.major).$(osvn.minor)"
566569
else
567570
return "-unknown-freebsd"
568571
end
569-
elseif os(p) == "openbsd"
572+
elseif _os == "openbsd"
570573
return "-unknown-openbsd"
574+
elseif _os == "any"
575+
return ""
571576
else
572577
return "-unknown"
573578
end

0 commit comments

Comments
 (0)