You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
renv::install fails with nested github repository #497
renv has been a huge help in managing my package dependencies, thanks! Running into a small issue. renv ususally works great installing development versions of packages from github. However, it seems to fail when the packages itself is in a nested folder on github. installing the TMBhelper package (only available on github) running remotes::install_github("kaskr/TMB_contrib_R/TMBhelper") works normally (TMBhelper lives in a nested folder of repoistory TMB_contrib_R). But, running the same command with renv::install fails
library(remotes)
# install using remotesremotes::install_github("kaskr/TMB_contrib_R/TMBhelper")
#> Downloading GitHub repo kaskr/TMB_contrib_R@HEAD#> Running `R CMD build`...#> * checking for file ‘/private/var/folders/vt/975_52y17cv36nvw83_dcslw0000gn/T/RtmpF4txW9/remotes984c23d40f7e/kaskr-TMB_contrib_R-8cb8bbf/TMBhelper/DESCRIPTION’ ... OK#> * preparing ‘TMBhelper’:#> * checking DESCRIPTION meta-information ... OK#> * checking for LF line-endings in source and make files and shell scripts#> * checking for empty or unneeded directories#> * building ‘TMBhelper_1.2.0.tar.gz’#> Installing package into '/Users/danovan/projects/renvtest/renv/library/R-4.0/x86_64-apple-darwin17.0'#> (as 'lib' is unspecified)#install using renvrenv::install("kaskr/TMB_contrib_R/TMBhelper")
#> Warning: curl: (22) The requested URL returned error: 404 Not Found#> Warning: curl: (22) The requested URL returned error: 404 Not Found#> Error: failed to parse remote 'kaskr/TMB_contrib_R/TMBhelper' -- download failed [error code 22]
The problem here is that renv uses a slightly different syntax for packages in sub-directories of projects -- in particular, it uses : as a delimiter. For example, the following should work:
> renv::install("kaskr/TMB_contrib_R:TMBhelper")
Retrieving 'https://api.github.com/repos/kaskr/TMB_contrib_R/tarball/8cb8bbfe4b77b4d864932a1f213092b53a7313f0' ...
OK [downloaded 2.7 Mb in 2.3 secs]
Installing TMBhelper [1.2.0] ...
OK [built from source]
* Copying 'TMBhelper' into the cache ... Done!
Of course, I haven't documented this so there's no way you could've known. :-) I think:
I should document this behavior;
I should support the same syntax used by remotes; that is, user/repo/subdir, just for compatibility.
For what it's worth, the reason I diverged in syntax here is because some public repositories (e.g. Gitlab) have the notion of groups / sub-groups, so I wanted to ensure that:
group/subgroup/package:subdir
that is, install package package living in the sub-directory subdir from the project referenced by group/subgroup would still work.
Reacted by Lucas de Almeida Carotta and Maksim Kholmatov
Got it, thanks. Makes sense to me. If documented the current solution works fine, but I suppose it does create a wrinkle in the reproducibility process in that packages that have Github dependencies that live in sub-directories of repos, and list the path to those dependencies in DESCRIPTION > Remotes like :
Remotes:
kaskr/TMB_contrib_R/TMBhelper
Will be installable via remotes but fail to install by renv. So, compatibility for both syntax would be good if possible!
This should now be supported in the development version of renv -- thanks for the report!
> renv::install("kaskr/TMB_contrib_R/TMBhelper", rebuild = TRUE)
Retrieving 'https://api.github.com/repos/kaskr/TMB_contrib_R/tarball/8cb8bbfe4b77b4d864932a1f213092b53a7313f0' ...
OK [file is up to date]
Installing TMBhelper [1.2.0] ...
OK [built from source]
* Copying 'TMBhelper' into the cache ... Done!
Hi @kevinushey I have the same issue when trying to install packages from a sub folder in a Azure-Devops repository. I can install the package using a : as delimiter but if fails with a /
# good renv::install("git::https://dev.azure.com/company-name/department/_git/repo/packages:package-name", rebuilt=T)
# badrenv::install("git::https://dev.azure.com/company-name/department/_git/repo/packages/package-name", rebuilt=T)
Using latter approach I get following error message:
So in theory I just could use : but I also have dependencies in the same repo. In DESCRIPTION > Remotes I tried using both : and /, giving me following error
fatal: unable to access 'https://dev.azure.com/company-name/department/_git/repos:packages/package-name/': The requested URL returned error: 400
respectively
fatal: repository 'https://dev.azure.com/company-name/department/_git/repos/packages/package-name/' not found
might this be the same issue as above with github?
Activity
kevinushey commentedon Jul 28, 2020
The problem here is that
renvuses a slightly different syntax for packages in sub-directories of projects -- in particular, it uses:as a delimiter. For example, the following should work:Of course, I haven't documented this so there's no way you could've known. :-) I think:
remotes; that is,user/repo/subdir, just for compatibility.For what it's worth, the reason I diverged in syntax here is because some public repositories (e.g. Gitlab) have the notion of groups / sub-groups, so I wanted to ensure that:
that is, install package
packageliving in the sub-directorysubdirfrom the project referenced bygroup/subgroupwould still work.DanOvando commentedon Jul 28, 2020
Got it, thanks. Makes sense to me. If documented the current solution works fine, but I suppose it does create a wrinkle in the reproducibility process in that packages that have Github dependencies that live in sub-directories of repos, and list the path to those dependencies in DESCRIPTION > Remotes like :
Will be installable via
remotesbut fail to install byrenv. So, compatibility for both syntax would be good if possible!kevinushey commentedon Jul 28, 2020
This should now be supported in the development version of
renv-- thanks for the report!siri16100 commentedon Nov 11, 2023
Hi @kevinushey I have the same issue when trying to install packages from a sub folder in a Azure-Devops repository. I can install the package using a
:as delimiter but if fails with a/Using latter approach I get following error message:
So in theory I just could use
:but I also have dependencies in the same repo. In DESCRIPTION > Remotes I tried using both:and/, giving me following errorfatal: unable to access 'https://dev.azure.com/company-name/department/_git/repos:packages/package-name/': The requested URL returned error: 400respectively
fatal: repository 'https://dev.azure.com/company-name/department/_git/repos/packages/package-name/' not foundmight this be the same issue as above with github?
kevinushey commentedon Nov 13, 2023
I think so. I should petition
remotesto consider allowing the syntax I've adopted here for sub-directories...