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

Error with roxygenize() checking version on some Linux configurations #802

Closed
jknowles opened this issue Oct 17, 2018 · 10 comments
Closed
Labels
bug an unexpected problem or unintended behavior reprex needs a minimal reproducible example
Milestone

Comments

@jknowles
Copy link

Unfortunately I cannot provide a REPREX because this bug depends on the build chain for the package.

After building R and roxygen from source using clang and clang++ on Ubuntu (version details below), the following error occurs:

> roxygen2::roxygenize()
Error: invalid version specification ‘6.0.1  ’

This appears to be related to how the package version number is parsed, which I think is related to differences in the compiler used at build time for the package.

Here is the traceback:

> traceback()
6: stop(gettextf("invalid version specification %s", paste(sQuote(unique(x[!ok])), 
       collapse = ", ")), call. = FALSE, domain = NA)
5: .make_numeric_version(x, strict, .standard_regexps()$valid_package_version, 
       "package_version")
4: package_version(prev)
3: update_roxygen_version(base_path)
2: roxygen_setup(base_path)
1: roxygen2::roxygenize()

To help with this, here is my session info. Additionally, I built R using clang and then set up my
Makevars to look like this:

CC=/usr/bin/clang
CXX=/usr/bin/clang++
CXX11=/usr/bin/clang++-6.0

Session info

 setting  value                       
 version  R version 3.5.1 (2018-07-02)
 os       Ubuntu 18.04.1 LTS          
 system   x86_64, linux-gnu           
 ui       X11                         
 language (EN)                        
 collate  en_US.UTF-8                 
 ctype    en_US.UTF-8                 
 tz       America/New_York            
 date     2018-10-17                  

Packages

 ! package     * version     date       lib source                         
   assertthat    0.2.0       2017-04-11 [1] CRAN (R 3.5.1)                 
   backports     1.1.2       2017-12-13 [1] CRAN (R 3.5.1)                 
   base64enc     0.1-3       2015-07-28 [1] CRAN (R 3.5.1)                 
   callr         3.0.0       2018-08-24 [1] CRAN (R 3.5.1)                 
   cli           1.0.1       2018-09-25 [1] CRAN (R 3.5.1)                 
   commonmark    1.6         2018-09-30 [1] CRAN (R 3.5.1)                 
   crayon        1.3.4       2017-09-16 [1] CRAN (R 3.5.1)                 
   desc          1.2.0       2018-05-01 [1] CRAN (R 3.5.1)                 
   devtools      1.13.6.9000 2018-10-17 [1] Github (r-lib/devtools@80fc2b5)
   digest        0.6.18      2018-10-10 [1] CRAN (R 3.5.1)                 
   fs            1.2.6       2018-08-23 [1] CRAN (R 3.5.1)                 
   glue          1.3.0       2018-07-17 [1] CRAN (R 3.5.1)                 
   magrittr      1.5         2014-11-22 [1] CRAN (R 3.5.1)                 
   memoise       1.1.0       2017-04-21 [1] CRAN (R 3.5.1)                 
   pkgbuild      1.0.2       2018-10-16 [1] CRAN (R 3.5.1)                 
   pkgload       1.0.1       2018-10-11 [1] CRAN (R 3.5.1)                 
   prettyunits   1.0.2       2015-07-13 [1] CRAN (R 3.5.1)                 
   processx      3.2.0       2018-08-16 [1] CRAN (R 3.5.1)                 
   ps            1.2.0       2018-10-16 [1] CRAN (R 3.5.1)                 
   R6            2.3.0       2018-10-04 [1] CRAN (R 3.5.1)                 
   Rcpp          0.12.19     2018-10-01 [1] CRAN (R 3.5.1)                 
   remotes       2.0.0       2018-10-11 [1] CRAN (R 3.5.1)                 
   rlang         0.2.2       2018-08-16 [1] CRAN (R 3.5.1)                 
 V roxygen2      6.1.0.9000  2018-07-27 [1] CRAN (R 3.5.1)                 
   rprojroot     1.3-2       2018-01-03 [1] CRAN (R 3.5.1)                 
   rstudioapi    0.8         2018-10-02 [1] CRAN (R 3.5.1)                 
   sessioninfo   1.1.0       2018-09-25 [1] CRAN (R 3.5.1)                 
   stringi       1.2.4       2018-07-20 [1] CRAN (R 3.5.1)                 
   stringr       1.3.1       2018-05-10 [1] CRAN (R 3.5.1)                 
   testthat      2.0.1       2018-10-13 [1] CRAN (R 3.5.1)                 
   usethis       1.4.0       2018-08-14 [1] CRAN (R 3.5.1)                 
   withr         2.1.2       2018-03-15 [1] CRAN (R 3.5.1)                 
   xml2          1.2.0       2018-01-24 [1] CRAN (R 3.5.1)                 

[1] /usr/local/lib/R/library
@gaborcsardi
Copy link
Member

This is probably desc not removing the trailing whitespace. AFAIR already fixed in GitHub desc.

@gaborcsardi
Copy link
Member

Btw. the V in front of roxygen2 suggests that your loaded version of roxygen2 is not the same as the on-disk one. You probably updated roxygen2, but did not restart R?

@jknowles
Copy link
Author

So I should try:

devtools::install_github("kutometis/roxygen")

Then restart R and try again? I'll give it a try now.

@jknowles
Copy link
Author

Update - it still fails with a fresh install of roxygen from GH directly:

 package     * version     date       lib source                             
 assertthat    0.2.0       2017-04-11 [1] CRAN (R 3.5.1)                     
 backports     1.1.2       2017-12-13 [1] CRAN (R 3.5.1)                     
 base64enc     0.1-3       2015-07-28 [1] CRAN (R 3.5.1)                     
 callr         3.0.0       2018-08-24 [1] CRAN (R 3.5.1)                     
 cli           1.0.1       2018-09-25 [1] CRAN (R 3.5.1)                     
 commonmark    1.6         2018-09-30 [1] CRAN (R 3.5.1)                     
 crayon        1.3.4       2017-09-16 [1] CRAN (R 3.5.1)                     
 desc          1.2.0       2018-05-01 [1] CRAN (R 3.5.1)                     
 devtools    * 1.13.6.9000 2018-10-17 [1] Github (r-lib/devtools@80fc2b5)    
 digest        0.6.18      2018-10-10 [1] CRAN (R 3.5.1)                     
 fs            1.2.6       2018-08-23 [1] CRAN (R 3.5.1)                     
 glue          1.3.0       2018-07-17 [1] CRAN (R 3.5.1)                     
 magrittr      1.5         2014-11-22 [1] CRAN (R 3.5.1)                     
 memoise       1.1.0       2017-04-21 [1] CRAN (R 3.5.1)                     
 pkgbuild      1.0.2       2018-10-16 [1] CRAN (R 3.5.1)                     
 pkgload       1.0.1       2018-10-11 [1] CRAN (R 3.5.1)                     
 prettyunits   1.0.2       2015-07-13 [1] CRAN (R 3.5.1)                     
 processx      3.2.0       2018-08-16 [1] CRAN (R 3.5.1)                     
 ps            1.2.0       2018-10-16 [1] CRAN (R 3.5.1)                     
 R6            2.3.0       2018-10-04 [1] CRAN (R 3.5.1)                     
 Rcpp          0.12.19     2018-10-01 [1] CRAN (R 3.5.1)                     
 remotes       2.0.0       2018-10-11 [1] CRAN (R 3.5.1)                     
 rlang         0.2.2       2018-08-16 [1] CRAN (R 3.5.1)                     
 roxygen2      6.1.0.9000  2018-10-17 [1] Github (klutometis/roxygen@cc34200)
 rprojroot     1.3-2       2018-01-03 [1] CRAN (R 3.5.1)                     
 rstudioapi    0.8         2018-10-02 [1] CRAN (R 3.5.1)                     
 sessioninfo   1.1.0       2018-09-25 [1] CRAN (R 3.5.1)                     
 stringi       1.2.4       2018-07-20 [1] CRAN (R 3.5.1)                     
 stringr       1.3.1       2018-05-10 [1] CRAN (R 3.5.1)                     
 testthat      2.0.1       2018-10-13 [1] CRAN (R 3.5.1)                     
 usethis     * 1.4.0       2018-08-14 [1] CRAN (R 3.5.1)                     
 withr         2.1.2       2018-03-15 [1] CRAN (R 3.5.1)                     
 xml2          1.2.0       2018-01-24 [1] CRAN (R 3.5.1) 

Same error, same traceback.

@hadley hadley added the bug an unexpected problem or unintended behavior label Jul 20, 2019
@hadley
Copy link
Member

hadley commented Aug 12, 2019

Can you please give me the results of this:

desc::desc_get("RoxygenNote", file = ".")[[1]]
utils::packageVersion("roxygen2")

@hadley hadley added the reprex needs a minimal reproducible example label Aug 12, 2019
@jknowles
Copy link
Author

Sure! Here's what that got (on my admittedly stale dev box this was initially reported on):

> desc::desc_get("RoxygenNote", file = ".")[[1]]
[1] "6.0.1  "
> utils::packageVersion("roxygen2")
[1] ‘6.1.0.9000’

@hadley
Copy link
Member

hadley commented Aug 26, 2019

Do you mind updating desc and re-running?

@jknowles
Copy link
Author

After updating to the latest version on GitHub using the README instructions the error appears to still occur.

* DONE (desc)
> roxygen2::roxygenize()
Error: invalid version specification ‘6.0.1  ’
> desc::desc_get("RoxygenNote", file = ".")[[1]]
[1] "6.0.1  "
> utils::packageVersion("roxygen2")
[1] ‘6.1.1’
> devtools::session_info()
─ Session info ───────────────────────────────────────────────────────────────
 setting  value                                             
 version  R Under development (unstable) (2018-11-13 r75601)
 os       Ubuntu 18.04.3 LTS                                
 system   x86_64, linux-gnu                                 
 ui       X11                                               
 language (EN)                                              
 collate  en_US.UTF-8                                       
 ctype    en_US.UTF-8                                       
 tz       America/New_York                                  
 date     2019-08-26                                        

─ Packages ───────────────────────────────────────────────────────────────────
 package     * version date       lib source                     
 assertthat    0.2.1   2019-03-21 [1] CRAN (R 3.6.0)             
 backports     1.1.4   2019-04-10 [1] CRAN (R 3.6.0)             
 callr         3.3.1   2019-07-18 [1] CRAN (R 3.6.0)             
 cli           1.1.0   2019-03-19 [1] CRAN (R 3.6.0)             
 commonmark    1.7     2018-12-01 [1] CRAN (R 3.6.0)             
 crayon        1.3.4   2017-09-16 [1] CRAN (R 3.5.1)             
 curl          4.0     2019-07-22 [1] CRAN (R 3.6.0)             
 desc        * 1.2.0   2019-08-26 [1] Github (r-lib/desc@c860e7b)
 devtools      2.1.0   2019-07-06 [1] CRAN (R 3.6.0)             
 digest        0.6.20  2019-07-04 [1] CRAN (R 3.6.0)             
 fs            1.3.1   2019-05-06 [1] CRAN (R 3.6.0)             
 glue          1.3.1   2019-03-12 [1] CRAN (R 3.6.0)             
 magrittr      1.5     2014-11-22 [1] CRAN (R 3.5.1)             
 memoise       1.1.0   2017-04-21 [1] CRAN (R 3.5.1)             
 pkgbuild      1.0.4   2019-08-05 [1] CRAN (R 3.6.0)             
 pkgload       1.0.2   2018-10-29 [1] CRAN (R 3.6.0)             
 prettyunits   1.0.2   2015-07-13 [1] CRAN (R 3.5.1)             
 processx      3.4.1   2019-07-18 [1] CRAN (R 3.6.0)             
 ps            1.3.0   2018-12-21 [1] CRAN (R 3.6.0)             
 R6            2.4.0   2019-02-14 [1] CRAN (R 3.6.0)             
 Rcpp          1.0.2   2019-07-25 [1] CRAN (R 3.6.0)             
 remotes       2.1.0   2019-06-24 [1] CRAN (R 3.6.0)             
 rlang         0.4.0   2019-06-25 [1] CRAN (R 3.6.0)             
 roxygen2      6.1.1   2018-11-07 [1] CRAN (R 3.6.0)             
 rprojroot     1.3-2   2018-01-03 [1] CRAN (R 3.5.1)             
 sessioninfo   1.1.1   2018-11-05 [1] CRAN (R 3.6.0)             
 stringi       1.4.3   2019-03-12 [1] CRAN (R 3.6.0)             
 stringr       1.4.0   2019-02-10 [1] CRAN (R 3.6.0)             
 testthat      2.2.1   2019-07-25 [1] CRAN (R 3.6.0)             
 usethis       1.5.1   2019-07-04 [1] CRAN (R 3.6.0)             
 withr         2.1.2   2018-03-15 [1] CRAN (R 3.5.1)             
 xml2          1.2.2   2019-08-09 [1] CRAN (R 3.6.0)             

[1] /usr/local/lib/R/library

@gaborcsardi
Copy link
Member

gaborcsardi commented Aug 26, 2019

Desc does not parse the RoxygenNote field. Either roxygen2 needs to parse the version and trim space, or we need to add support for this in desc. Even for the latter, roxygen2 needs an update, because desc_get just returns the value unparsed.

@hadley
Copy link
Member

hadley commented Aug 26, 2019

Ooooh of course; it's a simple fix and I'll do it tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior reprex needs a minimal reproducible example
Projects
None yet
Development

No branches or pull requests

3 participants