r-universe-org / help

Support and bug tracker for R-universe
https://docs.r-universe.dev/
9 stars 2 forks source link

fail on install deps should prevent entering r cmd check #403

Closed pawelru closed 4 months ago

pawelru commented 4 months ago

Example: https://github.com/r-universe/pharmaverse/actions/runs/8878640984/job/24375069874

R CMD CHECK fails with a following error

* checking examples ... ERROR
Running examples in 'tern-Ex.R' failed
The error most likely occurred in:
(...)
Error in loadNamespace(x) : there is no package called 'stringi'
Calls: %>% ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted

The root-cause however is in the step earlier "Install package dependencies":

  * installing *source* package 'stringi' ...
  ** package 'stringi' successfully unpacked and MD5 sums checked
  ** using staged installation
(...)
  ** testing if installed package can be loaded from temporary location
  Error: package or namespace load failed for 'stringi' in library.dynam(lib, package, package.lib):
   DLL 'stringi' not found: maybe not installed for this architecture?
  Error: loading failed
  Execution halted
  ERROR: loading failed
  * removing 'C:/R/library/stringi'

Let's not focus here on why install failed. My take away from this is that R CMD CHECK should not be started if the install deps step failed. It cannot be successfully completed if any of the hard deps is missing and this somewhat gives inaccurate message to the pkg maintainers. I immediately went checking deps specification and after confirming it's correct I have found out that the issue is elsewhere.

jeroen commented 4 months ago

That is impossible because there are many unimportant packages on CRAN that will fail to install, or sometimes randomly. But usually the check for the package will still work.

So the best we can do is show you the error.

pawelru commented 4 months ago

I think it's all depends on the dependency type. For hard deps (Depends, Imports, LinkingTo) I cannot imagine r-cmd-check to pass. For soft deps (Suggests, Enhances) things might pass actually. All in all it comes down to the way how you install those deps. I noticed that you choose remotes package. Recently I found myself more and more like the way how pak (actually pkgdepends) does it with caching, config possibilities and all of that. I do get this potentially could be a fundamental change to the logic so for the time being I'm looking for exposing error info more.

jeroen commented 4 months ago

Yes we will switch to pak when the problems are resolved: https://github.com/r-universe-org/help/issues/393