-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Local package install fail when dependencies = TRUE
#1977
Comments
Thanks for the bug report, but this is going to be very challenging to fix without a reproducible example. Any chance the project wherein you're seeing this is available publicly, or you'd be able to divine a reproducible example? |
It should remain private, that is the unfortunate part of the issue as I know too well the requirement for a reproducible example. I'll keep trying to reproduce with a dummy package and update here. Meanwhile, why does the switch (from the trace) does not have a "renv_retrieve_local" function? |
The code isn't entirely clear, but before we attempt to install from the regular remote sources, we try to handle installation "shortcuts" which includes local package installations: Lines 296 to 310 in 73c899e
In particular, Lines 648 to 663 in 73c899e
This output:
seems curious; it seems like |
I'll try next week to come up with a clean small reproducible example mimicking the private environment in which this issue occurs. |
I recreated a very similar setup but I am unable to reproduce the issue in it (https://github.com/mcanouil/renv-issue1977). Feel free to close as the blocking part of the issue was solved on our end by changing where we stored the cache and by completely purging it in the process. Side note (I can open a separate issue about this if it's indeed a bug): it seems the following syntax (used to tell Assume a Depends:
pkg1
Remotes:
pkg1=github::mcanouil/renv-issue1977:src/packages/pkg1@pkg1-latest renv::init() This project contains a DESCRIPTION file.
Which files should renv use for dependency discovery in this project?
1: Use only the DESCRIPTION file. (explicit mode)
2: Use all files in this project. (implicit mode)
Selection: 1
- Using 'explicit' snapshot type. Please see `?renv::snapshot` for more details.
Error in FUN(X[[i]], ...) : object of type 'closure' is not subsettable
Traceback (most recent calls last):
6: renv::init()
5: hydrate(library = library, repos = repos, prompt = FALSE, report = FALSE,
project = project)
4: renv_project_remotes(project, filter = filter, resolve = TRUE)
3: filter(specs, remotes)
2: map_chr(remotes, `[[`, "Package")
1: vapply(x, f, ..., FUN.VALUE = character(1)) |
Thanks! I can reproduce that as well, and it appears to be a real issue. I've filed that in #2055. |
Somehow the codepath completely change when adding
dependencies = TRUE
.It seems, for some reason it goes to the default in
switch
which then change the source toRepository
.The codepath for "local" packages also seems off, the
record
object contains theRemoteURL
which is the path, but it is somehow not used.Also, the records with the proper information, is overwritten: https://github.com/rstudio/renv/blob/main/R/install.R#L193-L209
I tried to get to the bottom of it, but it seems there is no actual "local" codepath which seems the reason of such weird behaviour. I know that local packages cannot really be restored, but I do think they should still be installed properly even if they are no caching, etc.
Unfortunately, I cannot manage to create a dummy package that reproduce this.
The
DESCRIPTION
of "mypackage" looks like:This is what the output look like without dependencies:
The following package(s) will be installed: - base64enc [0.1-3] ... These packages will be installed into "/workspaces/renv/library/linux-ubuntu-jammy/R-4.4/x86_64-pc-linux-gnu". Do you want to proceed? [Y/n]: # Installing packages -------------------------------------------------------- ... - Installing mypackage ... OK [built from source and cached in 24s] Successfully installed 65 packages in 31 seconds. Warning message: failed to resolve remote 'github::user/repo:src/packages/myotherpackage@myotherpackage-latest'; skipping
With dependencies:
The text was updated successfully, but these errors were encountered: