deal with errors at build stage when attempting to check

safe_rcmdcheck(x, error = "never", ...)

Arguments

x

character(1) path to source package folder for a package (not a tarball)

error

character() passed to rcmdcheck::rcmdcheck

...

passed to rcmdcheck::rcmdcheck, should not include 'error'

Value

a list, see note.

Note

If rcmdcheck succeeds without returning try-error, this function returns the result of rcmdcheck. Otherwise it build a list with elements 'package', 'errors', 'warnings', 'notes', 'install_out', 'description' and 'version', in which the 'errors' component includes data from capture.output on rcmdcheck attempt.

Examples

chk = safe_rcmdcheck(system.file("demo_srcs/parody", package="BiocQE"))
str(chk)
#> List of 21
#>  $ stdout      : chr "* using log directory ‘/private/var/folders/n4/p9th81md60s8nv12yv40sv8m0000gp/T/RtmpvJ2ckE/file168b6029d550/par"| __truncated__
#>  $ stderr      : chr ""
#>  $ status      : int 0
#>  $ duration    : num 12.3
#>  $ timeout     : logi FALSE
#>  $ rversion    : chr(0) 
#>  $ platform    : chr "aarch64-apple-darwin20.6.0"
#>  $ errors      : chr(0) 
#>  $ warnings    : chr(0) 
#>  $ notes       : chr(0) 
#>  $ description : chr "Package: parody\nTitle: Parametric And Resistant Outlier DYtection\nVersion: 1.49.10\nAuthors@R: \n    person(g"| __truncated__
#>  $ package     : chr "parody"
#>  $ version     : chr "1.49.10"
#>  $ cran        : logi FALSE
#>  $ bioc        : logi TRUE
#>  $ checkdir    : chr "/private/var/folders/n4/p9th81md60s8nv12yv40sv8m0000gp/T/RtmpvJ2ckE/file168b6029d550/parody.Rcheck"
#>  $ test_fail   : Named list()
#>  $ test_output :List of 1
#>   ..$ test: chr "> library(parody)\nLoading required package: tools\n> library(testthat)\n> \n> test_check(\"parody\")\n[ FAIL 0"| __truncated__
#>  $ install_out : chr "* installing *source* package ‘parody’ ...\n** using staged installation\n** R\n** data\n** inst\n** byte-compi"| __truncated__
#>  $ session_info:List of 2
#>   ..$ platform:List of 10
#>   .. ..$ version : chr "R Under development (unstable) (2021-11-10 r81171)"
#>   .. ..$ os      : chr "macOS Monterey 12.1"
#>   .. ..$ system  : chr "aarch64, darwin20.6.0"
#>   .. ..$ ui      : chr "X11"
#>   .. ..$ language: chr "en"
#>   .. ..$ collate : chr "C"
#>   .. ..$ ctype   : chr "en_US.UTF-8"
#>   .. ..$ tz      : chr "America/New_York"
#>   .. ..$ date    : chr "2021-12-29"
#>   .. ..$ pandoc  : chr "2.13 @ /usr/local/bin/pandoc"
#>   .. ..- attr(*, "class")= chr [1:2] "platform_info" "list"
#>   ..$ packages:Classes ‘packages_info’ and 'data.frame':	1 obs. of  11 variables:
#>   .. ..$ package      : chr "parody"
#>   .. ..$ ondiskversion: chr "1.49.10"
#>   .. ..$ loadedversion: chr NA
#>   .. ..$ path         : chr "/private/var/folders/n4/p9th81md60s8nv12yv40sv8m0000gp/T/RtmpvJ2ckE/file168b6029d550/parody.Rcheck/parody"
#>   .. ..$ loadedpath   : chr NA
#>   .. ..$ attached     : logi FALSE
#>   .. ..$ is_base      : logi FALSE
#>   .. ..$ date         : chr "2021-12-29"
#>   .. ..$ source       : chr "Bioconductor"
#>   .. ..$ md5ok        : logi NA
#>   .. ..$ library      : Factor w/ 3 levels "/private/var/folders/n4/p9th81md60s8nv12yv40sv8m0000gp/T/RtmpvJ2ckE/file168b6029d550/parody.Rcheck",..: 1
#>   ..- attr(*, "class")= chr [1:2] "session_info" "list"
#>  $ cleaner     :<environment: 0x11a85a058> 
#>  - attr(*, "class")= chr "rcmdcheck"