Skip to content
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

remotes::install_ fails if a dependency has been installed already #134

Closed
ChrisPAC opened this issue Aug 9, 2019 · 13 comments
Closed

remotes::install_ fails if a dependency has been installed already #134

ChrisPAC opened this issue Aug 9, 2019 · 13 comments

Comments

@ChrisPAC
Copy link

ChrisPAC commented Aug 9, 2019

Running in a new directory:

renv::init()

renv::settings$use.cache(FALSE)

install.packages("yaml")
install.packages("remotes")

remotes::install_github("rstudio/blogdown")

Returns:
Error: Failed to install 'blogdown' from GitHub: argument is of length zero

In this example yaml is in the Imports section of the blogdown description file.

@kevinushey
Copy link
Collaborator

I wasn't able to reproduce. Can you provide some more information (e.g. your sessionInfo())?

@ChrisPAC
Copy link
Author

ChrisPAC commented Aug 9, 2019

R version 3.4.4 (2018-03-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale:
[1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C LC_TIME=en_GB.UTF-8
[4] LC_COLLATE=en_GB.UTF-8 LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8
[7] LC_PAPER=en_GB.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices datasets utils methods base

loaded via a namespace (and not attached):
[1] compiler_3.4.4 tools_3.4.4 remotes_2.1.0 renv_0.6.0-76

@kevinushey
Copy link
Collaborator

It could also be helpful to see the entirety of the output you see (to get a better hint where the error is happening -- is it renv or remotes?)

You could also check whether renv::install("rstudio/blogdown") works for you, since renv comes with support for GitHub remotes.

@ChrisPAC
Copy link
Author

ChrisPAC commented Aug 9, 2019

Sure, here is the complete output:

> renv::init()
* Discovering package dependencies ... Done!
* Copying packages into the cache ... Done!
* Lockfile written to '~/Projects/BugReports/PackageInstallationsRenv/renv.lock'.
* Project '~/Projects/BugReports/PackageInstallationsRenv' loaded. [renv 0.6.0-76]

Restarting R session...

* Project '~/Projects/BugReports/PackageInstallationsRenv' loaded. [renv 0.6.0-76]
> renv::settings$use.cache(FALSE)
* Copying packages into the private library ... Done!
* The cache has been disabled for this project.
> install.packages("htmltools")
* Querying repositories for available source packages ... Done!
Installing digest [0.6.20] ...
	OK (copied cache)
Installing Rcpp [1.0.2] ...
	OK (copied cache)
Installing htmltools [0.3.6] ...
	OK (copied cache)
* The lockfile is already up to date.
> install.packages("remotes")
Installing remotes [2.1.0] ...
	OK (copied cache)
* The lockfile is already up to date.
> remotes::install_github("rstudio/blogdown")
Downloading GitHub repo rstudio/blogdown@master
Error: Failed to install 'blogdown' from GitHub:
  argument is of length zero

@ChrisPAC
Copy link
Author

ChrisPAC commented Aug 9, 2019

renv::install("rstudio/blogdown") does work for me.

However I originally came across the problem using gitlab, which I don't think renv supports. I used github just for the example.

@kevinushey
Copy link
Collaborator

renv does indeed support GitLab, although a number of changes were just made recently to support GitLab groups + subgroups. You can install packages with something like:

renv::install("gitlab::user/repo")

Or, with a custom host:

renv::install("gitlab@gitlab-server.com::user/repo")

Regardless, the error appears to be happening in remotes and I do not know what the error might be. A traceback could be useful.

@ChrisPAC
Copy link
Author

ChrisPAC commented Aug 9, 2019

Brilliant, sorry I hadn't found that out myself. Using renv::install("gitlab::user/repo") does solve my problem.

Would you still be interested in a traceback or futher information on the error in remotes?

@kevinushey
Copy link
Collaborator

Yes, that would be useful. If it looks like a real problem in renv we could fix it here; otherwise, we could file an issue for remotes if we're able to learn what's going on.

@ChrisPAC
Copy link
Author

ChrisPAC commented Aug 9, 2019

Ok, here's the result of running traceback after the error.

> renv::init()
* Discovering package dependencies ... Done!
* Copying packages into the cache ... Done!
* Lockfile written to '~/Projects/BugReports/PackageInstallationsRenv/renv.lock'.
* Project '~/Projects/BugReports/PackageInstallationsRenv' loaded. [renv 0.6.0-63]

Restarting R session...

* Project '~/Projects/BugReports/PackageInstallationsRenv' loaded. [renv 0.6.0-63]
> renv::settings$use.cache(FALSE)
* Copying packages into the private library ... Done!
* The cache has been disabled for this project.
> 
> install.packages("htmltools")
* Querying repositories for available source packages ... Done!
Installing digest [0.6.20] ...
	OK (copied cache)
Installing Rcpp [1.0.2] ...
	OK (copied cache)
Installing htmltools [0.3.6] ...
	OK (copied cache)
* The lockfile is already up to date.
> install.packages("remotes")
Installing remotes [2.1.0] ...
	OK (copied cache)
* The lockfile is already up to date.
> remotes::install_github("rstudio/blogdown")
Downloading GitHub repo rstudio/blogdown@master
Error: Failed to install 'blogdown' from GitHub:
  argument is of length zero
> traceback()
7: stop(remote_install_error(remotes[[i]], e))
6: value[[3L]](cond)
5: tryCatchOne(expr, names, parentenv, handlers[[1L]])
4: tryCatchList(expr, classes, parentenv, handlers)
3: tryCatch(res[[i]] <- install_remote(remotes[[i]], ...), error = function(e) {
       stop(remote_install_error(remotes[[i]], e))
   })
2: install_remotes(remotes, auth_token = auth_token, host = host, 
       dependencies = dependencies, upgrade = upgrade, force = force, 
       quiet = quiet, build = build, build_opts = build_opts, build_manual = build_manual, 
       build_vignettes = build_vignettes, repos = repos, type = type, 
       ...)
1: remotes::install_github("rstudio/blogdown")

@ChrisPAC
Copy link
Author

ChrisPAC commented Aug 9, 2019

I've had a more detailed look and it seems to be related to this part of the DESCRIPTION files:

RemoteType: standard
RemoteRef: yaml
RemoteRepos: https://cloud.r-project.org
RemoteSha: 2.2.0

For RemoteType: standard, remotes seems to rely on there being another field present, RemotePkgType.

Whether that should be included by renv when a package is installed, or whether remotes should be able to use a sensible default is beyond me!

@kevinushey
Copy link
Collaborator

This sounds like a bug in remotes that has since been fixed in at least the development version:

r-lib/remotes#309
r-lib/remotes#310

@kevinushey
Copy link
Collaborator

FWIW, I believe that remote format will be written out when installing packages from CRAN with pak.

@kevinushey
Copy link
Collaborator

Since this appears to be independent of renv, I'm going to close this issue. Thanks for taking the time to test!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants