Open d-sci opened 4 years ago
- if you checked in .Rprofile and renv/activate.R , the if will always be FALSE, because that will bootstrap everything
I believe you are correct (unless R was launched with --vanilla
or --no-init-file
, which doesn't appear to be the case here)
- if you didn't check those in, then renv won't be active yet, so while things may work, you'll be targeting your normal .libPaths()[[1]] instead of renv/library (right?)
That's correct. In this case, I think one would want to explicitly call renv::load(); renv::restore()
to ensure that the project infrastructure is loaded before restore.
All that said -- I think the most straightforward way to make sure these things work is to just ensure that the .Rprofile
and renv/activate.R
scripts are checked in, since then those scripts would automatically make sure the right version of renv
is installed and used to load the project.
It may be helpful to some to include in the CI vignette an example for bitbucket pipelines.
Here's a prototype similar to the ones provided for other services:
In actual pipelines that I've written, however, I skipped the
if (!requireNamespace('renv', quietly = TRUE)) install.packages('renv')
step which you have as an example in all of them. Somewhat related to our discussion regarding the collaboration vignette (#366 ), it seems to me that:.Rprofile
andrenv/activate.R
, theif
will always be FALSE, because that will bootstrap everythingrenv
won't be active yet, so while things may work, you'll be targeting your normal.libPaths()[[1]]
instead ofrenv/library
(right?)This was a little confusing to me.