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

Cannot install CRAN dependencies from user-named repo #4344

Closed
jmcphers opened this issue Feb 21, 2019 · 2 comments
Closed

Cannot install CRAN dependencies from user-named repo #4344

jmcphers opened this issue Feb 21, 2019 · 2 comments
Labels
bug stale Issues which have been closed automatically due to inactivitiy.

Comments

@jmcphers
Copy link
Member

System details

RStudio Edition : Both
RStudio Version : 1.2.1293, 1.1.463

Steps to reproduce the problem

  1. Remove all RStudio repository settings, so that getOption(repos) returns NULL in a new R session.
  2. Remove the rmarkdown package.
  3. Ensure that it is not possible to install packages from the RStudio global CRAN mirror.
  4. Set a custom repo with a custom name (not CRAN) in your .Rprofile, such that getOption(repos) returns the named character my repo "https://my/repo/url"
  5. Start a new R session.
  6. Attempt to create an R notebook.

Describe the problem in detail

You are prompted to install the rmarkdown package. However, when RStudio attempts to do so, it tries to install from RStudio's global CRAN mirror (not the repo you set), and fails.

This happens because of an asymmetry in dependency checking and dependency installation. The dependency manager assumes the first repo is a CRAN mirror when it is checking to see if packages are available (see #1762).

# if no repo named "CRAN", blindly guess that the first repo is a CRAN mirror
if (length(repo) < 1 || is.na(repo)) {
repo <- as.character(repos[[1]])

However, when packages are installed, we only use a mirror named CRAN, or the CRAN mirror in the user's settings.

cmd += "utils::install.packages(c(" + pkgList + "), " +
"repos = '"+ module_context::CRANReposURL() + "'";

Describe the behavior you expected

If RStudio is willing to use a repo as a CRAN mirror when detecting available packages for dependency installation, it should also be willing to use that repo to actually install the packages.

@jmcphers jmcphers added the bug label Feb 21, 2019
@stale
Copy link

stale bot commented Feb 6, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs, per https://github.com/rstudio/rstudio/wiki/Issue-Grooming. Thank you for your contributions.

@stale stale bot added the stale Issues which have been closed automatically due to inactivitiy. label Feb 6, 2021
@stale
Copy link

stale bot commented Feb 20, 2021

This issue has been automatically closed due to inactivity.

@stale stale bot closed this as completed Feb 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug stale Issues which have been closed automatically due to inactivitiy.
Projects
None yet
Development

No branches or pull requests

1 participant