r-lib / revdepcheck

R package reverse dependency checking
https://revdepcheck.r-lib.org
Other
99 stars 31 forks source link

Remotes field in DESCRIPTION doesn't propagate to revdeps #268

Closed DavisVaughan closed 3 years ago

DavisVaughan commented 3 years ago

I wanted to run revdeps for furrr, which currently relies on the development version of globals. I have put a Remote on globals in the DESCRIPTION file of furrr. It seems that revdep_check() won't respect the fact that I want the dev version of globals when it installs the dependencies for each revdep.

I have installed the development version of globals locally with devtools::install_github("HenrikBengtsson/globals@develop"). The dev version is 0.12.5-9000.

It does not look like this updated the cache in crancache, which might be the problem? I can confirm this with:

> pkgs <- crancache::crancache_list()
> pkgs[pkgs$Package == "globals", ]
    Package    Repository Version                           MD5sum
862 globals cran/platform  0.12.5 f792524b7ec8ab80267ece9c154ff511

I stepped through revdep_check() and it looks like it uses crancache for installing deps of the revdep packages.

One of the revdeps is simhelpers, and it failed because of an issue that was fixed in dev globals. I can further confirm that the CRAN version of globals was used because it is in /revdep/library.noindex/simhelpers/globals/ and the DESCRIPTION file there shows 0.12.5.

gaborcsardi commented 3 years ago

I have installed the development version of globals locally with

Local installs are not used from the cache, that would potentially mess up the check. I understand that you want this one in this special case, but usually you don't want them.

I think the issue is that the dependencies of a revdep are installed into a library that shadows the library that is created for the revdep-checked package itself.

gaborcsardi commented 3 years ago

Oh, wait, globals is a dependency of your package as well, then this should happen.

gaborcsardi commented 3 years ago

It seems that revdep_check() won't respect the fact that I want the dev version of globals when it installs the dependencies for each revdep.

So why do you actually think that?

gaborcsardi commented 3 years ago

This is what I see in libraries.txt for bigdist:

Library: /Users/gaborcsardi/src/furrr/revdep/library.noindex/furrr/new
...
globals   (0.12.5-9000)
...

Library: /Users/gaborcsardi/src/furrr/revdep/library.noindex/bigdist
...
globals       (0.12.5)
...

and the first should be used for the check.

DavisVaughan commented 3 years ago

This was the main reason that I believed that the CRAN version 0.12.5 of globals was being used

One of the revdeps is simhelpers, and it failed because of an issue that was fixed in dev globals.

I believe that CRAN globals was used when checking simhelpers

gaborcsardi commented 3 years ago

CRAN globals is used for the "old" case, yes, and GitHub globals is used for the "new" case. Which seems like the behavior you would expect, no?

I put a session_info() call into the testthat.R of simhelpers:

~/src/furrr/revdep/checks.noindex/simhelpers 
❯ grep globals  old/simhelpers.Rcheck/tests/testthat.Rout
 globals       0.12.5  2019-12-07 [2] CRAN (R 4.0.2)

~/src/furrr/revdep/checks.noindex/simhelpers 
❯ grep globals  new/simhelpers.Rcheck/tests/testthat.Rout
 globals       0.12.5-9000 2020-09-14 [2]
 Github (HenrikBengtsson/globals@61ca7ea)

Isn't this what you want?

DavisVaughan commented 3 years ago

I ran it again and I'm getting the same results as you. It seems to work correctly now. I still have the failure from before in problems.md, but I can't seem to reproduce it now. I guess I'll close this. I'll report back if it happens to pop up again in the future. Thanks for looking into it!

gaborcsardi commented 3 years ago

FWIW the order of the libraries has been always the same: https://github.com/r-lib/revdepcheck/blob/04fe3906e5a9eced516183fea4c0f4df3a5de102/R/check.R#L21-L23