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 in diff print: no method matching stat_rep(::Nothing) #3327

Closed
fredrikekre opened this issue Jan 19, 2023 · 8 comments · Fixed by #3591
Closed

MethodError in diff print: no method matching stat_rep(::Nothing) #3327

fredrikekre opened this issue Jan 19, 2023 · 8 comments · Fixed by #3591

Comments

@fredrikekre
Copy link
Member

fredrikekre commented Jan 19, 2023

ERROR: LoadError: MethodError: no method matching stat_rep(::Nothing)
Closest candidates are:
  stat_rep(::Pkg.Types.PackageSpec; name)
   @ Pkg /opt/julia/julia-1.9.0/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:1991
Stacktrace:
  [1] print_diff
    @ /opt/julia/julia-1.9.0/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:2014 [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}; man
ifest::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 /opt/julia/julia-1.9.0/share/julia/stdlib/v1.9/Pkg/src/Operations.jl:2290**

Julia 1.9 beta3

@KristofferC
Copy link
Sponsor Member

What's the package it is trying to stat_rep? Was it added/removed between the diffs?

@fredrikekre
Copy link
Member Author

$ pkg --project=. add SimpleWeightedGraphs
   Resolving package versions...
    Updating `~/dev/Metis/Project.toml`
  [86223c79] + Graphs v1.7.4
  [093fc24a] ERROR: LoadError: MethodError: no method matching stat_rep(::Nothing)

So I guess package 093fc24a is to blame, which is LightGraphs. I can't reproduce the error now though.

@fredrikekre
Copy link
Member Author

Nevermind, I can.
Manifest.txt
Project.txt

@jakobnissen
Copy link
Contributor

I also encountered this. Here's how I hit the problem:

To reproduce:
I'm on Julia 1.9.0, on Linux x86-64 glibc.
Run the following shell commands:

mkdir foo
cd foo
git clone http://github.com/BioJulia/BioSymbols.jl
cd BioSymbols.jl
git clone http://github.com/BioJulia/FASTX.jl
julia --color=yes --project=FASTX.jl

Then, in Julia:

using Pkg
Pkg.develop(PackageSpec(path="."))

@IanButterworth
Copy link
Sponsor Member

It'd be good to fix this. Just hit it dev-ing a dep

@gdalle
Copy link
Contributor

gdalle commented Aug 8, 2023

Do we know why this happens?

@IanButterworth
Copy link
Sponsor Member

Worth noting that this happens with add too

$ mkdir foo
$ cd foo
$ git clone http://github.com/BioJulia/BioSymbols.jl
$ cd BioSymbols.jl
$ git clone http://github.com/BioJulia/FASTX.jl
$ julia --color=yes --project=FASTX.jl
FASTX.jl pkg> add .
...
  [67c07d97] + Automa v1.0.0
  [47718e42] + BioGenerics v0.1.2
  [7e6ae17a] ERROR: MethodError: no method matching stat_rep(::Nothing)
...

@IanButterworth
Copy link
Sponsor Member

IanButterworth commented Aug 17, 2023

This turns out to be because parts of Pkg weren't aware of the way that weakdeps can be listed in both [weakdeps] and [deps] as a way to make them deps on <1.9 and weakdeps on 1.9+

Fix #3591

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

Successfully merging a pull request may close this issue.

5 participants