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

Don't assume Plutos deps are available from toplevel #542

Closed
fredrikekre opened this issue Oct 7, 2020 · 10 comments
Closed

Don't assume Plutos deps are available from toplevel #542

fredrikekre opened this issue Oct 7, 2020 · 10 comments
Labels
backend Concerning the julia server and runtime help welcome If you are experienced in this topic - let us know!

Comments

@fredrikekre
Copy link
Contributor

Running Julia with a custom load path doesn't work since Pluto assumes that it can load stdlibs from toplevel.

@fonsp
Copy link
Owner

fonsp commented Oct 7, 2020

If the stdlibs (listed here) aren't available to the runner process, then is there any way for us to load them anyways? Otherwise a custom load path is just not supported.

@fredrikekre
Copy link
Contributor Author

You can presumably load them from the Pluto namespace (see e.g. JuliaLang/IJulia.jl#951)

@fonsp
Copy link
Owner

fonsp commented Oct 7, 2020

Pluto isn't loaded on the notebook process (Distributed process), it only loads one file, which imports the stdlibs: https://github.com/fonsp/Pluto.jl/blob/master/src/runner/PlutoRunner.jl

@fonsp fonsp added help welcome If you are experienced in this topic - let us know! backend Concerning the julia server and runtime labels Oct 15, 2020
@fonsp
Copy link
Owner

fonsp commented Oct 15, 2020

(I don’t know how to fix this. Does not seem like a priority though.)

@fonsp
Copy link
Owner

fonsp commented Oct 15, 2020

@Roger-luo any ideas?

@fonsp fonsp added the one day Closed because we won't work on it soon, will be opened again later. label Oct 15, 2020
@fonsp fonsp closed this as completed Oct 15, 2020
@Roger-luo
Copy link
Contributor

I guess the solution is to let Pluto workspace runner use a Pluto specific environment to launch processes, then each process will own their own project? I'm not sure if I understand the problem correctly tho @fredrikekre

@KristofferC
Copy link

KristofferC commented Oct 15, 2020

You cannot really start a new process and import a bunch of packages at the top level, the environment system doesn't work like that. Starting a new process, importing Pluto in it, and accessing everything from that (Pluto.XXX) would be the correct way according to how the environment system works. The user has added and loaded Pluto, and that is the only thing you can ensure can be loaded.

@fonsp
Copy link
Owner

fonsp commented Oct 15, 2020

Thanks everyone!

@fonsp
Copy link
Owner

fonsp commented Nov 5, 2020

(note to self/contributors)

I was able to reproduce it like so:

fons@woof:~$ julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.5.0-rc1.0 (2020-06-26)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.5) pkg> activate --temp
 Activating new environment at `/tmp/jl_a0cvvq/Project.toml`

(jl_a0cvvq) pkg> dev /home/fons/Pluto.jl
...

julia> LOAD_PATH
3-element Array{String,1}:
 "@"
 "@v#.#"
 "@stdlib"

julia> deleteat!(LOAD_PATH, 2)
2-element Array{String,1}:
 "@"
 "@stdlib"

julia> deleteat!(LOAD_PATH, 2)
1-element Array{String,1}:
 "@"

julia> import Pluto; Pluto.run()

this gave:
image

fonsp added a commit that referenced this issue Nov 5, 2020
@fonsp fonsp removed the one day Closed because we won't work on it soon, will be opened again later. label Nov 5, 2020
@fonsp
Copy link
Owner

fonsp commented Nov 5, 2020

Fixed in 82ed697 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Concerning the julia server and runtime help welcome If you are experienced in this topic - let us know!
Projects
None yet
Development

No branches or pull requests

4 participants