JuliaEcosystem / PackageAnalyzer.jl

https://juliaecosystem.github.io/PackageAnalyzer.jl/dev/
MIT License
58 stars 5 forks source link

Deal with compressed registry in Julia v1.7 #67

Closed giordano closed 1 year ago

giordano commented 2 years ago

At the moment we assume the registry is uncompressed on disk. For users in Julia v1.7+ this may not be the case. Pkg.jl in Julia v1.7 comes with an API to deal with the registry in all cases (both compressed and uncompressed) which is probably the best option, that'd mean to drop support for Julia v1.6, but I believe that's reasonable.

ufechner7 commented 2 years ago

Is there a workaround? I always get the following error message:

julia> analyze("DataFrames")
ERROR: ArgumentError: collection must be non-empty
Stacktrace:
 [1] first
   @ ./abstractarray.jl:419 [inlined]
 [2] general_registry
   @ ~/.julia/packages/PackageAnalyzer/8nIpt/src/PackageAnalyzer.jl:165 [inlined]
 [3] analyze(name_or_dir_or_url::String)
   @ PackageAnalyzer ~/.julia/packages/PackageAnalyzer/8nIpt/src/PackageAnalyzer.jl:453
 [4] top-level scope
   @ REPL[8]:1
giordano commented 2 years ago

As I said above already, the uncompressed registry (e.g. as a git repository) still works. The alternative is for someone to write the code to use the API in Julia v1.7+ to deal with both formats, but I'm not very motivated to do that since locally I still use the uncompressed registry.

ufechner7 commented 2 years ago

But how can I get an uncompressed registry? I did:

cd .julia/registries
tar xzf General.tar.gz

But this did not help.

ufechner7 commented 2 years ago

And why not merging https://github.com/JuliaEcosystem/PkgDeps.jl/pull/39 which should fix this issue?

giordano commented 2 years ago

BrainFlow@4.9.2

You'd have to opt-out the PkgServer by setting the environment variable JULIA_PKG_SERVER=""

And why not merging https://github.com/JuliaEcosystem/PkgDeps.jl/pull/39 which should fix this issue?

Because the two packages aren't related in any way?

giordano commented 2 years ago

What version of PackageAnalyzer.jl are you using? There may actually be a simple workaround without messing with Julia's registry

ufechner7 commented 2 years ago
(Analyze) pkg> st
      Status `~/repos/Analyze/Project.toml`
  [b19fd437] KiteControllers v0.1.3
  [e713c705] PackageAnalyzer v0.1.0
ufechner7 commented 2 years ago

I tried: JULIA_PKG_SERVER="" before launching Julia.

But I still get the same error: ERROR: ArgumentError: collection must be non-empty