Hello, I was giving a test at renv today.
I might be expecting something wrong with the package.
My use case would be the following:
I create my own project, say tracked by git, I install renv, I do renv::init().
I start working I load some packages, I stop working I do renv::snapshot()
I commit and push
Then my colleague clone the git repo I have created.
when he starts R in this repo I would expect
renv to be automatically installed*
renv::activate() to be called
all other packages to be installed*
I added * because I am not sure about something:
is the source of each package used stored within the project or even the library itself ? or is it merely information about the packages used that is stored so that the packages can be re-installed (remotely) ?
can I ship the compiled packages themselves so people would not have to re-install them ?
Finally I tried it and my coolegue got the following issue:
Failed to find installation of renv -- attempting to bootstrap...
The article Collaborating with renv describes the workflow that you and your colleague should follow.
In short, your colleague should
Install renv
Run renv::init() (or renv::restore() )
The information about the packages you use is contained in the renv.lock file. This does not contain the source code or the binary versions of these packages, but merely the information needed to restore these packages.
You should find in it the information about the repos used and where package are from. Those informations will be reuse in your colleague environment to restore the package from the same location. Looking at this file may give you some clues...
Yes, renv will attempt to bootstrap itself when an R session is launched for that project.
This is indeed the case.
In my humble opinion, this would be too heavy-handed. We do not want to automatically install all of the packages recorded within renv.lock without some explicit user gesture. Users can invoke renv::restore() to restore their project library based on what's defined in the lockfile.
Package sources are stored within the lockfile. That is, given the renv.lock lockfile, renv will be able to download and install packages from their declared sources.
You could, but I wouldn't recommend this unless you were sure you and your collaborators were working in identical environments. (This would likely work on Windows, but would likely break on different versions on macOS / Linux)
Sorry, it's likely your colleague attempted to clone and use your project when I had failed to tag the most recent commit of renv on GitHub. It should be fixed now.
You're running R in a state where renv itself is not actually installed or available within the project library. For that reason, renv has to fall back to a minimal downloader that knows just enough to be able to download renv either from CRAN (if available), or GitHub otherwise.