r-lib / pkgbuild

Find tools needed to build R packages
https://pkgbuild.r-lib.org
Other
65 stars 33 forks source link

Not able to install local package after updating dependencies #170

Closed llrs closed 1 year ago

llrs commented 1 year ago

I'm working in a package and I'm finding problems when installing locally and updating CRAN packages:

devtools::install()
## These packages have more recent versions available.
## It is recommended to update all of them.
## Which would you like to update?
## 
## 1: All                            
## 2: CRAN packages only             
## 3: None                           
## 4: openssl (2.0.6 -> 2.1.0) [CRAN]
## 
## Enter one or more numbers, or an empty line to skip updates: 2
## openssl (2.0.6 -> 2.1.0) [CRAN]
## ...
## installing to /home/lluis/bin/R/4.3.0/00LOCK-openssl/00new/openssl/libs
## ** R
## ** inst
## ** tests
## ** byte-compile and prepare package for lazy loading
## ** help
## *** installing help indices
## ** building package indices
## ** installing vignettes
## ** testing if installed package can be loaded from temporary location
## ** checking absolute paths in shared objects and dynamic libraries
## ** testing if installed package can be loaded from final location
## ** testing if installed package keeps a record of temporary installation path
## * DONE (openssl)
## 
## The downloaded source packages are in
##  '/tmp/Rtmphw8lCW/downloaded_packages'
## Error in "INSTALL_opts" %in% names(args) && grepl("--no-test-load", args$INSTALL_opts,  : 
##   'length = 2' in coercion to 'logical(1)'

After this I can install the package correctly with another call to devtools::install(). I'm using '1.4.0' and after this error message I updated to 1.4.2, so I don't know if this will surface again or might be related to a point in the 1.4.1 "pkgbuild now always appends its extra compiler flags to the ones that already exist in the system and/or user Makevars files (#156).".

I'm sorry for not providing a reproducible example or traceback() (I didn't think about reporting it immediately after the error occurred).

gaborcsardi commented 1 year ago

Why do you think this is an error in pkgbuild?

llrs commented 1 year ago

I initially wanted to report to devtools but then I realized it is not the right place to report this. After a cursory look at the internals of devtools::install I thought that pkgbuild was a better bet as I was trying to build my own package (I didn't check were that piece of code might come from and I didn't have a traceback). Apologies for reporting it incorrectly. If I report other bugs I'll be more careful.

Many thanks for fixing it. I appreciate a lot what you do.