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: no method matching stat_rep(::Nothing) while adding packages to a branch with a weakdep #3479

Closed
jishnub opened this issue May 16, 2023 · 1 comment

Comments

@jishnub
Copy link
Contributor

jishnub commented May 16, 2023

Cross-posting from https://discourse.julialang.org/t/seeking-help-with-pkg-extensions-encountering-methoderror-no-method-matching-stat-rep-nothing/98906

I’m trying to use Pkg extensions in OffsetArrays in Move Adapt to a weak dependency by jishnub · Pull Request #331 · JuliaArrays/OffsetArrays.jl · GitHub, with this modified Project.toml

While trying to add packages to this branch, I face an error:

$ julia --project -e 'using Pkg; Pkg.add(["SnoopCompileCore", "SnoopCompile"])'
   Resolving package versions...
    Updating `~/Dropbox/JuliaPackages/OffsetArrays.jl/Project.toml`
  [79e6a3ab] ERROR: MethodError: no method matching stat_rep(::Nothing)

Closest candidates are:
  stat_rep(::Pkg.Types.PackageSpec; name)
   @ Pkg ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:2045

Stacktrace:
  [1] print_diff
    @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:2068 [inlined]
  [2] print_status(env::Pkg.Types.EnvCache, old_env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, header::Symbol, uuids::Vector{Base.UUID}, names::Vector{String}; manifest::Bool, diff::Bool, ignore_indent::Bool, outdated::Bool, extensions::Bool, io::Base.TTY, mode::Pkg.Types.PackageMode, hidden_upgrades_info::Bool, show_usagetips::Bool)
    @ Pkg.Operations ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:2344
  [3] print_status
    @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:2233 [inlined]
  [4] status(env::Pkg.Types.EnvCache, registries::Vector{Pkg.Registry.RegistryInstance}, pkgs::Vector{Pkg.Types.PackageSpec}; header::Symbol, mode::Pkg.Types.PackageMode, git_diff::Bool, env_diff::Pkg.Types.EnvCache, ignore_indent::Bool, io::Base.TTY, outdated::Bool, extensions::Bool, hidden_upgrades_info::Bool, show_usagetips::Bool)
    @ Pkg.Operations ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:2464
  [5] status (repeats 2 times)
    @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:2435 [inlined]
  [6] #show_update#167
    @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:2431 [inlined]
  [7] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, new_git::Set{Base.UUID}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform)
    @ Pkg.Operations ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:1393
  [8] add
    @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:1372 [inlined]
  [9] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, kwargs::Base.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
    @ Pkg.API ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/API.jl:275
 [10] add(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/API.jl:156
 [11] add(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/API.jl:145
 [12] #add#25
    @ ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/API.jl:144 [inlined]
 [13] add(pkgs::Vector{String})
    @ Pkg.API ~/packages/julias/julia-1.9/share/julia/stdlib/v1.9/Pkg/src/API.jl:144
 [14] top-level scope
    @ none:1

I’m unsure about what’s causing this, but given that this is my first attempt at Pkg extensions, it’s possible that I’ve not set things up correctly. Some help is welcome!

@fredrikekre
Copy link
Member

#3327

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants