diff --git a/src/Pluto.jl b/src/Pluto.jl index 77b576f214..36cdbe7323 100644 --- a/src/Pluto.jl +++ b/src/Pluto.jl @@ -98,7 +98,12 @@ export activate_notebook_environment include("./precompile.jl") +const pluto_boot_environment_path = Ref{String}() + function __init__() + pluto_boot_environment_name = "pluto-boot-environment-$(VERSION)-$(PLUTO_VERSION)" + pluto_boot_environment_path[] = Scratch.@get_scratch!(pluto_boot_environment_name) + # Print a welcome banner if (get(ENV, "JULIA_PLUTO_SHOW_BANNER", "1") != "0" && get(ENV, "CI", "🍄") != "true" && isinteractive()) diff --git a/src/evaluation/WorkspaceManager.jl b/src/evaluation/WorkspaceManager.jl index e670d841d3..75f3e87658 100644 --- a/src/evaluation/WorkspaceManager.jl +++ b/src/evaluation/WorkspaceManager.jl @@ -34,6 +34,7 @@ const SN = Tuple{ServerSession, Notebook} "These expressions get evaluated whenever a new `Workspace` process is created." process_preamble() = quote Base.exit_on_sigint(false) + pluto_boot_environment_path = $(Pluto.pluto_boot_environment_path[]) include($(project_relative_path(joinpath("src", "runner"), "Loader.jl"))) ENV["GKSwstype"] = "nul" ENV["JULIA_REVISE_WORKER_ONLY"] = "1" diff --git a/src/runner/Loader.jl b/src/runner/Loader.jl index 98c0176782..6af926ce3c 100644 --- a/src/runner/Loader.jl +++ b/src/runner/Loader.jl @@ -13,8 +13,11 @@ begin local original_LP = LOAD_PATH local original_AP = Base.ACTIVE_PROJECT[] + # Path to our notebook boot package environment + local runner_env_dir = pluto_boot_environment_path + local new_LP = ["@", "@stdlib"] - local new_AP = mktempdir() + local new_AP = runner_env_dir try # Activate the environment @@ -58,6 +61,5 @@ begin # Reset the pkg environment copy!(LOAD_PATH, original_LP) Base.ACTIVE_PROJECT[] = original_AP - rm(new_AP; recursive=true) end end diff --git a/src/runner/PlutoRunner/Project.toml b/src/runner/PlutoRunner/Project.toml index c60f36d47d..191b55efc1 100644 --- a/src/runner/PlutoRunner/Project.toml +++ b/src/runner/PlutoRunner/Project.toml @@ -1,7 +1,7 @@ name = "PlutoRunner" uuid = "dc6b355a-2368-4481-ae6d-ae0351418d79" -authors = ["Michiel Dral "] -version = "0.1.0" +authors = ["Michiel Dral ", "Fons van der Plas ", "Paul Berg "] +version = "29.12.98" [deps] Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"