Bioconductor / BiocCheck

http://bioconductor.org/packages/BiocCheck
8 stars 26 forks source link

Error in unloadNamespace(pkg_ns) #195

Closed hpages closed 1 year ago

hpages commented 1 year ago

This is an error I'm getting when running BiocCheck() on some core-maintained packages (e.g. Biobase, BiocFileCache, BiocGenerics, graph, RBGL, and others):

> BiocCheck("BiocGenerics_0.46.0.tar.gz")
─ BiocCheckVersion: 1.36.1
─ BiocVersion: 3.17
─ Package: BiocGenerics
─ PackageVersion: 0.46.0
─ sourceDir: /tmp/Rtmp03tT9t/file1f71791cb83134/BiocGenerics
─ installDir: /tmp/Rtmp03tT9t/file1f71794d89f2cc
─ BiocCheckDir: /home/biocbuild/bbs-3.17-bioc/meat/BiocGenerics.BiocCheck
─ platform: unix
─ isTarBall: TRUE

* Installing package...
* Checking for deprecated package usage...
bfcdownload() will overwrite exisiting files, continue? (yes/no): no
bfcdownload() will overwrite exisiting files, continue? (yes/no): no
* Checking for remote package usage...
* Checking for 'LazyData: true' usage...
* Checking version number...
* Checking for version number mismatch...
* Checking version number validity...
    Package version 0.46.0; pre-release
* Checking R version dependency...
    * NOTE: Update R version dependency from 4.0.0 to 4.3.0.
* Checking package size...
* Checking individual file sizes...
* Checking biocViews...
* Checking that biocViews are present...
* Checking package type based on biocViews...
    Software
* Checking for non-trivial biocViews...
* Checking that biocViews come from the same category...
* Checking biocViews validity...
* Checking for recommended biocViews...
* Checking build system compatibility...
* Checking for blank lines in DESCRIPTION...
* Checking if DESCRIPTION is well formatted...
* Checking for proper Description: field...
    * WARNING: Description field in the DESCRIPTION file is too concise
* Checking for whitespace in DESCRIPTION field names...
* Checking that Package field matches directory/tarball name...
* Checking for Version field...
* Checking for valid maintainer...
    * ERROR: Remove Maintainer field. Use Authors@R [cre] designation.
* Checking License: for restrictive use...
* Checking for pinned package versions...
* Checking DESCRIPTION/NAMESPACE consistency...
* Checking .Rbuildignore...
* Checking for stray BiocCheck output folders...
* Checking vignette directory...
    * ERROR: No 'vignettes' directory.
* Checking package installation calls in R code...
* Checking for library/require of BiocGenerics...
    * WARNING: Avoid the use of 'library' or 'require' in R code
* Checking coding practice...
    * NOTE: Avoid sapply(); use vapply()
    * NOTE: Avoid 'cat' and 'print' outside of 'show' methods
    * NOTE: Avoid using '=' for assignment and use '<-' instead
* Checking parsed R code in R directory, examples, vignettes...
    Found @ in man/path.Rd
    Found @ in man/updateObject.Rd
    * NOTE: Use accessors; don't access S4 class slots via '@' in
      examples/vignettes.
    * NOTE: Avoid '<<-' if possible (found 1 times)
* Checking function lengths...
    * NOTE: The recommended function length is 50 lines or less. There
      are 3 functions greater than 50 lines.
* Checking man page documentation...
    * WARNING: Empty or missing \value sections found in man pages.
Error in unloadNamespace(pkg_ns) : 
  namespace ‘BiocGenerics’ is imported by ‘graph’, ‘Biobase’ so cannot be unloaded

As mentioned in #193, I'm running into these issues in the context of my early exploratory experiment on the feasibility of running BiocCheck() as part of the daily builds. I guess the reason we never saw this error on the SPB is because new contributions don't have rev deps (they're leaves in the dependency tree).

The easy workaround is to wrap the calls to unloadNamespace() in a try() statement. Note that in the context of automated checks it doesn't matter whether BiocCheck() actually manages to unload the namespace of the package or not, because BiocCheck() will be called in its own separate R process for each package.

Thanks, H.

sessionInfo():

R version 4.3.0 RC (2023-04-13 r84269)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.2 LTS

Matrix products: default
BLAS:   /home/biocbuild/bbs-3.17-bioc/R/lib/libRblas.so 
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_GB              LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: America/New_York
tzcode source: system (glibc)

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

other attached packages:
[1] BiocCheck_1.36.1

loaded via a namespace (and not attached):
 [1] bit_4.0.5           dplyr_1.1.2         compiler_4.3.0     
 [4] BiocManager_1.30.21 filelock_1.0.2      tidyselect_1.2.0   
 [7] Biobase_2.60.0      blob_1.2.4          bitops_1.0-7       
[10] parallel_4.3.0      fastmap_1.1.1       R6_2.5.1           
[13] generics_0.1.3      curl_5.0.1          RBGL_1.76.0        
[16] knitr_1.43          BiocGenerics_0.46.0 graph_1.78.0       
[19] XML_3.99-0.14       tibble_3.2.1        DBI_1.1.3          
[22] pillar_1.9.0        rlang_1.1.1         utf8_1.2.3         
[25] cachem_1.0.8        xfun_0.39           bit64_4.0.5        
[28] RSQLite_2.3.1       memoise_2.0.1       cli_3.6.1          
[31] withr_2.5.0         magrittr_2.0.3      stringdist_0.9.10  
[34] RUnit_0.4.32        dbplyr_2.3.2        lifecycle_1.0.3    
[37] BiocFileCache_2.8.0 biocViews_1.68.1    vctrs_0.6.3        
[40] glue_1.6.2          codetools_0.2-19    stats4_4.3.0       
[43] RCurl_1.98-1.12     fansi_1.0.4         purrr_1.0.1        
[46] httr_1.4.6          tools_4.3.0         pkgconfig_2.0.3