Pluto.jl
Pluto.jl copied to clipboard
Pkg env folder can get deleted during session
If a notebook is left running for a really long time, the temporary folder storing its environment can get cleaned up by the system.
This leaves the notebook in a broken state, but it will manifest in unusual ways, such as by UndefVarErrors due to missing packages that should have been loaded.
It would be helpful if Pluto could detect if the environment folder has been deleted and require the notebook to be restarted.
Going to bump this. Might be an easy thing for me to address, if I know where to look. Is there something that already is polling regularly that this function could be added into or could duplicate?
I imagine Pluto could just monitor the environment folder to see if it is still present, and if it is not, present the notification bar to have the user reload the notebook. Perhaps an advanced version could proactively regenerate the environment?
Maybe we should store the env somewhere else that will not get deleted, like in a Scratch.jl space?
With Scratch.jl my only question is how to clean up the environment after you shut down the notebook / shut down Pluto.
This is where we create the directory:
https://github.com/fonsp/Pluto.jl/blob/ac2c422ddbaf76c1e041be9019977e348400e6da/src/notebook/saving%20and%20loading.jl#L276
Running into this issue myself! It leads to weird errors...
I asked for more information about Scratch spaces, it would be nice if the auto cleanup was done by Pkg.gc instead of having to implement this ourselves: https://github.com/JuliaLang/Pkg.jl/issues/4152
Fix is merged! Will be released in Pluto 0.20.19
Awesome, thanks!