bspm icon indicating copy to clipboard operation
bspm copied to clipboard

Add a mechanism to retrieve package versions

Open Enchufa2 opened this issue 2 years ago • 3 comments

Use case: packages like renv could ask bspm what's available in the system repos to choose those preferentially if versions match.

Enchufa2 avatar May 26 '22 12:05 Enchufa2

For what it is worth, in r2u I just use available.packages(). (Some chin scratching ....) But I may misunderstand what you're after here.

eddelbuettel avatar May 26 '22 12:05 eddelbuettel

What renv does, basically, is:

  • The lockfile says that pkgA vX.Y must be installed.
  • renv downloads cran.r-project.org/src/contrib/Archive/pkgA/pkgA_X.Y.tar.gz
  • installs it in the cache, and links it in the project repository.

And pak is basically the same with more bells and whistles. With this feature, this could be possible:

  • The lockfile says that pkgA vX.Y must be installed.
  • renv asks bspm what version is available for pkgA. This could be the latest one (it would normally be the latest one), but it could be an old one if r2u (or c2d4u4, or whatever) is not up-to-date for some reason. So available.packages is not 100% reliable here.
  • If the version returned by bspm is X.Y, then renv just calls bspm::install_sys("pkgA")
  • and links it in the project repository.

Of course, if the version returned by bspm is not X.Y, then renv can proceed as usual.

Enchufa2 avatar May 26 '22 12:05 Enchufa2

So available.packages is not 100% reliable here.

You are correct. I use that on the building side to find what I could inject into r2u. On the other side we could possibly use RcppAPT :) but it is probably simpler to just ask apt or dpkg from Python.

eddelbuettel avatar May 26 '22 13:05 eddelbuettel

Use case: packages like renv could ask bspm what's available in the system repos to choose those preferentially if versions match.

Another use case for having the R package versions available in the binary repos that bspm accesses, would be to have install.packages() use the latest version. I was actually assuming this (eddelbuettel/r-ci#10)...

jranke avatar Nov 11 '22 14:11 jranke