Conversation
| resolved <- renv::paths$lockfile(project = bundleDir) | ||
|
|
||
| # If the resolved file exists, and is different from the standard location, | ||
| # copy it to the standard location. |
There was a problem hiding this comment.
Why do we need to copy it at all? Why can't we use it where it lives? It's a little odd to me that this function would alter the contents of the current working directory.
There was a problem hiding this comment.
One thing that's confusing about this is that it's actually not copying it into the working directory, but actually into the temporary directory the rsconnect creates and copies files over to a temporary directory
Lines 130 to 135 in c704931
Lines 1 to 12 in c704931
But thinking about this more, we might need to make sure that we can handle relative paths in RENV_PATHS_LOCKFILE since when this is run inside of the temp bundle dir, those might not work (e.g. if RENV_PATHS_LOCKFILE="../renv.lock" and the app is at /home/jonkeane/Documents/myapp/subdir/, my lock file is at /home/jonkeane/Documents/myapp/renv.lock we don't want the target of this copy to be /tmp/.../renv.lock
| if (file.exists(standard)) { | ||
| cli::cli_warn(c( | ||
| "Using lockfile at {.path {resolved}} instead of {.path {standard}}.", | ||
| i = "The lockfile in the project root may be outdated.", |
There was a problem hiding this comment.
If I run this function twice, I'm going to get this warning, even though the files themselves are identical. Should we be checking the contents of the files instead?
There was a problem hiding this comment.
I can add checking the contents, but running user-exported commands in rsconnect, this path should not alter someone's app directory (so this shouldn't happen in practice unless someone calls rsconnect:::ensureRenvLockFile (or the other internal functions that always operate on the temp bundle dir
Support renv profiles and custom renv file locations specified with the
RENV_PATHS_LOCKFILEenvironment variableFixes #1122