[R-pkg-devel] nit-picking about CRAN repository policy
Simon Urbanek
@|mon@urb@nek @end|ng |rom R-project@org
Mon May 9 00:13:11 CEST 2022
Ben,
I fully agree with Dirk - it would be good to make the CRP more clear.
The main problem with failing to the check conditional dependencies is in cases where there are circular dependencies: package A suggests B, and package B requires A. The correct resolution is to check A without B, then check B with A and then check A with B (that's what the macOS CRAN build system is doing). If A fails to check without B, the whole chain is doomed and none of the package will be available.
So at the very least the examples and tests should be clearly conditional. Currently, the vignettes also required since there is no specific check with --no-build-vignettes.
As for your package, the fact that it worked so far is due to the incremental nature of the builds: if your dependency is not circular then the build system will schedule dependencies for check before your package which is possible in that case, so the package is actually never checked without the suggests. In the macOS case we have no choice, because there are so many packages to build that checking every suggests-dependency twice would take too long. So from practical point of view, the suggests-must-be-conditional rule has been checked only for packages with circular dependencies since that is where it matters the most. However, the circular nature is not a function of the package itself, so it could make sense to make it global, since you don't know if the package you suggest may ever depend on your package and suddenly break your package that way. This is just my pragmatic view, I don't know any specific details on the noSuggests checks per se.
Cheers,
Simon
> On 8/05/2022, at 10:43 AM, Ben Bolker <bbolker using gmail.com> wrote:
>
>
> Folks,
>
> CRAN has recently set up an auxiliary 'noSuggests' test platform that tests that packages are using suggested packages conditionally, as recommended in Writing R Extensions, and as (sort of) specified in the CRAN repository policy.
>
> Specifically, the CRP (revision 5236) says:
>
> > A package listed in ‘Suggests’ or ‘Enhances’ should be used conditionally in examples or tests if it cannot straightforwardly be installed on the major R platforms. (‘Writing R Extensions’ recommends that they are always used conditionally.)
>
> One of my packages failed on the 'noSuggest' test platform <https://www.stats.ox.ac.uk/pub/bdr/noSuggests/bbmle.out> because two suggested packages were used unconditionally in the vignette. There are two reasons (IMO) that this should *not* have triggered a threat of archiving:
>
> (1) the unconditional package use was in a vignette, not in examples or tests
> (2) the relevant packages (AICcmodavg and MuMIn) are available on CRAN and install easily on Linux/Windows/MacOS (they are R-only, no compiled code or extra requirements, binaries are available on CRAN).
>
> Is it worth suggesting to CRAN maintainers that either they refine their 'noSuggests' test so that it conforms to the wording in the CRP, or that they change the CRP wording to something stricter like
>
> > Any package listed in ‘Suggests’ or ‘Enhances’ should be used conditionally in examples, tests, and vignettes.
>
> ?
>
> cheers
> Ben Bolker
>
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>
More information about the R-package-devel
mailing list