[Rd] optional package dependency (enhances)

Allen S. Rout asr at ufl.edu
Wed Jan 20 20:11:50 CET 2010


Ross Boylan <ross at biostat.ucsf.edu> writes:

> On Fri, 2010-01-15 at 10:48 +0000, Benilton Carvalho wrote:
>> How about using:
>> 
>> Enhances: Rmpi


This unique local bestiary of dependencies is quite inconvenient for
anyone trying to connect R with any other system of package
management.  Below, I've included the rather byzantine scheme I've
suggested in another forum for connecting R packages with RPM
packages.  It made my head hurt to write it.


I think that this spectrum of dependencies substantially complicates
the work of anyone who wants to make R easily accessible to
non-systems-administrator users.  I think the R community wants this
accessibility work to be easy, not hard.

IMO, there is a fairly small set of changes in R package ideology
which could make a big improvement:

1) Everything necessary to load a library should be Required. (I
   naively think this means Imports should also be Required, but I may
   be misunderstanding some nuance of Imports)

2) Everything necessary to complete a CHECK should be Required. 


That's it.  In this way you now have only two classes of requirements:

- 'Requires', which has essentially the same meaning as it does in
   other dependency graph worlds.

- Other stuff which R authors care about, but the systems
  administrator need not understand.



----

+ The R community is much less sysadmin-y than other
  language communities.  Several positions about correctness which
  lots of admins take as Truth (i.e. dependency cycle == BAD) they
  find to be more of an aesthetic call.  This is reasonable.

+ Different repositories in the R community have independant lives and
  attitudes.  There is modest competition and grumbling between
  maintainers associated with different repos. 

+ Package dependencies cross repo boundaries; sticking with the
  'Better' repositories just won't work, and discussion of these
  variations tends to make R folks testy.

 conclusion: The goal of evolving the R packages into a DAG is a
 non-starter.

+ There are four classes of dependency in R-package land: Requires,
  Imports, Suggests, and Enhances.

+ Requires and Imports are required to load the package. [1]

+ Suggests may be required to fully CMD CHECK the package [1]

+ The need for suggests at CMD CHECK can be deactivated by build
  config file. [2]

+ Many of the dependency cycles can be avoided if we ignore Suggests
  as an RPM dependency. 

Now, on to opinion: 

+ We would like all official packages to have passed a full R CMD CHECK 

+ We would like an absolute minimum of manual special case handling.
  It may not be possible to make that amount zero. 

So: Here's my suggested procedure for building any single package,
gangked from a message I sent to R-core:

1) Express binary package dependencies according to Depends and Imports.
   I'll call this the 'narrow dependency graph'. 

2) As part of the binary package build process, run CHECK
   with R_CHECK_FORCE_SUGGESTS = false. 

I'll pull nomenclature out of my ear and call these "built" but not
"checked".

3) Build all binary packages which are downstream according to all of
   Depends, Imports, Suggests, and Extends.  I'll call this the 'broad
   dependency graph'.

4) Install all the packages in the broad dependency graph.

5) for each package in the broad graph, run CHECK with
   R_CHECK_FORCE_SUGGESTS=true.

Then the affected packages are "checked".  Perhaps this can be noted
with a signature.

.... Whew!


----


- Allen S. Rout



More information about the R-devel mailing list