r-lib / pak

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

pak fails to update curl on Debian-based systems #691

Closed Robinlovelace closed 1 hour ago

Robinlovelace commented 2 hours ago

We're working on a container that contained the following:

pak::pkg_install("geocompx/geocompkg", dependencies = TRUE)

For some reason, it failed to install curl, as shown here and in subsequent error message: https://github.com/geocompx/docker/actions/runs/10944692306/job/30387186965#step:8:233

#11 9.439 + curl              5.2.1  > 5.2.2       [bld][cmp][dl] (716.70 kB) + x libcurl4-openssl-dev, x libssl-dev
...
 #11 159.8 --------------------------- [ANTICONF] --------------------------------
#11 159.8 Configuration failed because libcurl was not found. Try installing:
#11 159.8  * deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)

Wondering if it's something to do with the fact we're using pixi to install R here, but thought these unexpected error messages may be of use.

More confusing is that, as far as I can tell, the error persists after asking pak not to upgrade anything:

pak::pkg_install("geocompx/geocompkg", dependencies = TRUE, upgrade = FALSE)

I get the same error message after that.

Robinlovelace commented 2 hours ago

As shown here, pak still tries to upgrade the package even with the upgrade arg set to FALSE: https://github.com/geocompx/docker/actions/runs/10953278326/job/30413287861#step:8:368

Robinlovelace commented 1 hour ago

After switching from exactly the same command with remotes it worked so this looks like a bug to me:

remotes::install_github("geocompx/geocompkg", dependencies = TRUE, upgrade = FALSE)

See https://github.com/geocompx/docker/commit/d79080f0a43d3bd6cbdad8130b5a18cb8e208973#diff-1c8aec6e5624030890094bb61ae09a11a1fa1d3bfa85e6313d1d79aa11742468R13

gaborcsardi commented 1 hour ago

This is not a bug in pak, but an interaction with conda. If you are building non-conda R packages with an active conda, the build can fail. Even loading them can fail. Deactivate conda while you are using non-conda R, especially when you are installing packages.

As shown here, pak still tries to upgrade the package even with the upgrade arg set to FALSE:

Because httr2 requires a newer version of curl.

After switching from exactly the same command with remotes it worked so this looks like a bug to me:

Probably because remotes is not very smart, so just ignores the versioned requirements.

Robinlovelace commented 1 hour ago

Because httr2 requires a newer version of curl.

Ah OK makes sense now.