r-lib/pkgload

Should we suppress "Dependency package not available" warnings?

gaborcsardi opened this issue · 3 comments

They do not seem to add anything to the error, right?

> pkgload::load_all()
i Loading pkgdepends
Error: Dependency package(s) 'callr','pkgbuild','pkgcache','processx','ps' not available.
Run `rlang::last_error()` to see where the error occurred.
In addition: Warning messages:
1: In (function (dep_name, dep_ver = "*")  :
  Dependency package 'callr' not available.
2: In (function (dep_name, dep_ver = "*")  :
  Dependency package 'pkgbuild' not available.
3: In (function (dep_name, dep_ver = "*")  :
  Dependency package 'pkgcache' not available.
4: In (function (dep_name, dep_ver = "*")  :
  Dependency package 'processx' not available.
5: In (function (dep_name, dep_ver = "*")  :
  Dependency package 'ps' not available.

This is R-devel, in case that matters:

R Under development (unstable) (2021-10-17 r81069) -- "Unsuffered Consequences"

Btw. while we are at it, the error message is also misleading. Only "ps" wasn't available, but the other packages all depend on ps. This might not be something that we would want to "fix", though.

Yeah, I guess we should suppressWarnings here then?

res <- mapply(check_dep_version, imports$package, imports$version)

I agree it would be nice to limit it to only the root cause. I guess if we did a topological sort of the packages and then errored on the first one that was not available that would work?

We now prompt the user to install required packages. If they select "no", they are taken back to the prompt without error.