r-lib / crancache

Transparent caching of CRAN package files - WORK IN PROGRESS!
Other
28 stars 2 forks source link

Different repos for source and binary packages on Linux? #21

Closed krlmlr closed 7 years ago

krlmlr commented 7 years ago

In revdepcheck I keep running into situations where the crancache contains the binary but not the source package, see https://github.com/r-lib/rcmdcheck/pull/28. Not sure how this is possible, but in that case download.packages() will happily return the binary package.

contrib.url("", "binary") still returns "src/contrib" on Linux, so a parallel repo seems to be the only solution.

gaborcsardi commented 7 years ago

TBH, I am not sure how well we can work around the missing support for Linux binaries. But let's try.

krlmlr commented 7 years ago

Working on adding a type argument to get_cache_urls(). Should we create different repos for source and binary packages on all platforms, e.g.

Linux

Windows

etc.?

gaborcsardi commented 7 years ago

Yeah, I am working on this, too, actually. I have this now:

> get_cache_package_dirs()
                                         cran-bin/source
 "/home/vagrant/.cache/R-crancache/cran-bin/src/contrib"
                                           cran/platform
     "/home/vagrant/.cache/R-crancache/cran/src/contrib"
                                             cran/source
     "/home/vagrant/.cache/R-crancache/cran/src/contrib"
                                         bioc-bin/source
 "/home/vagrant/.cache/R-crancache/bioc-bin/src/contrib"
                                           bioc/platform
     "/home/vagrant/.cache/R-crancache/bioc/src/contrib"
                                             bioc/source
     "/home/vagrant/.cache/R-crancache/bioc/src/contrib"
                                        other-bin/source
"/home/vagrant/.cache/R-crancache/other-bin/src/contrib"
                                          other/platform
    "/home/vagrant/.cache/R-crancache/other/src/contrib"
                                            other/source
    "/home/vagrant/.cache/R-crancache/other/src/contrib"

which might be overkill for non-Linux platforms, but also seems easier. And this way we could distinguish the locally built binary packages.

krlmlr commented 7 years ago

Awesome, thanks! I'll back off then, but happy to review a PR and test locally on Linux.

gaborcsardi commented 7 years ago

Sounds good! Should be 10-15 minutes, I guess.

gaborcsardi commented 7 years ago

OK, can you pls try the linux-binaries branch?

I tried it a bit, and it looked OK, but not too thoroughly. This package really needs tests, but they are a pain to write....

krlmlr commented 7 years ago

Got it, will test.