[Rd] possible bug in win R-devel in check/test environment

Dirk Eddelbuettel edd @end|ng |rom deb|@n@org
Tue Jan 14 15:59:00 CET 2020


Hi Serguei,

Nice analysis!

On 14 January 2020 at 11:00, Serguei Sokol wrote:
| During my recent r2sundials development, I've came across a strange test 
| failing during 'R CMD check' exclusively on win R-devel which I could 
| reproduce with a minimal example that I present here.
| The toy packages testarma1 [1] and testarma2 [2] are minimal 
| modifications of a skeleton package produced by 
| RcppArmadillo.package.skeleton().
| They are almost identical. The first one fails to passe its tests on win 
| R-devel [3] while the second one is OK [4]. The reason of test failing 
| in testarma1 boils down to not finding a package during tests (here 
| RcppArmadillo) although it is well present in LinkingTo field of the 
| DESCRIPTION file (the mechanism of the error is detailed in [5]). To 
| make the tests pass, I had to add RcppArmadillo and r2sundials to 
| 'Suggests:' field too (as can be seen in testarma2)
| 
| In my understanding, the presence of a package name in the LinkingTo 
| field should be sufficient for finding it during the test phase.

I thought so too. But thinking about it a little more it clears up a little.

A bit more context: One can be more fine-grained on Depends. And Debian does
that, and R sometimes followed Debian's model of declaring dependencies. One
element we are missing here is to distinguish between _build-time_ needs (we
call that Build-Depends: in Debian) and _run_time_ needs.  We currently only
have the latter as Depends:, which for example pains a million dplyr users on
Windows who have to download 120mb worth of our BH package because it is used
to _build_ the binary zipfile, but not thereafter.  That is a wart.

Now, _LinkingTo_ always implies build-dependecies or else it would croak at
that stage.

And I had assumed that this would cover all run-time but ...

| Instead, one have to add it to 'Suggests:' field too.

... tests are indeed treated differently and this may just be a different
code path.

If you have something in Suggests: and test for it, you should condition the
test. I have argued that part a few times but mostly to no avail so I too now
mostly give up and _unconditionally_ install Suggests to support tests when I
run bulk tests for reverse dependencies.  But it is still wrong.

So here the ball is in your court. Your tests for r2sundials should probably
condition on RcppArmadillo being present and skip tests requiring it if it is
not present.  Or, if you don't like that, make it an Imports: too.

Hope this helps.

Cheers, Dirk

| Am I wrong or this behavior is unexpected?
| 
| Best,
| Serguei.
| 
| [1] https://github.com/sgsokol/testarma1 
| <https://github.com/sgsokol/testarma2>
| [2] https://github.com/sgsokol/testarma2
| [3] https://win-builder.r-project.org/v0nBoFleT48y/00check.log
| [4] https://win-builder.r-project.org/TMKbnEBncFNc/00check.log
| [5] https://github.com/RcppCore/Rcpp/issues/1026
| 
| <https://github.com/sgsokol/testarma2>
| 
| ______________________________________________
| R-devel using r-project.org mailing list
| https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org



More information about the R-devel mailing list