What's in your @?

pkg> st
ERROR: no active project

because I disable this feature in my startup.jl:

# Remove global environment from load path
let
    i = findfirst(==("@v#.#"), LOAD_PATH)
    if !isnothing(i)
        deleteat!(LOAD_PATH, i)
    end
end

Too many times I have added packages in the global environment by mistake, and then I forgot to add them in the local environment (because it was working!), resulting in non-reproducible projects and possibly corrupted state where incompatible packages where used together. Because as the documentation says:

Packages in non-primary environments can end up using incompatible versions of their dependencies even if their own environments are entirely compatible. This can happen when one of their dependencies is shadowed by a version in an earlier environment in the stack (either by graph or path, or both).

I’ve ranted about this before (a bit too vehemently) here. The gist of it is that I don’t understand why Julia would use incompatible package versions by default, instead of showing an error and maybe having an opt-in setting to allow it (suggested name: yolo=yes).

4 Likes