diff --git a/src/Pkg.jl b/src/Pkg.jl index e02c6e7e86..68be5ba8bd 100644 --- a/src/Pkg.jl +++ b/src/Pkg.jl @@ -311,6 +311,9 @@ finding artifacts and packages that are thereafter not used by any other project marking them as "orphaned". This method will only remove orphaned objects (package versions, artifacts, and scratch spaces) that have been continually un-used for a period of `collect_delay`; which defaults to seven days. + +To disable automatic garbage collection, you can set the environment variable +`JULIA_PKG_DISABLE_AUTO_GC` to `"true"` before starting Julia. """ const gc = API.gc @@ -589,8 +592,8 @@ In offline mode Pkg tries to do as much as possible without connecting to internet. For example, when adding a package Pkg only considers versions that are already downloaded in version resolution. -To work in offline mode across Julia sessions you can -set the environment variable `JULIA_PKG_OFFLINE` to `"true"`. +To work in offline mode across Julia sessions you can set the environment +variable `JULIA_PKG_OFFLINE` to `"true"` before starting Julia. """ offline(b::Bool=true) = (OFFLINE_MODE[] = b; nothing) @@ -745,6 +748,7 @@ function __init__() push!(empty!(REPL.install_packages_hooks), REPLMode.try_prompt_pkg_add) Base.PKG_PRECOMPILE_HOOK[] = precompile # allows Base to use Pkg.precompile during loading OFFLINE_MODE[] = Base.get_bool_env("JULIA_PKG_OFFLINE", false) + _auto_gc_enabled[] = !Base.get_bool_env("JULIA_PKG_DISABLE_AUTO_GC", false) return nothing end