github actions failing on Windows

My GitHub actions have suddenly started to selectively fail on Windows:

image

Seems to be due to failure to download stringi:

Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
ERROR: lazy loading failed for package 'knitr'
  there is no package called 'stringi'
##[error]Error: unable to load R code in package 'knitr'
* removing 'd:/a/_temp/Library/knitr'
Execution halted
Error in i.p(...) : 
  (converted from warning) installation of package 'knitr' had non-zero exit status
Calls: <Anonymous> ... with_rprofile_user -> with_envvar -> force -> force -> i.p
Execution halted
##[error]Process completed with exit code 1.

Any ideas on how I can avoid such failures?

Thanks.

1 Like

From looking over the log it looks like the installation order is backwards (i.e. knitr is attempted to be installed before stringi) thus the failure to install knitr.

I think this issue may be helpful, in particular this suggestion. Perhaps there isn't a Windows binary available yet for stringi? You can try to force the type of package installation to be binary or source ONLY. This sounds like it could solve the installation order issue. Then if knitr installs, you should be able to build vignettes during the checks and the failure is solved. Or you could just add another step before installing other packages, forcing stringi to get installed first.

The last hacky solution to at least bypass the R CMD check error would be to add --no-build-vignettes to the rcmdcheck::rcmdcheck(args = ...) function. But this doesn't solve the root issue, which the above suggestion might.

2 Likes

Thanks! The GitHub issue you mentioned is exactly the same issue I am facing. So I will close this question here and follow the GitHub thread instead.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.