Pkg.jl icon indicating copy to clipboard operation
Pkg.jl copied to clipboard

Use historical stdlib dependency information

Open staticfloat opened this issue 1 year ago • 8 comments

This makes use of the new functionality in HistoricalStdlibVersions [0] to properly pull out the dependency information in old stdlibs. This fixes https://github.com/JuliaPackaging/HistoricalStdlibVersions.jl/issues/9.

[0] https://github.com/JuliaPackaging/HistoricalStdlibVersions.jl/pull/23

staticfloat avatar Jun 03 '24 00:06 staticfloat

One point of contention here; the Pkg.Types.stdlibs() function seems to be used in the ecosystem, but I like the StdlibInfo struct a lot more than just a random tuple. Should I maintain backwards compatibility, or do we just require package authors to do something like:

if isdefined(Pkg.Types, :StdlibInfo)
    stdlib_names = [info.name for (uuid, info) in Pkg.Types.stdlibs()]
else
    stdlib_names = [name for (uuid, (name, version)) in Pkg.Types.stdlibs()]
end

staticfloat avatar Jun 03 '24 18:06 staticfloat

@KristofferC If you are happy with this, I will make a breaking v2.0.0 release of HistoricalStdlibVersions, register that, then drop the commit here that manually installs that branch. (Kudos on the [sources] section, super convenient!)

staticfloat avatar Jun 03 '24 21:06 staticfloat

Just to double-check: the Pkg.Types.stdlibs() function is not currently public, right? So in theory we are allowed to make whatever breaking changes we want?

the Pkg.Types.stdlibs() function seems to be used in the ecosystem,

Skimming that list, it looks like I'm responsible for 4 out of 7 of the usages. I'd be fine with doing a breaking change and then patching my packages to do the requisite if isdefined ....

DilumAluthge avatar Jun 04 '24 00:06 DilumAluthge

Just a quick note: a few additional usages pop up if you change the Pkg.Types.stdlibs() (in your search) to Pkg.Types.stdlibs: https://juliahub.com/ui/Search?q=Pkg.Types.stdlibs&type=code

DilumAluthge avatar Jun 04 '24 00:06 DilumAluthge

Just to double-check: the Pkg.Types.stdlibs() function is not currently public, right? So in theory we are allowed to make whatever breaking changes we want?

Yes, and perhaps the right thing to do here is to provide a stdlibs_names()::Vector{String} method for people, as it seems that's most of what people want to know. There do seem to be some people who want to check is_stdlib(::String), which we already have inside of Pkg, so it shouldn't be too hard to convert them to a new API if need be.

staticfloat avatar Jun 04 '24 00:06 staticfloat

LGTM but I would prefer leaving the stdlibs etc functions as they were and make new functions for the new info. Just because I know people use Pkg internals a bit all over the place and it seems like there is not a huge gain to modify the existing functions over adding a new one.

KristofferC avatar Jun 17 '24 08:06 KristofferC

Converting to draft so we don't accidentally merge before we remove the "drop me" commits.

DilumAluthge avatar Jun 17 '24 22:06 DilumAluthge

Alright, I'm happy with this, the new HSG version has been published and as long as @KristofferC's happy with it, I think we're good to merge.

staticfloat avatar Jun 18 '24 02:06 staticfloat

@KristofferC merge?

IanButterworth avatar Jul 12 '24 15:07 IanButterworth

Go for it!

KristofferC avatar Jul 12 '24 18:07 KristofferC

(I went for it!)

KristofferC avatar Jul 12 '24 18:07 KristofferC