You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pak::pkg_install() does not download manylinux binaries from P3M #883
In our multi-stage Docker builds, we require a binary-only installation where packages are exclusively pulled from a manylinux URL.
Standard install.packages() works perfectly and downloads the pre-compiled binaries. However, pak::pkg_install() treats the repository strictly as a source repository, forcing full local compilations.
pak::meta_list()[["sources"]] reveals that pak appends /src/contrib/ to the manylinux path instead of parsing it as a binary layout:
This classification failure could be a regression/side effect of the broader regular expression changes introduced in v0.9.5 (#863). The internal URL classification patterns (such as pkgcache:::is_ppm_linux_repo_url()) do not recognize the manylinux_2_28 distribution string as a valid PPM binary architecture tag, causing pak to fall back to a source mapping strategy.
Steps to Reproduce
options(
repos= c(
P3M_MANYLINUX="https://packagemanager.posit.co/cran/__linux__/manylinux_2_28/2026-06-01"
)
)
# Under the hood, this resolves to /src/contrib/ and triggers a source build:pak::meta_list("data.table")[["sources"]]
# Fails to pull pre-compiled binary:pak::pkg_install("data.table")
I did some further digging and found that pkgcache:::is_ppm_linux_repo_url() does not recognize manylinux_2_28 as a valid distro token on my machine (I have Ubuntu 26.04. resolute):
While testing the manylinux_2_28 regex fix, I found that after upgrading pak I still got platform = "source" for packages from a __linux__/manylinux_2_28/... repo.
pkgcache's metadata cache (~/.cache/R/pkgcache/_metadata) was written before the regex fix, when bin_url was NA for this repo. That gets reused, so PACKAGES2.gz (the binary listing) never gets fetched and the package stays flagged as "source".
I tried pkgcache::meta_cache_cleanup(force = TRUE) to force a refresh, but it throws a warning ("expanded path length ... would be too long") and doesn't actually clean the replica cache. The bug is in cmc_cleanup():
get_cache_files("replica") returns a list (root, meta, lock, rds, pkgs data frame, ...), not a path — so unlink() gets handed the whole structure coerced into one giant string.
Activity
gaborcsardi commentedon Jun 2, 2026
What is the correct URL then? AFAICT
install.packages()downloads the same URL:AdaemmerP commentedon Jun 2, 2026
Mmm... That is true. However, it seems
install.packages()downloads the file:... whereas
pak(says it) is building it ([bld][cmp]). This is also happening in our Docker image:AdaemmerP commentedon Jun 2, 2026
... Another example for
sf.pakbuilds it from source and needs almost 7 minutes:...
install.packages()simply downloads the binary in some seconds:AdaemmerP commentedon Jun 3, 2026
I did some further digging and found that
pkgcache:::is_ppm_linux_repo_url()does not recognizemanylinux_2_28as a valid distro token on my machine (I have Ubuntu 26.04. resolute):Would changing
[a-zA-Z0-9]+to[a-zA-Z0-9_]+inre_ppm_linux()fix this? At least on my end this seems to work:gaborcsardi commentedon Jun 11, 2026
Should be fixed in dev pak, if you install from source, or wait for tomorrow's nightly builds [1].
[1] https://pak.r-lib.org/reference/install.html#nightly-builds
AdaemmerP commentedon Jun 11, 2026
Great, thanks!
AdaemmerP commentedon Jun 12, 2026
While testing the
manylinux_2_28regex fix, I found that after upgrading pak I still gotplatform = "source"for packages from a__linux__/manylinux_2_28/...repo.pkgcache's metadata cache (
~/.cache/R/pkgcache/_metadata) was written before the regex fix, whenbin_urlwasNAfor this repo. That gets reused, soPACKAGES2.gz(the binary listing) never gets fetched and the package stays flagged as"source".I tried
pkgcache::meta_cache_cleanup(force = TRUE)to force a refresh, but it throws a warning ("expanded path length ... would be too long") and doesn't actually clean the replica cache. The bug is incmc_cleanup():get_cache_files("replica")returns a list (root,meta,lock,rds,pkgsdata frame, ...), not a path — sounlink()gets handed the whole structure coerced into one giant string.Fix: add
$meta:Now,
data.tablefrom amanylinux_2_28PPM repo correctly resolves toplatform = x86_64-pc-linux-gnu-ubuntu-26.04(binary) instead of"source".Do you agree with the problem and fix? Shall I open a PR for the
meta_cache_cleanup()?gaborcsardi commentedon Aug 3, 2026
Sorry for the wait, I think the cache deletion issue is fixed in pkgcache and also in pak.