Closed danielmatz closed 1 year ago
I don't think this is a good approach. Pkg has its own API to analyse registries, whether they are gzipped or not, should use that instead
Yes, I see Pkg has a Pkg.Registry.reachable_registries
function as of Julia 1.7.
Are you proposing that this package require Julia 1.7 or newer and remove its duplicate implementations of the registry-related code?
Or should I detect the Julia version and use the Pkg API if available, and otherwise fall back to the existing registry code in PkgDeps, which would not support tarballs?
I guess that's a question for @mattBrzezinski. The question boils down to whether supporting julia v1.6 is important, or we can drop it and move to v1.7+ only. We have a similar situation in PackageAnalyzer, there I'd be ok with dropping v1.6 and moving to v1.7+ only.
OK, I made a new PR with the approach of requiring Julia 1.7. See #39.
I guess that's a question for @mattBrzezinski. The question boils down to whether supporting julia v1.6 is important, or we can drop it and move to v1.7+ only. We have a similar situation in PackageAnalyzer, there I'd be ok with dropping v1.6 and moving to v1.7+ only.
I would prefer to maintain support for LTS versions of Julia.
Well, the LTS version of Julia won't create gzipped tarballs. I bumped the julia compat entry in my other PR. So, I suppose we could release v0.7 of this package, which would require Julia 1.7, while maintaining v0.6 for the LTS version of Julia?
Alternatively, I could rework my PR so that it uses the Pkg API for Julia 1.7+, but gracefully falls back to your existing code for the LTS.
We could instead do something nifty like this to handle the differences between versions!
OK, I took a stab at it in my other PR.
Closing this in favor of #42.
Starting with Julia 1.7, a registry can also be stored in a depot as a gzipped tarball. This commit unpacks the tarball into a temporary directory. This was the simplest way to support this new feature.
This implementation will unpack a fresh copy of the registry on every call to
reachable_registries
. We could instead cache the temporary directory for future calls.There's an open PR for the Tar.jl package that will be of future interest:
https://github.com/JuliaIO/Tar.jl/pull/95
This would allow us to instead stream the individual files straight out of the tarball, rather than having to unpack it into a temporary location.