Pkg.gc
changes Base.loaded_modules
#56988
Labels
backport 1.11
Change should be backported to release-1.11
bug
Indicates an unexpected problem or unintended behavior
Issue
On Julia 1.11.2, I found an example where calling
Pkg.gc
before loading a package causes some packages to not show up inBase.loaded_modules
.Example
Here, I call
import Pluto
and I inspectvalues(Base.loaded_modules)
. If I didgc
beforeimport Pluto
, then 20 modules do not show up in the list...Normal – 68 modules
Details
With
Pkg.gc
before the import – 48 modulesDetails
The missing modules (e.g.
Dates
) are loaded and working:Explicitly calling
import Dates
adds it to the list:Environment
I created an empty env with
]add Pluto
.On Julia 1.10.7, I could not reproduce the issue.
Context
This is a reduced example from a weird bug I found today: Pluto mostly worked, but I was seeing a strange error where deserialization failed, because the Dates stdlib was not found in
Base.loaded_modules
:I eventually traced this bug back to the
Pkg.gc
that I did earlier today...The text was updated successfully, but these errors were encountered: