Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change option repos cause lockfile_create to hang forever #677

Open
lz100 opened this issue Aug 15, 2024 · 3 comments
Open

Change option repos cause lockfile_create to hang forever #677

lz100 opened this issue Aug 15, 2024 · 3 comments
Labels
reprex needs a minimal reproducible example

Comments

@lz100
Copy link

lz100 commented Aug 15, 2024

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]
@gaborcsardi
Copy link
Member

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

@gaborcsardi gaborcsardi added the reprex needs a minimal reproducible example label Aug 17, 2024
@lz100
Copy link
Author

lz100 commented Aug 20, 2024

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

@gaborcsardi
Copy link
Member

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reprex needs a minimal reproducible example
Projects
None yet
Development

No branches or pull requests

2 participants