pak
pak copied to clipboard
Change option `repos` cause `lockfile_create` to hang forever
If one changes the repos option before running lockfile_create, R hangs forever without any message.
options(repos = c(PPM = "https://packagemanager.posit.co/cran/latest"))
pak::lockfile_create()
#✔ Loading metadata database ... done
# ℹ Creating lockfile pkg.lock
Even if I include the CRAN option inside, the result is the same.
options(repos = c(
CRAN = "https://cloud.r-project.org",
PPM = "https://packagemanager.posit.co/cran/latest"
))
pak::lockfile_create()
It only works with one single CRAN option
options(repos = c(
CRAN = "https://cran.rstudio.com"
))
pak::lockfile_create()
# ✔ Loading metadata database ... done
# ✔ Created lockfile pkg.lock [3s]
That's not what I see. Can you try to create a reproducible example?
❯ options(repos = c(
+ CRAN = "https://cloud.r-project.org",
+ PPM = "https://packagemanager.posit.co/cran/latest"
+ ))
❯ system.time(pak::lockfile_create())
✔ Created lockfile pkg.lock [46ms]
user system elapsed
0.030 0.002 0.138
Please see this reproducible example: https://github.com/lz100/pak_issue/actions/runs/10462815978/job/28973744653
install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/stable/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))
options(repos = c(
CRAN = "https://cloud.r-project.org",
PPM = "https://packagemanager.posit.co/cran/latest"
))
pak::lockfile_create()
and the repo associated with the workflow
Yes, https://packagemanager.posit.co/cran/latestis essentially the same repository as https://cloud.r-project.org/ for Linux, they contain the same exact source packages. The dependency solver cannot deal with this, as any combination of the dependencies from the two repos are exactly as good. This is a known issue in pak, and hopefully we'll solve it soon.
The current workaround is not using (essentially) the same repo twice. E.g. if you want to use the binaries from PPM, use the https://packagemanager.posit.co/cran/linux/jammy/latest URL (for Ubuntu Jammy).