-
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. |
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:
# Downloading packages ------------------------------------------------------- - Downloading cards from P3M ... OK [447.5 Kb in 0.65s] - Package mypackage [1.5.0] will be installed from the cellar. - Downloading insight from P3M ... OK [2.1 Mb in 0.66s] - Downloading datawizard from P3M ... OK [1 Mb in 0.71s] - Downloading performance from P3M ... OK [3 Mb in 0.59s] - Downloading mvtnorm from CRAN ... OK [file is up to date] - Package mypackage [1.5.0] will be installed from the cellar. Warning: failed to find source for 'mypackage 1.5.0' in package repositories Error: failed to retrieve package 'mypackage@1.5.0' In addition: Warning messages: 1: failed to resolve remote 'github::user/repo:src/packages/myotherpackage@myotherpackage-latest'; skipping 2: failed to resolve remote 'github::user/repo:src/packages/myotherpackage@myotherpackage-latest'; skipping 3: failed to resolve remote 'github::user/repo:src/packages/myotherpackage@myotherpackage-latest'; skipping Traceback (most recent calls last): 8: renv::install("/workspaces/mypackage", dependencies = TRUE) 7: records <- renv_retrieve_impl(packages) at install.R#209 6: for (package in packages) handler(package, renv_retrieve_impl_one(package)) at retrieve.R#120 5: for (package in packages) handler(package, renv_retrieve_impl_one(package)) at retrieve.R#120 4: switch(source, bioconductor = renv_retrieve_bioconductor(record), bitbucket = renv_retrieve_bitbucket(record), git = renv_retrieve_git(record), github = renv_retrieve_github(record), gitlab = renv_retrieve_gitlab(record), repository = renv_retrieve_repos(record), url = renv_retrieve_url(record), renv_retrieve_unknown_source(record) ) at retrieve.R#317 3: renv_retrieve_repos(record) at retrieve.R#1258 2: stopf("failed to retrieve package '%s'", remote) at retrieve.R#757 1: stop(sprintf(fmt, ...), call. = call.) at utils-format.R#3
The text was updated successfully, but these errors were encountered: