-
-
Notifications
You must be signed in to change notification settings - Fork 270
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
Move Artifacts and BinaryPlatforms out of Pkg #2001
Conversation
a1eb91e
to
0956a93
Compare
This will fail until we merge JuliaLang/julia#37320, but on my local machine, when run with that version it passes tests. |
This splits `BinaryPlatforms` and `Artifacts` out of `Pkg` and into `Base`/a separate stdlib. In the process, we significantly reworked `BinaryPlatforms`, and so to maintain backwards-compatibility, we define a set of compatability functions.
0956a93
to
e567349
Compare
Even the name of this branch is awesome. |
How much of julia> methods(Base.BinaryPlatforms.libgfortran_version, (Base.BinaryPlatforms.AbstractPlatform,))
# 5 methods for generic function "libgfortran_version":
[1] libgfortran_version(p::Pkg.BinaryPlatforms.Linux) in Pkg.BinaryPlatforms at /home/tim/src/julia-master/usr/share/julia/stdlib/v1.9/Pkg/src/BinaryPlatforms_compat.jl:80
[2] libgfortran_version(p::Pkg.BinaryPlatforms.Windows) in Pkg.BinaryPlatforms at /home/tim/src/julia-master/usr/share/julia/stdlib/v1.9/Pkg/src/BinaryPlatforms_compat.jl:80
[3] libgfortran_version(p::Pkg.BinaryPlatforms.MacOS) in Pkg.BinaryPlatforms at /home/tim/src/julia-master/usr/share/julia/stdlib/v1.9/Pkg/src/BinaryPlatforms_compat.jl:80
[4] libgfortran_version(p::Pkg.BinaryPlatforms.FreeBSD) in Pkg.BinaryPlatforms at /home/tim/src/julia-master/usr/share/julia/stdlib/v1.9/Pkg/src/BinaryPlatforms_compat.jl:80
[5] libgfortran_version(p::Base.BinaryPlatforms.AbstractPlatform) in Base.BinaryPlatforms at binaryplatforms.jl:453 5 is more than the limit of 3 for successful abstract inference. It means that calls like Unless we delete these "compat" methods, every call site needs to be annotated Pkg.jl/src/BinaryPlatforms_compat.jl Lines 78 to 82 in 503f31f
|
I think we can try deleting it, but we'll probably need to do a PkgEval run to see how many people are actually still using these. A quick julia hub code search shows that nobody other than JLL packages are attempting to use Alternatively, we can just simplify this code to be less dispatch-heavy. Those methods you've noticed at the end are the same for all of these "compat" types, so we can just simply hoist the definition out of the loop and provide a union type as the argument:
|
We can cap compatibility of BinaryProvider in the registry. It's already quite broken in latest releases. |
I made a failed run at this in #3017. I just don't know enough about the requirements to do this well. |
Thanks for the suggestion @staticfloat, that seemed to work well (#3020). |
This PR guts the
Artifacts
andBinaryPlatforms
modules, replacing them with imports from Base and stdlibs. This will obviously not pass until JuliaLang/julia#37320 is merged.