julia icon indicating copy to clipboard operation
julia copied to clipboard

REPLExt for Pkg no longer loads when loading a custom Pkg

Open KristofferC opened this issue 1 year ago • 2 comments

On master:

~/JuliaPkgs/Pkg.jl
❯ julia +nightly --project -q

julia> VERSION
v"1.12.0-DEV.784"

julia> using Pkg
[ Info: Precompiling Pkg [44cfe95a-1eb2-52ea-b672-e2afdf69b78f] (cache misses: for different buildid (2), mismatched flags (2))

julia> pkg_ext = Base.PkgId(Base.uuid5(Base.UUID("44cfe95a-1eb2-52ea-b672-e2afdf69b78f"), "REPLExt"), "REPLExt")
REPLExt [e5eb5ef1-03cf-53a7-ae1d-5a66b08e832b]

julia> haskey(Base.loaded_modules, pkg_ext)
false

On 1.11.0-beta2:

julia> using Pkg

julia> pkg_ext = Base.PkgId(Base.uuid5(Base.UUID("44cfe95a-1eb2-52ea-b672-e2afdf69b78f"), "REPLExt"), "REPLExt")
REPLExt [e5eb5ef1-03cf-53a7-ae1d-5a66b08e832b]

julia> haskey(Base.loaded_modules, pkg_ext)
true

KristofferC avatar Jun 26 '24 12:06 KristofferC

I do not think this seems to be an issue with a custom Pkg. (cf. #54906)

kimikage avatar Jun 26 '24 22:06 kimikage

We might want to consider injecting REPL (and dependencies) into the visible running state (aka into explicit_loaded_modules, or remove that and use loaded_modules directly again instead), but that also has quite a number of other undesirable implications, which is why we don't do that anymore. The process now make a clean distinction between using a REPL and having REPL loaded, so if you want Pkg+REPL+REPLExt, then you need to make it explicit that you want using Pkg, REPL, and not just assume you can access the REPL as a side-effect of having loaded Pkg.

vtjnash avatar Jun 27 '24 19:06 vtjnash

I believe this can be closed now that https://github.com/JuliaLang/julia/commit/08d229f4a7cb0c3ef5becddd1b3bc4f8f178b8e4 has been reverted?

topolarity avatar Nov 25 '24 22:11 topolarity

Pkg is not in the sysimage so I don't know why that PR would have an effect on this.

KristofferC avatar Nov 25 '24 22:11 KristofferC

Ah right. I forgot we made that change for 1.11

topolarity avatar Nov 25 '24 22:11 topolarity

I think this is the require_stdlib thing that the ] key is bound to which won't load the extension of the currently active Pkg project.

KristofferC avatar Nov 25 '24 22:11 KristofferC

For completeness, the only way it is possible load a custom Pkg in interactive mode currently is julia --project -ie "using Pkg, REPL"

IanButterworth avatar Nov 25 '24 23:11 IanButterworth