Skip to content

install.packages("C", dep=TRUE) does not always install indirect dependencies

5 messages · Duncan Murdoch, Seth Falcon, Hervé Pagès

#
Hello again,

I've found another issue with 'install.packages'.
'install.packages("C", dep=TRUE)' will "fail" when the 2 following
conditions are satisfied:
  - Package C depends on B which in turns depends on A but
    the Depends field in C doesn't list A.
  - Package B is already installed but not package A (e.g.
    the user did 'install.packages("B", dep=FALSE)').
Then 'install.packages("C", dep=TRUE)' will not install A.
May be this is the desired behavior, I don't know. Personally, I would
think of 'install.packages("C", dep=TRUE)' as a reliable way to get every
packages that C directly or indirectly relies on installed.

Best,

H.
#
On 6/8/2006 3:31 PM, Herve Pages wrote:
This seems rather unreasonable.  If a user asked not to install B's 
dependencies, and A is not listed as a dependency of C, then I don't 
think a request to install C and its dependencies should install A.

Perhaps the installation of B without dependencies was a mistake?  I 
think an argument could be made that dependencies=TRUE should be the 
default (as it is when using the corresponding menu item in the Windows 
GUI).

Duncan Murdoch
#
Duncan Murdoch <murdoch at stats.uwo.ca> writes:
I see your point, but the unreasonable-ness kinda works both ways: If
a user asked to install C and _all_ its dependencies, then I think
that request should do that :-)
Installing dependencies seems like a reasonable default to me.  Having
the flexibility to not install dependencies is nice, but I imagine for
a majority of users they install a package in order to use it, and
mostly you can't use a package unless you have its dependencies
installed.

+ seth
#
Duncan Murdoch wrote:
Hi Duncan,

Maybe the user didn't _ask_ not to install B's deps. Maybe he simply 
made a mistake
(which is easy with 'dep=FALSE' being the default), or maybe this is a 
shared system and
someone else installed B without 'dep=TRUE' or removed A or...
But I realize that there would be a significant extra cost if 
'install.packages("C", dep=TRUE)'
had to check the whole deps tree instead of just checking whether only 
the packages listed
in C's Depends field are already installed (especially when those 
packages _are_ already
installed).
So if checking the whole deps tree can't be done everytime 
'install.packages(..., dep=TRUE)'
is used then may be it could be done on demand e.g. with something 
similar to what
"rpm -Va --nofiles" does on a Linux system (this checks the entire 
system for missing deps).
Yes having 'dependencies=TRUE' as the default would definetly help the
user to keep a system where all deps are satisfied.

Best,

H.
#
On 6/9/2006 1:47 PM, Herve Pages wrote:
Right, those are all possibilities.  But they can all be repaired by 
manually installing A, can't they?  Does the error message make clear 
that the problem is a lack of A?
I don't know the logic behind the "dependencies=FALSE" default, and I'm 
reluctant to change defaults on platforms I don't use.  Since this is 
really only an inconvenience, I think you'll have to find an R Core 
member who actually uses your platform to deal with it.

Duncan Murdoch