fonsp / Pluto.jl

🎈 Simple reactive notebooks for Julia
https://plutojl.org/
MIT License
4.91k stars 284 forks source link

call _get_registries() in __init__ of PkgCompat.jl #2815

Closed j-fu closed 4 months ago

j-fu commented 4 months ago

See https://docs.julialang.org/en/v1/manual/modules/#Module-initialization-and-precompilation

Probably solved part of #2810

github-actions[bot] commented 4 months ago

Try this Pull Request!

Open Julia and type:

  julia> import Pkg
  julia> Pkg.activate(temp=true)
  julia> Pkg.add(url="https://github.com/j-fu/Pluto.jl", rev="fix_registry_init")
  julia> using Pluto
fonsp commented 4 months ago

Thanks! Can you check the PR files for unwanted changes?

j-fu commented 4 months ago

I think this is a longer story, as precompilation would have to be refactored, it calls RegistryInstances.reachable_registries() as well.

In the moment it is switched off in order to see what else could happen. I can try to get a more comprehensive refactoring.

I did run with a patched Pkg in order to see if it works. As a result I get what is in the screenshot, so it seems that there is still another issue:

tryagain

j-fu commented 4 months ago

Ok what do we have now on nightly ?

j-fu commented 4 months ago

For the complete_remote_package problem I used the band-aid proposed in https://github.com/fonsp/Pluto.jl/issues/2810#issuecomment-1943750071

I think it may make sense to make a PR to Pkg which marks internal things used by Pluto as public in Julia 1.11 sense, making these public interface.

j-fu commented 4 months ago

Ah, nicer stactrace now :)

no-resize2

j-fu commented 4 months ago

Now it works with dev'd HTTP.jl - the difference seems to be just one commit which also appears to be about the new Memory type: https://github.com/JuliaWeb/HTTP.jl/commit/040cf0ac773670bbd1ea66e91715583a02537213

Not sure though if returning a view is a good idea. Will need through testing.

As for the Pkg stuff: I would go with @balenamiaa's hack implemented here and fix the Pkg stuff in a different PR when the public interface issues have been resolved.

j-fu commented 4 months ago

Guess it remains to wait now for a new release of HTTP.jl ...

j-fu commented 4 months ago

Still need https://github.com/JuliaWeb/HTTP.jl/commit/040cf0ac773670bbd1ea66e91715583a02537213 to be released, see https://github.com/JuliaWeb/HTTP.jl/issues/1154

j-fu commented 4 months ago

worked locally now under 1.6, 1.11.0-alpha1 and nigthly.

fonsp commented 4 months ago

Thanks! Let's work on the method table problems in another PR...

fonsp commented 4 months ago

The method table issue is here https://github.com/fonsp/Pluto.jl/issues/2840

fonsp commented 4 months ago

Thanks again @j-fu ! The other issue was only on Julia 1.12 (nightly), I now changed our CI to run the 1.11 preview and 1.12 nightly separately: https://github.com/fonsp/Pluto.jl/commit/fabde1ff780badd91ac05fb59924679a33ccac2c

The new issue was caused by a change in Julia specifically meant to improve Pluto support! Super cool :) https://github.com/JuliaLang/julia/pull/53415