Skip to content

Commit

Permalink
define show instead of repr in BinaryPlatforms (#51398)
Browse files Browse the repository at this point in the history
Co-authored-by: Keno Fischer <keno@juliacomputing.com>
  • Loading branch information
JeffBezanson and Keno authored Sep 21, 2023
1 parent 5fc5556 commit 85c96b9
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions base/binaryplatforms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -170,20 +170,18 @@ end


# Allow us to easily serialize Platform objects
function Base.repr(p::Platform; context=nothing)
str = string(
"Platform(",
repr(arch(p)),
", ",
repr(os(p)),
"; ",
join(("$(k) = $(repr(v))" for (k, v) in tags(p) if k ("arch", "os")), ", "),
")",
)
function Base.show(io::IO, p::Platform)
print(io, "Platform(")
show(io, arch(p))
print(io, ", ")
show(io, os(p))
print(io, "; ")
join(io, ("$(k) = $(repr(v))" for (k, v) in tags(p) if k ("arch", "os")), ", ")
print(io, ")")
end

# Make showing the platform a bit more palatable
function Base.show(io::IO, p::Platform)
function Base.show(io::IO, ::MIME"text/plain", p::Platform)
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))))
Expand Down

2 comments on commit 85c96b9

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package evaluation job you requested has completed - possible new issues were detected.
The full report is available.

Please sign in to comment.