How does devtools::install() discover dependencies differently?

Hi there.

I've been trying to piece together how R goes about with compiling a package. For context, I have a project that uses renv for managing dependencies and on one main machine, I can run both R CMD INSTALL and devtools install without any issue.

However, on another ubuntu box, R CMD INSTALL fails to install citing packages are not available, when they were downloaded by renv restore. devtools install straight up fails at the pkgbuild rdb corrupt error, which I can only resolve with a restart if running interactively.

TLDR: Anyone knows how one can get renv 1.0.7 to play nicely with devtools install? Does devtools need to be explicitly made aware of the path renv has downloaded the packages to?

Is {renv} activated when you run devtools::install()? What is .libPaths()?

Also, if you are using {renv} in combination with an R package, I recommend you read the vignette on Package development. Apparently {renv} purposefully behaves slightly differently for an R package in contrast to a simple project:

For package projects using renv, a library path outside of the project directory will be used instead... This is done to avoid issues with R CMD build , which can become very slow if your project contains a large number of files – as can happen if the project library is located in renv/library (the typical location). Note that even though the library is located outside of the project, the library path generated will still be unique to that project, and so the project is still effectively isolated in the same way as other renv projects normally are.