r-lib / pak

A fresh approach to package installation
https://pak.r-lib.org
671 stars 60 forks source link

error in `pkgplan_solve(self, private, match.arg(policy))` for base packages #597

Closed B0ydT closed 3 months ago

B0ydT commented 7 months ago

Hi,

I'm preparing a PR for another package, swapping from pkg_system_requirements to pkg_syqsreq (https://github.com/ThinkR-open/dockerfiler/issues/68). I'm running into issues with base R packages, like stats and utils, as shown here:

> pak::pkg_sysreqs(pkg = "stats", sysreqs_platform = "centos-7")
✔ Updated metadata database: 5.16 MB in 6 files.                          
✔ Updating metadata database ... done                                     
Error:                                                                     
! error in pak subprocess
Caused by error in `pkgplan_solve(self, private, match.arg(policy))`:
! Error in dependency solver, cannot solve installation.
ℹ Solver status: -1.
ℹ This is an internal error in pkgdepends, please report an issue at <https://github.com/r-lib/pkgdepends/issues>.

I have searched the issues list and can't spot any similar issues. I've also tried multiple platforms and running the code on different computers with the same outcome.

I haven't used pak directly very much, so any insight into the problem and whether I can fix it on my end would be much appreciated 😊

gaborcsardi commented 7 months ago

This is essentially this bug:

❯ pak::pkg_sysreqs(pkg = character(), sysreqs_platform = "centos-7")
Error:
! error in pak subprocess
Caused by error in `pkgplan_solve(self, private, match.arg(policy))`:
! Error in dependency solver, cannot solve installation.
ℹ Solver status: -1.
ℹ This is an internal error in pkgdepends, please report an issue at
  <https://github.com/r-lib/pkgdepends/issues>.
Type .Last.error to see the more details.

Base packages cannot be (re)installed and they do not have system requirements. As a workaround, you can drop base packages from your query and then handle empty queries specially.

B0ydT commented 7 months ago

Thanks, that makes total sense. I must have misread something because I was sure the old function produced system requirements, but of course it doesn't.