revdepcheck icon indicating copy to clipboard operation
revdepcheck copied to clipboard

When package version is NA in the database `revdep_summary` breaks

Open vspinu opened this issue 3 years ago • 1 comments

One of the lubridate's revdeps is GenEst and for that package the version is NA in the database. I presume there is a bug in retrieving that package's metadata somewhere.

Once NA is in the DB rcmdcheck chocks on that package:

Error in vapply(old, "[[", "version", FUN.VALUE = character(1)) : 
  values must be type 'character',
 but FUN(X[[1]]) result is type 'logical'
 
---------------------------------- 
> revdep_summary()
12: vapply(old, "[[", "version", FUN.VALUE = character(1)) at comparison.R!hgAhmm#38
11: rcmdcheck_comparison(old, new) at compare.R#20
10: compare_checks(old, new) at compare.R#8
9: try_compare_checks(package, oldcheck, newcheck) at db.R#373
8: FUN(X[[i]], ...)
7: lapply(.x, .f, ...) at compat-purrr.R#10
6: map(X, FUN, ...)
5: structure(map(X, FUN, ...), names = n) at utils.R#14
4: lapply_with_names(packages, function(package) {
       oldcheck <- checkFromJSON(res$old$result[match(package, res$old$package)])
       newcheck <- checkFromJSON(res$new$result[match(package, res$new$package)])
       try_compare_checks(package, oldcheck, newcheck)
   }) at db.R#370
3: db_results(pkg, NULL)
2: structure(db_results(pkg, NULL), class = "revdepcheck_results") at results.R#32
1: revdep_summary()

In the debuger at this line I get:

oldcheck <-
  structure(list(stdout = "* using log directory ‘/home/vspinu/Dropbox/dev/lubridate/revdep/checks/GenEst/old/GenEst.Rcheck’\n* using R Under development (unstable) (2022-10-19 r83129)\n* using platform: x86_64-pc-linux-gnu (64-bit)\n* using session charset: UTF-8\n* checking package directory ... ERROR\npackage directory ‘/home/vspinu/Dropbox/dev/lubridate/revdep/checks/GenEst/old/GenEst.Rcheck/00_pkg_src/GenEst’ does not exist\n* DONE\n\nStatus: 1 ERROR\nSee\n  ‘/home/vspinu/Dropbox/dev/lubridate/revdep/checks/GenEst/old/GenEst.Rcheck/00check.log’\nfor details.\n\n\n", 
    stderr = "", status = 1L, duration = 0.9834, timeout = FALSE, 
    rversion = list(), platform = "x86_64-pc-linux-gnu", errors = "checking package directory ... ERROR\npackage directory ‘/home/vspinu/Dropbox/dev/lubridate/revdep/checks/GenEst/old/GenEst.Rcheck/00_pkg_src/GenEst’ does not exist", 
    warnings = character(0), notes = character(0), description = "", 
    package = NA, version = NA, cran = FALSE, bioc = FALSE, checkdir = "/home/vspinu/Dropbox/dev/lubridate/revdep/checks/GenEst/old/GenEst.Rcheck", 
    test_fail = structure(list(), names = character(0)), test_output = structure(list(), names = character(0)), 
    install_out = "<00install.out file does not exist>"), class = "rcmdcheck")

newcheck <-
  structure(list(stdout = "* using log directory ‘/home/vspinu/Dropbox/dev/lubridate/revdep/checks/GenEst/new/GenEst.Rcheck’\n* using R Under development (unstable) (2022-10-19 r83129)\n* using platform: x86_64-pc-linux-gnu (64-bit)\n* using session charset: UTF-8\n* checking package directory ... ERROR\npackage directory ‘/home/vspinu/Dropbox/dev/lubridate/revdep/checks/GenEst/new/GenEst.Rcheck/00_pkg_src/GenEst’ does not exist\n* DONE\n\nStatus: 1 ERROR\nSee\n  ‘/home/vspinu/Dropbox/dev/lubridate/revdep/checks/GenEst/new/GenEst.Rcheck/00check.log’\nfor details.\n\n\n", 
    stderr = "", status = 1L, duration = 1.0972, timeout = FALSE, 
    rversion = list(), platform = "x86_64-pc-linux-gnu", errors = "checking package directory ... ERROR\npackage directory ‘/home/vspinu/Dropbox/dev/lubridate/revdep/checks/GenEst/new/GenEst.Rcheck/00_pkg_src/GenEst’ does not exist", 
    warnings = character(0), notes = character(0), description = "", 
    package = NA, version = NA, cran = FALSE, bioc = FALSE, checkdir = "/home/vspinu/Dropbox/dev/lubridate/revdep/checks/GenEst/new/GenEst.Rcheck", 
    test_fail = structure(list(), names = character(0)), test_output = structure(list(), names = character(0)), 
    install_out = "<00install.out file does not exist>"), class = "rcmdcheck")

try_compare_checks("GenEst", oldcheck, newcheck)


## Error in vapply(old, "[[", "version", FUN.VALUE = character(1)) : 
##   values must be type 'character',
##  but FUN(X[[1]]) result is type 'logical'
 
## ---------------------------------- 

## 4: vapply(old, "[[", "version", FUN.VALUE = character(1)) at comparison.R!hgAhmm#38
## 3: rcmdcheck_comparison(old, new) at compare.R#20
## 2: compare_checks(old, new) at compare.R#8
## 1: try_compare_checks("GenEst", oldcheck, newcheck)

This package fails to install and there is only ./revdep/checks/GenEst/new/GenEst.Rcheck/00check.log file with the following content:

* using log directory ‘/home/vspinu/Dropbox/dev/lubridate/revdep/checks/GenEst/new/GenEst.Rcheck’
* using R Under development (unstable) (2022-10-19 r83129)
* using platform: x86_64-pc-linux-gnu (64-bit)
* using session charset: UTF-8
* checking package directory ... ERROR
package directory ‘/home/vspinu/Dropbox/dev/lubridate/revdep/checks/GenEst/new/GenEst.Rcheck/00_pkg_src/GenEst’ does not exist
* DONE
Status: 1 ERROR

vspinu avatar Oct 27 '22 10:10 vspinu

Would be great to have an internal function to quickly delete problematic entries from the DB. Something like:

db_delete <- function(pkgdir, package) {
  db <- db(pkgdir)
  dbExecute(db,
    sqlInterpolate(db,
      "DELETE FROM revdeps WHERE package = ?package",
      package = package
    )
  )
}

vspinu avatar Oct 27 '22 10:10 vspinu