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
Convert AbstractPlatform to Platform #3874
Open
mkitti
wants to merge
1
commit into
JuliaLang:master
Choose a base branch
from
mkitti:mkitti-convert-to-platform
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Before this pull request: julia> using SnoopCompileCore, Pkg
julia> invalidations = @snoopr using BinaryBuilderBase;
julia> using SnoopCompile
julia> trees = invalidation_trees(invalidations)
3-element Vector{SnoopCompile.MethodInvalidations}:
inserting joinpath(prefix::Prefix, args...) @ BinaryBuilderBase ~/.julia/packages/BinaryBuilderBase/tGUXK/src/Prefix.jl:68 invalidated:
mt_backedges: 1: signature Tuple{typeof(joinpath), Any, String} triggered MethodInstance for Artifacts.jointail(::Any, ::String) (0 children)
inserting repr(p::FileProduct) @ BinaryBuilderBase ~/.julia/packages/BinaryBuilderBase/tGUXK/src/Products.jl:463 invalidated:
backedges: 1: superseding repr(x; context) @ Base strings/io.jl:286 with MethodInstance for repr(::Any) (43 children)
inserting tags(p::AnyPlatform) @ BinaryBuilderBase ~/.julia/packages/BinaryBuilderBase/tGUXK/src/Platforms.jl:14 invalidated:
mt_backedges: 1: signature Tuple{typeof(Base.BinaryPlatforms.tags), Base.BinaryPlatforms.AbstractPlatform} triggered MethodInstance for Base.BinaryPlatforms.triplet(::Base.BinaryPlatforms.AbstractPlatform) (0 children)
2: signature Tuple{typeof(Base.BinaryPlatforms.tags), Base.BinaryPlatforms.AbstractPlatform} triggered MethodInstance for Base.BinaryPlatforms.libgfortran_version(::Base.BinaryPlatforms.AbstractPlatform) (1 children)
3: signature Tuple{typeof(Base.BinaryPlatforms.tags), Base.BinaryPlatforms.AbstractPlatform} triggered MethodInstance for Base.BinaryPlatforms.cxxstring_abi(::Base.BinaryPlatforms.AbstractPlatform) (1 children)
4: signature Tuple{typeof(Base.BinaryPlatforms.tags), Base.BinaryPlatforms.AbstractPlatform} triggered MethodInstance for Base.BinaryPlatforms.libstdcxx_version(::Base.BinaryPlatforms.AbstractPlatform) (1 children)
5: signature Tuple{typeof(Base.BinaryPlatforms.tags), Base.BinaryPlatforms.AbstractPlatform} triggered MethodInstance for Base.BinaryPlatforms.os_version(::Base.BinaryPlatforms.AbstractPlatform) (2 children)
6: signature Tuple{typeof(Base.BinaryPlatforms.tags), Base.BinaryPlatforms.AbstractPlatform} triggered MethodInstance for Base.BinaryPlatforms.call_abi(::Base.BinaryPlatforms.AbstractPlatform) (2 children)
7: signature Tuple{typeof(Base.BinaryPlatforms.tags), Base.BinaryPlatforms.AbstractPlatform} triggered MethodInstance for Base.BinaryPlatforms.arch(::Base.BinaryPlatforms.AbstractPlatform) (2 children)
8: signature Tuple{typeof(Base.BinaryPlatforms.tags), Base.BinaryPlatforms.AbstractPlatform} triggered MethodInstance for Base.BinaryPlatforms.os(::Base.BinaryPlatforms.AbstractPlatform) (2 children)
9: signature Tuple{typeof(Base.BinaryPlatforms.tags), Base.BinaryPlatforms.AbstractPlatform} triggered MethodInstance for Base.BinaryPlatforms.var"#Platform#8"(::Base.Pairs{Symbol, Union{}, Tuple{}, @NamedTuple{}}, ::Type{Platform}, ::Base.BinaryPlatforms.AbstractPlatform) (5 children)
10: signature Tuple{typeof(Base.BinaryPlatforms.tags), Base.BinaryPlatforms.AbstractPlatform} triggered MethodInstance for Base.BinaryPlatforms.libc(::Base.BinaryPlatforms.AbstractPlatform) (60 children) After this pull request: julia> using SnoopCompileCore, Pkg
julia> invalidations = @snoopr using BinaryBuilderBase;
julia> using SnoopCompile
julia> trees = invalidation_trees(invalidations)
2-element Vector{SnoopCompile.MethodInvalidations}:
inserting joinpath(prefix::Prefix, args...) @ BinaryBuilderBase ~/.julia/packages/BinaryBuilderBase/tGUXK/src/Prefix.jl:68 invalidated:
mt_backedges: 1: signature Tuple{typeof(joinpath), Any, String} triggered MethodInstance for Artifacts.jointail(::Any, ::String) (0 children)
inserting repr(p::FileProduct) @ BinaryBuilderBase ~/.julia/packages/BinaryBuilderBase/tGUXK/src/Products.jl:463 invalidated:
backedges: 1: superseding repr(x; context) @ Base strings/io.jl:286 with MethodInstance for repr(::Any) (43 children) |
mkitti
commented
Apr 19, 2024
@@ -64,6 +64,8 @@ end | |||
|
|||
const PlatformUnion = Union{Linux,MacOS,Windows,FreeBSD} | |||
|
|||
Base.convert(::Type{Platform}, p::PlatformUnion) = p.p |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm highlighting this change.
Here we convert most of the AbstractPlatform
subtypes to Platform
by unwrapping them.
The one outlier is UnknownPlatform
but there is another pull request to address that.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request hardens Pkg.jl from invalidations involving
AbstractPlatform
. WhenAbstractPlatform
is used as the type of a keyword argument, Julia may notspecialize on the type.
This pull request inserts
convert(Platform, platform)::Platform
to all functions that takeplatform::AbstractPlatform
as a keyword argument.