From murdoch@dunc@n @end|ng |rom gm@||@com  Wed May  5 11:42:54 2021
From: murdoch@dunc@n @end|ng |rom gm@||@com (Duncan Murdoch)
Date: Wed, 5 May 2021 05:42:54 -0400
Subject: [Rd] Testing R build when using --without-recommended-packages?
In-Reply-To: <24722.24990.41734.536374@stat.math.ethz.ch>
References: <CAFDcVCS8_8c0g8CXAmHd96XH49YYUX7jt8J9Bj3guWkX8X=Knw@mail.gmail.com>
 <24721.33130.749929.947885@rob.eddelbuettel.com>
 <CAFDcVCTQ4mNK35NGaZEsiTDynuoxVk1VUCRGpgaGjMh3v++ESA@mail.gmail.com>
 <24721.36776.942664.909986@rob.eddelbuettel.com>
 <CAFDcVCTkwZtY5jVHuorT15Yc35aGMJLsyeo3p3AmeUG3oUmsHA@mail.gmail.com>
 <24721.40673.20828.844418@rob.eddelbuettel.com>
 <CAFDcVCS2SgCkVPULH4ovMPX8cgegNuQkY1cA-fW6jpPRHDNeBw@mail.gmail.com>
 <CAD4oTHG3U=tDeX2fEsnf0QPksTZYuJ7GDey45nNBE3DnCDb86w@mail.gmail.com>
 <280c17af-1eda-84a8-42a0-e6f4990f9f3e@gmail.com>
 <CAD4oTHEVst9d3JXMnHkkziDZi_H83Ojv629M73UnHrZMCa1rNQ@mail.gmail.com>
 <24722.24990.41734.536374@stat.math.ethz.ch>
Message-ID: <421b7333-2ca8-1984-f21e-3b665cf98a3a@gmail.com>

On 05/05/2021 5:13 a.m., Martin Maechler wrote:
>>>>>> Gabriel Becker
>>>>>>      on Tue, 4 May 2021 14:40:22 -0700 writes:
> 
>      > Hmm, that's fair enough Ben, I stand corrected.  I will say that this seems
>      > to be a pretty "soft" recommendation, as these things go, given that it
>      > isn't tested for by R CMD check, including with the -as-cran extensions. In
>      > principle, it seems like it could be, similar checks are made in package
>      > code for inappropriate external-package-symbol usage/
> 
>      > Either way, though, I suppose I have a number of packages which have been
>      > invisibly non-best-practices compliant for their entire lifetimes (or at
>      > least, the portion of that where they had tests/vignettes...).
> 
>      > Best,
>      > ~G
> 
>      > On Tue, May 4, 2021 at 2:22 PM Ben Bolker <bbolker at gmail.com> wrote:
> 
>      >> Sorry if this has been pointed out already, but some relevant text
>      >> from
>      >>
>      >> https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Suggested-packages
>      >>
>      >> > Note that someone wanting to run the examples/tests/vignettes may not
>      >> have a suggested package available (and it may not even be possible to
>      >> install it for that platform). The recommendation used to be to make
>      >> their use conditional via if(require("pkgname")): this is OK if that
>      >> conditioning is done in examples/tests/vignettes, although using
>      >> if(requireNamespace("pkgname")) is preferred, if possible.
>      >>
>      >> ...
>      >>
>      >> > Some people have assumed that a ?recommended? package in ?Suggests?
>      >> can safely be used unconditionally, but this is not so. (R can be
>      >> installed without recommended packages, and which packages are
>      >> ?recommended? may change.)
> 
> 
> Thank you all (Henrik, Gabe, Dirk & Ben) !
> 
> I think it would be a good community effort  and worth the time
> also of R core to further move into the right direction
> as Dirk suggested.
> 
> I think we all agree it would be nice if Henrik (and anybody)
> could use  'make check' on R's own sources after using
>   --without-recommended-packages
> 
> Even one more piece of evidence is the   tests/README   file in
> the R sources.  It has much more but simply starts with
> 
> ---------------------------------------------------------------------------
> There is a hierarchy of check targets:
> 
>       make check
> 
> for all builders.  If this works one can be reasonably happy R is working
> and do `make install' (or the equivalent).
> 
>      make check-devel
> 
> for people changing the code: this runs things like the demos and
> no-segfault which might be broken by code changes, and checks on the
> documentation (effectively R CMD check on each of the base packages).
> This needs recommended packages installed.
> 
>      make check-all
> 
> runs all the checks, those in check-devel plus tests of the recommended
> packages.
> 
> Note that for complete testing you will need a number of other
> ......................
> ......................
> 
> ---------------------------------------------------------------------------
> 
> So, our (R core) own intent has been that   'make check'  should
> run w/o rec.packages  but further checking not.
> 
> So, yes, please, you are encouraged to send patches against the
> R devel trunk  to fix such examples and tests.

I think it would be useful to issue some kind of warning if tests are 
skipped.  As mentioned earlier, this is impossible in user-contributed 
packages, which can only return OK or ERROR from their tests.

Duncan Murdoch



[Rd] Testing R build when using --without-recommended-packages?
Duncan Murdoch