r-lib / revdepcheck

R package reverse dependency checking
https://revdepcheck.r-lib.org
Other
101 stars 32 forks source link

revdep_reset fails to reset #215

Closed ms609 closed 2 years ago

ms609 commented 5 years ago

Running the latest version (revdepcheck 1.0.0.9001) on Windows 10 and R3.6.0, I find that revdep_reset is not fully operational.

revdep_check had completed, but had failed to check one package. I fixed the issue that prevented that package from checking, then ran revdep_reset.

revdepcheck::revdep_check returns

* See results of previous run in 'revdep/README.md'
* Reset for another run with `revdepcheck::revdep_reset()`

After running revdepcheck::revdep_reset(path/to/package), this message still persists on revdep_check. The package's revdep folder contains data.sqlite and the three 'md' files (README, failures, problems), but the checks directory has been deleted.
I cannot manually delete data.sqlite, because Windows recognizes it as being 'in use' by the R session. If I close R, then manually delete the revdep directory, then revdep_check works as expected.

Possibly related: If I interrupt revdep_check (with Esc keypress) then it exits with

Warning message:
call dbDisconnect() when finished working with a connection 

It resumes on revdep_check(), and revdep_reset does not throw an error.

ms609 commented 5 years ago

sessionInfo() reports:

R version 3.6.0 (2019-04-26)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.1             highr_0.8              compiler_3.6.0         pillar_1.4.1          
 [5] remotes_2.0.4          prettyunits_1.0.2      base64enc_0.1-3        tools_3.6.0           
 [9] progress_1.2.2         testthat_2.1.1         pkgload_1.0.2          pkgbuild_1.0.3        
[13] digest_0.6.19          bit_1.1-14             jsonlite_1.6           RSQLite_2.1.1         
[17] memoise_1.1.0          tibble_2.1.2           debugme_1.1.0          pkgconfig_2.0.2       
[21] rlang_0.3.4            whoami_1.3.0           DBI_1.0.0              cli_1.1.0             
[25] yaml_2.2.0             curl_3.3               xopen_1.0.0            xfun_0.7              
[29] withr_2.1.2            gmailr_0.7.1           httr_1.4.0             knitr_1.23            
[33] fs_1.3.1               devtools_2.0.2         desc_1.2.0             rappdirs_0.3.1        
[37] hms_0.4.2              rprojroot_1.3-2        bit64_0.9-7            glue_1.3.1            
[41] crancache_0.0.0.9001   parsedate_1.2.0        R6_2.4.0               processx_3.3.1        
[45] rcmdcheck_1.3.3        sessioninfo_1.1.1      callr_3.2.0            blob_1.1.1            
[49] rematch2_2.0.1         magrittr_1.5           usethis_1.5.0          backports_1.1.4       
[53] ps_1.3.0               clisymbols_1.2.0       assertthat_0.2.1       cranlike_1.0.2        
[57] revdepcheck_1.0.0.9001 crayon_1.3.4          
gaborcsardi commented 5 years ago

Thanks for the report. I think this happens because revdepcheck still has the DB connection open to the revdep database, and it cannot remove the database file because Windows locks it.

If indeed this is the case, until this is fixed a workaround is to restart R, and then call revdep_reset().

ms609 commented 5 years ago

That sounds like a likely explanation. The workaround you suggested does indeed work.

hongooi73 commented 4 years ago

revdep_check prints a warning when it finishes,

call dbDisconnect() when finished working with a connection

so the fix for this would presumably be to call dbDisconnect.

willgearty commented 2 years ago

It's extremely frustrating that this is still an issue...

gaborcsardi commented 2 years ago

@willgearty does the workaround above work for you?

ms609 commented 2 years ago

I wonder whether there's a reason that @hadley 's proposed fix (#250) hasn't yet been implemented?

If it helps to suggest an alternative workaround, I'm now running revdepcheck using a GitHub action.

To set up for your own package:

The script will run on any push or pull request to the main/master branch

willgearty commented 2 years ago

@gaborcsardi The workaround does indeed work, but I'm just frustrated (as @ms609 mentions) that I need to use the workaround when @hadley made a perfectly good fix for this two years ago.

@ms609 That's fantastic, thanks for sharing!