Pkg.jl: Splitting the default environment in two

It’s useful to have an environment that’s inherited, for things like Revise.jl and OhMyREPL.jl. It’s also useful to have an environment that’s activated by default when running julia, for quick interactive sessions.

Currently those are both the same environment: the @v1.10 shared environment is (1) activated by default AND (2) inherited in project-local environments. I suspect this sharing is not ideal, because the convenience of the default environment tempts users to install lots of things into it, which then show up as accessible in their project sessions.

Personally I have two environments: @v1.10 for Revise.jl and OhMyREPL.jl, and @main for quick interactive sessions with heavier dependencies like Makie.jl.

I wonder if this would be a good default behavior: separate the inherited environment v1.10-inherited from the default environment v1.10-standalone, where julia automatically activates v1.10-standalone. It’s a little more complicated, but it seems less likely to cause problems.

You could set the JULIA_PROJECT environment variable in your .bashrc or equivalent to achieve this effect.

$ export JULIA_PROJECT="@main"

$ julia -E "Base.active_project()"
"/home/mkitti/.julia/environments/main/Project.toml"

$ julia -E "Base.load_path()"
["/home/mkitti/.julia/environments/main/Project.toml", "/home/mkitti/.julia/environments/v1.10/Project.toml", "/home/mkitti/.julia/juliaup/julia-1.10.0+0.x64.linux.gnu/share/julia/stdlib/v1.10"]

$ julia --project=temp -E "Base.load_path()"
["/home/mkitti/temp/Project.toml", "/home/mkitti/.julia/environments/v1.10/Project.toml", "/home/mkitti/.julia/juliaup/julia-1.10.0+0.x64.linux.gnu/share/julia/stdlib/v1.10"]