Skip to content
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

MethodError upon using Pkg.add() with a PackageSpec with unspecified version #3885

Open
topolarity opened this issue May 1, 2024 · 0 comments
Labels
Milestone

Comments

@topolarity
Copy link
Member

$ cat Project.toml
name = "FooPackage"
uuid = "7da9e4b2-06fe-11ef-02e0-95e6aca98d3b"
$ julia +nightly --project=. -e "using Pkg; Pkg.add(Pkg.PackageSpec(name=\"SuiteSparse\", uuid=\"4607b0f0-06f3-5cda-b6b1-a6196a1729e9\"))"
    Updating registry at `~/.julia/registries/JuliaComputingRegistry.toml`
    Updating registry at `~/.julia/registries/JuliaHubRegistry.toml`
    Updating registry at `~/.julia/registries/JuliaSimRegistry.toml`
    Updating registry at `~/.julia/registries/PumasRegistry.toml`
    Updating registry at `~/.julia/registries/TestRegistry.toml`
    Updating registry at `~/.julia/registries/githubjuliaregistryjdb.toml`
    Updating registry at `~/.julia/registries/gitlabjuliaregistryjdb.toml`
   Resolving package versions...
ERROR: MethodError: no method matching thispatch(::Nothing)
The function `thispatch` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  thispatch(::VersionNumber)
   @ Base version.jl:233

Stacktrace:
 [1] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, new_git::Set{Base.UUID}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, target::Symbol)
   @ Pkg.Operations ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/Pkg/src/Operations.jl:1523
 [2] add
   @ ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/Pkg/src/Operations.jl:1481 [inlined]
 [3] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, target::Symbol, kwargs::@Kwargs{io::Pkg.UnstableIO})
   @ Pkg.API ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/Pkg/src/API.jl:306
 [4] add(pkgs::Vector{Pkg.Types.PackageSpec}; io::Pkg.UnstableIO, kwargs::@Kwargs{})
   @ Pkg.API ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/Pkg/src/API.jl:159
 [5] add(pkgs::Vector{Pkg.Types.PackageSpec})
   @ Pkg.API ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/Pkg/src/API.jl:148
 [6] top-level scope
   @ none:1
 [7] eval
   @ ./boot.jl:432 [inlined]
 [8] exec_options(opts::Base.JLOptions)
   @ Base ./client.jl:291
 [9] _start()
   @ Base ./client.jl:533

Works on 1.10, broken on 1.11 and nightly.

@topolarity topolarity added the bug label May 1, 2024
@fredrikekre fredrikekre added this to the 1.11 milestone May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants