Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packages with space in version number break the cache #25

Closed
krlmlr opened this issue Jul 13, 2017 · 4 comments
Closed

Packages with space in version number break the cache #25

krlmlr opened this issue Jul 13, 2017 · 4 comments

Comments

@krlmlr
Copy link
Member

krlmlr commented Jul 13, 2017

This likely needs to be fixed upstream (in cranlike, desc, or somewhere else), still filing here because it affects this package (and ultimately revdepcheck) and I'm not sure what the best fix is.

The reprex wipes your CRAN cache, be careful! We do seem to need a CRANCACHE_DIR env var.

library(crancache)

repos <- c(
  BioCsoft = "https://bioconductor.org/packages/3.5/bioc",
  BioCann= "https://bioconductor.org/packages/3.5/data/annotation", 
  BioCexp = "https://bioconductor.org/packages/3.5/data/experiment",
  BioCextra = "https://bioconductor.org/packages/3.5/extra", 
  CRAN = "http://cran.rstudio.com/"
)

# Caution: Wipes your CRAN cache!!!
unlink("~/.cache/R-crancache", recursive = TRUE)
install_packages("org.Hs.ipi.db", repos = repos)
#> Installing package into '/home/muelleki/R/x86_64-pc-linux-gnu-library/3.4'
#> (as 'lib' is unspecified)
#> Adding 'org.Hs.ipi.db_1.3.0.tar.gz' to the cache
#> Adding 'org.Hs.ipi.db_1.3.0_R_x86_64-pc-linux-gnu.tar.gz' to the cache
available_packages(repos = repos)
#> Error: invalid version specification '1.3.0 '
system("grep -A 10 org.Hs.ipi.db ~/.cache/R-crancache/*/*/*/PACKAGES | sed 's/$/|/'", intern = TRUE)
#>  [1] "/home/muelleki/.cache/R-crancache/bioc-bin/src/contrib/PACKAGES:Package: org.Hs.ipi.db|"                                                         
#>  [2] "/home/muelleki/.cache/R-crancache/bioc-bin/src/contrib/PACKAGES-Version: 1.3.0|"                                                                 
#>  [3] "/home/muelleki/.cache/R-crancache/bioc-bin/src/contrib/PACKAGES-Depends: R(>= 2.12.0) , methods, AnnotationDbi (>= 1.3.12), PAnnBuilder|"        
#>  [4] "/home/muelleki/.cache/R-crancache/bioc-bin/src/contrib/PACKAGES-                (>= 1.3.0)|"                                                     
#>  [5] "/home/muelleki/.cache/R-crancache/bioc-bin/src/contrib/PACKAGES-Imports: methods, AnnotationDbi, PAnnBuilder|"                                   
#>  [6] "/home/muelleki/.cache/R-crancache/bioc-bin/src/contrib/PACKAGES-License: Artistic-2.0|"                                                          
#>  [7] "/home/muelleki/.cache/R-crancache/bioc-bin/src/contrib/PACKAGES-MD5sum: bfd850aef2bda5620d7c942e90d9cc32|"                                       
#>  [8] "/home/muelleki/.cache/R-crancache/bioc-bin/src/contrib/PACKAGES:File: org.Hs.ipi.db_1.3.0_R_x86_64-pc-linux-gnu.tar.gz|"                         
#>  [9] "--|"                                                                                                                                             
#> [10] "/home/muelleki/.cache/R-crancache/bioc/src/contrib/PACKAGES:Package: org.Hs.ipi.db|"                                                             
#> [11] "/home/muelleki/.cache/R-crancache/bioc/src/contrib/PACKAGES-Version: 1.3.0 |"                                                                    
#> [12] "/home/muelleki/.cache/R-crancache/bioc/src/contrib/PACKAGES-Depends: R(>= 2.12.0) , methods, AnnotationDbi (>= 1.3.12), PAnnBuilder (>= 1.3.0) |"
#> [13] "/home/muelleki/.cache/R-crancache/bioc/src/contrib/PACKAGES-Imports: methods, AnnotationDbi, PAnnBuilder |"                                      
#> [14] "/home/muelleki/.cache/R-crancache/bioc/src/contrib/PACKAGES-License: Artistic-2.0|"                                                              
#> [15] "/home/muelleki/.cache/R-crancache/bioc/src/contrib/PACKAGES-MD5sum: 787cc8c4512e1e07c2ef0812024438ca|"                                           
#> [16] "/home/muelleki/.cache/R-crancache/bioc/src/contrib/PACKAGES:File: org.Hs.ipi.db_1.3.0.tar.gz|"
@gaborcsardi
Copy link
Member

I think it is a bug in remotes: r-lib/remotes#73

The reprex wipes your CRAN cache, be careful! We do seem to need a CRANCACHE_DIR env var.

There is one:

"CRANCACHE_DIR",

It should be documented, though.

@krlmlr
Copy link
Member Author

krlmlr commented Jul 13, 2017

I don't think this is related to the problem in remotes, because it also occurs with the CRAN version of remotes that does not use the CRAN cache. But maybe this means we just need to fix desc? (Or is it fixed there already?)

library(crancache)

repos <- c(
  BioCsoft = "https://bioconductor.org/packages/3.5/bioc",
  BioCann= "https://bioconductor.org/packages/3.5/data/annotation", 
  BioCexp = "https://bioconductor.org/packages/3.5/data/experiment",
  BioCextra = "https://bioconductor.org/packages/3.5/extra", 
  CRAN ="http://cran.rstudio.com/"
)

tempdir <- tempfile("R-crancache")
dir.create(tempdir)

withr::with_envvar(
  c(CRANCACHE_DIR = tempdir),
  {
    install_packages("org.Hs.ipi.db", repos = repos)
    available_packages(repos = repos)
  }
)
#> Installing package into '/home/muelleki/R/x86_64-pc-linux-gnu-library/3.4'
#> (as 'lib' is unspecified)
#> Adding 'org.Hs.ipi.db_1.3.0.tar.gz' to the cache
#> Adding 'org.Hs.ipi.db_1.3.0_R_x86_64-pc-linux-gnu.tar.gz' to the cache
#> Error: invalid version specification '1.3.0 '
Session info
devtools::session_info()
#> Session info -------------------------------------------------------------
#>  setting  value                       
#>  version  R version 3.4.1 (2017-06-30)
#>  system   x86_64, linux-gnu           
#>  ui       X11                         
#>  language en_US:en                    
#>  collate  en_US.UTF-8                 
#>  tz       Europe/Busingen             
#>  date     2017-07-13
#> Packages -----------------------------------------------------------------
#>  package    * version    date       source                             
#>  assertthat   0.2.0      2017-04-11 CRAN (R 3.4.1)                     
#>  backports    1.1.0      2017-05-22 CRAN (R 3.4.1)                     
#>  base       * 3.4.1      2017-07-08 local                              
#>  bit          1.1-12     2014-04-09 CRAN (R 3.4.0)                     
#>  bit64        0.9-8      2017-06-10 R-Forge (R 3.4.0)                  
#>  blob         1.1.0      2017-06-17 CRAN (R 3.4.1)                     
#>  callr        1.0.0.9000 2017-07-10 Github (r-lib/callr@ce3f15c)       
#>  compiler     3.4.1      2017-07-08 local                              
#>  crancache  * 0.0.0.9000 2017-07-13 local                              
#>  cranlike     1.0.0      2017-07-11 local                              
#>  crayon       1.3.2.9000 2017-07-10 Github (gaborcsardi/crayon@750190f)
#>  curl         2.7        2017-06-26 CRAN (R 3.4.1)                     
#>  datasets   * 3.4.1      2017-07-08 local                              
#>  DBI          0.7        2017-06-18 CRAN (R 3.4.1)                     
#>  debugme      1.0.2      2017-03-01 CRAN (R 3.4.1)                     
#>  desc         1.1.0      2017-01-27 CRAN (R 3.4.1)                     
#>  devtools     1.13.2     2017-06-02 CRAN (R 3.4.1)                     
#>  digest       0.6.12     2017-01-27 CRAN (R 3.4.1)                     
#>  evaluate     0.10.1     2017-06-24 CRAN (R 3.4.1)                     
#>  graphics   * 3.4.1      2017-07-08 local                              
#>  grDevices  * 3.4.1      2017-07-08 local                              
#>  htmltools    0.3.6      2017-04-28 CRAN (R 3.4.1)                     
#>  knitr        1.16       2017-05-18 CRAN (R 3.4.1)                     
#>  magrittr     1.5        2014-11-22 CRAN (R 3.4.1)                     
#>  memoise      1.1.0      2017-04-21 CRAN (R 3.4.0)                     
#>  methods    * 3.4.1      2017-07-08 local                              
#>  parsedate    1.1.3      2017-03-02 CRAN (R 3.4.0)                     
#>  pkgconfig    2.0.1      2017-03-21 CRAN (R 3.4.1)                     
#>  processx     2.0.1      2017-07-10 Github (r-lib/processx@4bf780f)    
#>  R6           2.2.2      2017-06-17 CRAN (R 3.4.1)                     
#>  rappdirs     0.3.1      2016-03-28 CRAN (R 3.4.0)                     
#>  Rcpp         0.12.11    2017-05-22 CRAN (R 3.4.1)                     
#>  rlang        0.1.1      2017-05-18 CRAN (R 3.4.1)                     
#>  rmarkdown    1.6        2017-06-15 CRAN (R 3.4.1)                     
#>  rprojroot    1.2        2017-01-16 CRAN (R 3.4.1)                     
#>  RSQLite      2.0        2017-07-09 Github (rstats-db/RSQLite@88c7c64) 
#>  rstudioapi   0.6        2016-06-27 CRAN (R 3.4.1)                     
#>  stats      * 3.4.1      2017-07-08 local                              
#>  stringi      1.1.5      2017-04-07 CRAN (R 3.4.1)                     
#>  stringr      1.2.0      2017-02-18 CRAN (R 3.4.1)                     
#>  tibble       1.3.3      2017-05-28 CRAN (R 3.4.1)                     
#>  tools        3.4.1      2017-07-08 local                              
#>  utils      * 3.4.1      2017-07-08 local                              
#>  withr        1.0.2      2016-06-20 CRAN (R 3.4.1)                     
#>  yaml         2.1.14     2016-11-12 CRAN (R 3.4.1)

@krlmlr
Copy link
Member Author

krlmlr commented Jul 13, 2017

FWIW, desc also struggles with this:

desc::desc_get_version("/home/muelleki/.cache/R-crancache/bioc/src/contrib/org.Hs.ipi.db/DESCRIPTION")
#> Error: invalid version specification '1.3.0 '

gaborcsardi added a commit to r-hub/cranlike that referenced this issue Aug 3, 2017
We trim the whitespace now, because it causes
problems in downstream tools:
r-lib/crancache#25
@gaborcsardi
Copy link
Member

Fixed now in cranlike, we just trim the whitespace before creating PACKAGES*: r-hub/cranlike@62b5d82

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants