JuliaLang / Pkg.jl

Pkg - Package manager for the Julia programming language
https://pkgdocs.julialang.org
Other
609 stars 251 forks source link

Bad error message when no URLs found for a package #3879

Open fredrikekre opened 2 months ago

fredrikekre commented 2 months ago

This could use a better error message:

ERROR: ArgumentError: collection must be non-empty
Stacktrace:
  [1] first
    @ ./abstractarray.jl:473 [inlined]
  [2] install_git(io::Pkg.UnstableIO, uuid::Base.UUID, name::String, hash::Base.SHA1, urls::Set{String}, version_path::String)
    @ Pkg.Operations /cache/julia-latest-linux-x86_64/share/julia/stdlib/v1.12/Pkg/src/Operations.jl:761
  [3] download_source(ctx::Pkg.Types.Context; readonly::Bool)
    @ Pkg.Operations /cache/julia-latest-linux-x86_64/share/julia/stdlib/v1.12/Pkg/src/Operations.jl:993
  [4] download_source
    @ /cache/julia-latest-linux-x86_64/share/julia/stdlib/v1.12/Pkg/src/Operations.jl:874 [inlined]
  [5] instantiate(ctx::Pkg.Types.Context; manifest::Nothing, update_registry::Bool, verbose::Bool, platform::Base.BinaryPlatforms.Platform, allow_build::Bool, allow_autoprecomp::Bool, workspace::Bool, kwargs::@Kwargs{})
    @ Pkg.API /cache/julia-latest-linux-x86_64/share/julia/stdlib/v1.12/Pkg/src/API.jl:1274
  [6] instantiate
    @ /cache/julia-latest-linux-x86_64/share/julia/stdlib/v1.12/Pkg/src/API.jl:1171 [inlined]
  [7] instantiate(; kwargs::@Kwargs{})
    @ Pkg.API /cache/julia-latest-linux-x86_64/share/julia/stdlib/v1.12/Pkg/src/API.jl:1170

I didn't dig into the details of why, but I think this happens when instantiating a manifest with packages that i) can't be installed from the package server (so it fallsback to git) and ii) are added by version (i.e. not a branch etc) from a (missing) registry.