HenrikBengtsson / Wishlist-for-R

Features and tweaks to R that I and others would love to see - feel free to add yours!
https://github.com/HenrikBengtsson/Wishlist-for-R/issues
GNU Lesser General Public License v3.0
134 stars 4 forks source link

R CMD check: Option for testing with empty tools::R_user_dir() folders #156

Open HenrikBengtsson opened 11 months ago

HenrikBengtsson commented 11 months ago

Issue

Some packages use a file cache, also during R CMD check. This means that the results with and without a file cache might differ. For an example of this, see Bioconductor Support thread 'autonomics: example("read_somascan", package = "autonomics") fails, but not on Bioc check servers' started on 2023-12-06 (https://support.bioconductor.org/p/9155535/).

Proposal

Make it possible to run R CMD check with session-specific, empty, temporary user folders, e.g.

$ export _R_CHECK_EMPTY_USER_DIRS_=true
$ R CMD check --as-cran R.cache_0.16.0.tar.gz
* using log directory ‘/home/henrik/tmp/R.cache.Rcheck’
* using R version 4.3.2 (2023-10-31)
...
  Running ‘textPrompt.R’
 OK
* checking PDF version of manual ... OK
* checking HTML version of manual ... OK
* checking for non-standard things in the check directory ... OK
* checking for detritus in the temp directory ... OK
* checking for detritus in the user cache directory ... NOTE
Found the following added files:
42b71ea60b7c385ad29633002f402f72 431B README.txt
* checking for detritus in the user config directory ... OK
* checking for detritus in the user data directory ... OK
* DONE

Status: OK

Comment: I just used the "checking for detritus ..." output to illustrate the example. Whether a package should clean out user folders when tested or not can be debated. It sounds overly complicated to me.

PS. This replaces FR #155, which is unrealistic to implement by itself.