-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
REPLExt: no method matching repl_init(::REPL.LineEditREPL) when loading packages in REPL mode. #56216
Comments
This is either a duplicate of #56091 (comment) or a Pkg bug (wrongly assuming that |
I am facing the exact same issue with Plots.jl |
@vtjnash, how do you add a new REPL mode right now from a package? You keep saying these are bugs but they weren't bugs until the code under it changed and caused the bugs? |
I added Depot path to move packages from c to d |
So i deleted everything in new Depot path on d disk |
writing using Pkg in startup.jl file worked |
I tried removing the |
I just hit this when using a modified version of REPL on nightly, without a custom depot, but I guess it meant REPL was precompiled to the user depot, which might be relevant. But shouldn't i.e. I don't think JuliaLang/Pkg.jl#4067 fixes this..
|
I started seeing this issue after updating Julia from 1.10 to 1.11.1. In my case the package that triggers it is Plots.jl. My
Stack traceERROR: InitError: MethodError: no method matching repl_init(::REPL.LineEditREPL)
The function `repl_init` exists, but no method is defined for this combination of argument types.
Closest candidates are:
repl_init(::REPL.AbstractREPL)
@ REPLExt ~/Packages/julia/juliaup/julia-1.11.1+0.x64.linux.gnu/share/julia/stdlib/v1.11/Pkg/ext/REPLExt/REPLExt.jl:163
Stacktrace:
[1] __init__()
@ REPLExt ~/Packages/julia/juliaup/julia-1.11.1+0.x64.linux.gnu/share/julia/stdlib/v1.11/Pkg/ext/REPLExt/REPLExt.jl:305
[2] run_module_init(mod::Module, i::Int64)
@ Base ./loading.jl:1336
[3] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
@ Base ./loading.jl:1324
[4] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{…}, ignore_native::Nothing; register::Bool)
@ Base ./loading.jl:1213
[5] _include_from_serialized (repeats 2 times)
@ ./loading.jl:1169 [inlined]
[6] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128, stalecheck::Bool; reasons::Dict{…}, DEPOT_PATH::Vector{…})
@ Base ./loading.jl:1969
[7] _require(pkg::Base.PkgId, env::String)
@ Base ./loading.jl:2450
[8] __require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:2315
[9] #invoke_in_world#3
@ ./essentials.jl:1089 [inlined]
[10] invoke_in_world
@ ./essentials.jl:1086 [inlined]
[11] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:2302
[12] macro expansion
@ ./loading.jl:2241 [inlined]
[13] macro expansion
@ ./lock.jl:273 [inlined]
[14] __require(into::Module, mod::Symbol)
@ Base ./loading.jl:2198
[15] #invoke_in_world#3
@ ./essentials.jl:1089 [inlined]
[16] invoke_in_world
@ ./essentials.jl:1086 [inlined]
[17] require(into::Module, mod::Symbol)
@ Base ./loading.jl:2191
[18] top-level scope
@ ~/Packages/julia/packages/Plots/kLeqV/src/backends.jl:568
[19] eval
@ ./boot.jl:430 [inlined]
[20] _initialize_backend(pkg::Plots.PlotlyBackend)
@ Plots ~/Packages/julia/packages/Plots/kLeqV/src/backends.jl:567
[21] backend(pkg::Plots.PlotlyBackend)
@ Plots ~/Packages/julia/packages/Plots/kLeqV/src/backends.jl:245
[22] plotly
@ ~/Packages/julia/packages/Plots/kLeqV/src/backends.jl:86 [inlined]
[23] plot_standings(get_schedule::typeof(GraphicalNhlStandings.read_cached_schedule))
@ GraphicalNhlStandings ~/coding/GraphicalNhlStandings/src/GraphicalNhlStandings.jl:120
[24] top-level scope
@ REPL[2]:1 |
Is this supposed to be fixed in Julia 1.11.2? I still see this error with the release-1.11 branch when loading for example TerminalPager. If I unset |
Can you share the error message. It should at least be different. |
Here it is. You are right, it's slightly different.
|
My guess is we have two versions of REPL loaded and it's interacting badly, but it's really unclear to me. I also don't understand why this is happening only when you set JULIA_DEPOT_PATH @vtjnash |
You need #55908, which I believe is v1.11.2 |
The above is on the tip of release-1.11 229f027 so that's either not there or not working |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
It is on release-1.11 so #55908 didn't fix this. |
Oh, if you also have JULIA_DEPOT_PATH that excludes stdlib, that is an explicit directive never to load the one in stdlib for the user, so this is working as expected |
We have a test to make sure this does it correctly with |
So what's the actual reason for the failure here? If the bundled cache isn't loaded because JULIA_DEPOT_PATH is missing |
The failure here is a failure of some packages to correctly respect the API of the Base.active_repl value. In particular, it is a private value that is unsafe to access from |
In case it matters: I'm using
EDIT: Another package where this problem occurs is Cthulhu, see JuliaDebug/Cthulhu.jl#608. |
Yet
|
Yes, while some names may print the same, that won't guarantee they are the same type |
Once #54654 merges, that will be true even less frequently than it is now |
So when there's no trailing : we get two different REPL modules loaded, and errors like this. When JULIA_DEPOT_PATH isnt set or there's a trailing : we only get one REPL module loaded? If so, I don't understand why that's desirable. |
It is the meaning of the : is whether or not the stdlibs are supposed to be available to extended in package code. Without the : the stdlib code is not supposed to be extended as the user has taken that out of their path. However, in no case is extension supposed to occur anyways of stdlibs, as that is documented as being piracy or private |
Wasn't that for the load path rather than the depot path? |
Behaviour
When loading some packages in REPL,
REPLExt
throws an exception.Expected behaviour
No exception thrown?
Reproduce
To reproduce:
julia-release --startup-file=no -t 1
using IJulia
(or other packages)Packages that reproduce the bug:
IJulia
Pluto
CairoMakie
Packages that don't reproduce the bug:
StaticArrays
PackageCompiler
Version info:
Stack trace
Extra information
The text was updated successfully, but these errors were encountered: