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

Pkg env folder can get deleted during session #2641

Open
BioTurboNick opened this issue Sep 11, 2023 · 3 comments
Open

Pkg env folder can get deleted during session #2641

BioTurboNick opened this issue Sep 11, 2023 · 3 comments
Labels
bug Something isn't working good first issue Good for newcomers package manager Pluto's built-in package manager

Comments

@BioTurboNick
Copy link
Contributor

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.

@fonsp fonsp changed the title Feature: Detect if temporary folder has been deleted and require notebook restart Pkg env folder can get deleted during session Sep 12, 2023
@fonsp fonsp added bug Something isn't working package manager Pluto's built-in package manager labels Sep 12, 2023
@BioTurboNick
Copy link
Contributor Author

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?

@fonsp
Copy link
Owner

fonsp commented Oct 25, 2024

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.

@fonsp
Copy link
Owner

fonsp commented Oct 25, 2024

This is where we create the directory:

env_dir = mktempdir()

@fonsp fonsp added the good first issue Good for newcomers label Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers package manager Pluto's built-in package manager
Projects
None yet
Development

No branches or pull requests

2 participants