Replies: 2 comments 2 replies
-
@hturner I may have done something wrong, its unclear to me why this isn't showing up in Proposals, and how I'd put it there? |
Beta Was this translation helpful? Give feedback.
-
Nice idea! I have encountered this problem several times (when developing a shiny app and having packages installed by the shiny user and others by the system or a user. Sometimes people add their libraries and depending on the order they cause problems). How would this proposal handle arguments If this doesn't go ahead, perhaps a function could be implemented to check these situations in the .libPaths (in a package if not in base?). |
Beta Was this translation helpful? Give feedback.
-
Summary
library
currently takes the name of a single package (either in the form of a character vector of length one, or via NSE). I proposelibrary
accept a vector of packages and load them all (plus their dependnecies) in the order that they appear.Background.
R
supports versioned dependencies, which nearly always come in the form ofpkg (>= vers)
.R
also supports vectors of library paths. And, in particular, R supports different versions of the same package appearing at different points in its set of libpaths, at least in principle.In practice these two capabilities combine to form some sharp-edged corner cases where valid, installed packages can be unloadable.
Reason
Consider the following dependency structure between packages
pkgA
:pkgB (>= 0.5.0)
pkgC
:pkgB (>= 0.6.0)
Consider the following multi-libpath setup:
~/pth1/
:pkgA
,pkg B [0.5.1]
~/pth2/
:pkg C
,pkg B [0.6.5]
And consider that we have the libpath
c("~/pth1/", "~pth2")
.If we do
Things will work great.
Same if we do
BUT, if we do
pkgC
will not be able to be loaded, because an insufficient version ofpkgB
will already be loaded.Proposal:
Support
Which would result in the following search path:
pkgA
,pkgB [0.6.5]
,pkgC
.Conceptual Feasibility
A first pass at this could be simply resolving the recursive dependencies as is currently done, and then combining those for a unification pass at the end. Some care will be needed to get the order right, but I'm confident it's doable.
Technical Approach
TBD
Beta Was this translation helpful? Give feedback.
All reactions