Pkg.jl: Pkg.gc broken?

Created on 22 Oct 2019  路  5Comments  路  Source: JuliaLang/Pkg.jl

It doesn't seem to delete packages on 1.3?

1.3:

(v1.3) pkg> gc
    Active manifests:
        `~/JuliaPkgs/PackageCompilerX.jl/Manifest.toml`
....
    Active artifacts:
        `~/.julia/packages/BinaryBuilder/r6jgA/MutableArtifacts.toml`
....
   Deleted no artifacts or packages

1.2 (now it deletes things):

(v1.2) pkg> gc
    Active manifests:
        `~/JuliaPkgs/PackageCompilerX.jl/Manifest.toml`
 ...
   Deleted `~/.julia/packages/BinaryBuilder/1UGiF` (41.782 MiB)
...
   Deleted `~/.julia/packages/Tracker/SAr25` (56.356 KiB)
   Deleted 26 package installations (5.503 GiB)
bug

Most helpful comment

Note that you can do:

using Pkg, Dates
Pkg.gc(;collect_delay=Week(1))

To set the "collect delay" to one week right now. If you want the old "collect immediately" behavior, you can set the time interval to zero in whatever units you like:

using Pkg, Dates
Pkg.gc(;collect_delay=Hour(0))

All 5 comments

Apparently, this is intended.

To explain, in case anyone else encounters this: Pkg.gc now marks unreachable stuff as "to be deleted" and then deletes it after a month if it has been deletable for that time.

Just ran into this, trying to free disk space. :-)

Would you consider giving gc an option to control this, similar to git gc --prune=now?

Yes, we should have that option for sure. And probably make the delay both configurable and shorter (e.g. a week).

Note that you can do:

using Pkg, Dates
Pkg.gc(;collect_delay=Week(1))

To set the "collect delay" to one week right now. If you want the old "collect immediately" behavior, you can set the time interval to zero in whatever units you like:

using Pkg, Dates
Pkg.gc(;collect_delay=Hour(0))
Was this page helpful?
0 / 5 - 0 ratings

Related issues

GordStephen picture GordStephen  路  3Comments

cossio picture cossio  路  3Comments

timholy picture timholy  路  4Comments

jlperla picture jlperla  路  3Comments

innerlee picture innerlee  路  4Comments