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

Default to PPM on Linux #430

Closed
slopp opened this issue May 15, 2020 · 4 comments · Fixed by #1348
Closed

Default to PPM on Linux #430

slopp opened this issue May 15, 2020 · 4 comments · Fixed by #1348
Labels
feature a feature request or enhancement repositories 📚

Comments

@slopp
Copy link
Contributor

slopp commented May 15, 2020

Similar to how renv uses MRAN to provide historical binaries for Mac and Windows, now that RSPM is publicly available at packagemanager.rstudio.com it should be possible:

  1. For renv to default to PPM for installing binaries on Linux for new package installs during init, hydrate, or install
  2. For renv to default to PPM for installing binaries on Linux for historical packages during restore

One easy way to do this might simply be to prefer packagemanager.rstudio.com over cran.rstudio.com automatically, with an opt-out setting. The previous renv+RSPM work will ensure that the appropriate binary suffix is added to the repo URL, while maintaining a cross platform compatible repo URL in the lock file.

The only downside to be aware of is that sometimes PPM will lag CRAN on brand new package releases, up to a few days.

@kevinushey
Copy link
Collaborator

The only downside to be aware of is that sometimes PPM will lag CRAN on brand new package releases, up to a few days.

This one worries me a bit, although it's still a solvable problem:

  1. Does the package exist on RSPM? If so, download it from there.
  2. Does it exist on the regular CRAN repository? If so, download it from there.

The simplest solution then might be to just have both the RSPM and the CRAN repositories active simultaneously. This does cause some issues when using base R's tools around listing available packages but renv should mostly be immune to those.

@kevinushey
Copy link
Collaborator

One other larger issue: packages might require system libraries which may not yet be available on the user's system; e.g. the curl package links to libcurl, which may not be available by default.

Installing the package from sources would fail at install time, and the associated configure script would provide instructions to the user as to how its dependencies could be satisfied. However, when installing from RSPM, the package would install successfully but then fail to load as the requisite libraries would not be available.

In other words, I think turning this on by default would also require renv to be able to access and validate the system requirements associated with a particular package, which makes this rather more challenging.

I'd be curious to know whether this tends to be an issue in practice, or how it's already solved in existing RSPM installations.

@slopp
Copy link
Contributor Author

slopp commented May 15, 2020

RSPM provides an API and UI that shows runtime system dependencies for a given repository or package (including dependencies). There is even a new API that does this for packages not in RSPM based on a description file.

In practice, the 80:20 rule tends to apply, where a handful of system packages meet the needs of most CRAN packages, but you're right it is certainly a risk!

One bit of good news is that often runtime deps are less than build time deps, so for example, a user accessing the stringi pre-built binary has a much easier time than someone trying to track down the needed dependencies to install it from source.

@grantmcdermott
Copy link

Just adding my support for this idea. Defaulting to RSPM binaries (or, at least, trying these first) would be very helpful from a scientific reproducibility standpoint.

If you have time (ha!), a short vignette on renv+RSPM workflows would also be really helpful.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement repositories 📚
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants