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

feat: add JULIA_PKG_DISABLE_AUTO_GC env var #3642

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/Pkg.jl
Expand Up @@ -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

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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

Expand Down