lmiq:
I’m bumping this to understand better how extensions are implemented: are they to be seen as “nested modules” within the main package?
All the packages that are dependencies of the main package are already part of the environment of the extension?
I think one is only supposed to load the targets for the extension. Other dependencies are to be loaded transitively, e.g. as using MainPkg.StaticArrays
, instead of using StaticArrays
. This avoids cycles in package loading.
opened 04:10AM - 05 Feb 23 UTC
closed 02:50PM - 16 Mar 23 UTC
domain:packages
Originally posted by me in https://github.com/JuliaLang/julia/issues/48513#issue… comment-1416774301. Now making this an issue, since I think this really will need to be release blocking, as seems like possibly a significant reliability issue and heisenbug that is creeping upon the ecosystem.
> Originally, I had that as the implementation and you went via Parent.Other to get dependencies. That however excluded the case where you wanted to load a package in an extension that was not a trigger nor was it loaded into Parent. This seemed to be a quite common desire so I allowed that. -Kristoffer
We observed recently that this should never have been allowed. It would be very useful, if it was valid. But it creates a cycle in the loading graph, which leads to unpredictable deadlocks, and causing the extension to sometimes hang (v1.9) or error (master today). It turns out that we must forbid this (for now), to prevent such unreliable behavior from catching users unawares and making PkgEval unreliable. We can re-evaluate later if we want to design a solution for it to reallow it later. Of note, it also must be forbidden (aka strongly discouraged) from loading those extra, unexpected packages via other mechanisms (e.g. during `__init__` or Requires.jl too) for the same reason that they will sometimes cause it to deadlock or error unpredictably.
JuliaStats:master
← JuliaStats:kc/extension_load_deps
opened 06:32PM - 05 Feb 23 UTC
Due to https://github.com/JuliaLang/julia/issues/48533, it might have to be nece… ssary to disable packages loading other dependencies other than their weak dependencies and the parent package. The rest of the packages have to be transitively loaded from the parent package. This does this fix for the packages loaded in the extensions.
cc @vtjnash
Although I’ve not kept up with the development, and this may not be necessary anymore.
1 Like