r-lib / pak

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

Can't find package called xxx #585

Closed ShixiangWang closed 5 months ago

ShixiangWang commented 5 months ago

I am using GitHub action (https://github.com/ShixiangWang/gcap/actions/runs/7623051734/job/20762294496) which set up r deps with pak, but it seems cannot parse package required for installation, could you take a look?

Dependency resolution
  ℹ Creating lockfile '.github/pkg.lock'

  ✔ Updated metadata database: 6.07 MB in 10 files.

  ℹ Creating lockfile '.github/pkg.lock'
  ℹ Updating metadata database
  ✔ Updating metadata database ... done

  ℹ Creating lockfile '.github/pkg.lock'
  ✖ Creating lockfile '.github/pkg.lock' [10.7s]

  Error: 
  ! error in pak subprocess
  Caused by error: 
  ! Could not solve package dependencies:
  * deps::.: Can't install dependency ASCAT (>= 3.0.0)
  * ASCAT: Can't find package called ASCAT.
  * local::.: Can't install dependency ASCAT (>= 3.0.0)
  * any::sessioninfo: dependency conflict
  * any::pkgdown: dependency conflict
  ---
  Backtrace:
  1. pak::lockfile_create(c(deps, extra_deps), lockfile = ".github/pkg.lock", …
  2. pak:::remote(function(...) { …
  3. err$throw(res$error)
  ---
  Subprocess backtrace:
  1. base::withCallingHandlers(cli_message = function(msg) { …
  2. get("lockfile_create_internal", asNamespace("pak"))(...)
  3. prop$stop_for_solution_error()
  4. private$plan$stop_for_solve_error()
  5. pkgdepends:::pkgplan_stop_for_solve_error(self, private)
  6. base::throw(new_error("Could not solve package dependencies:\n", msg, …
  7. | base::signalCondition(cond)
  8. global (function (e) …
  Execution halted
  Error: Process completed with exit code 1.

https://github.com/ShixiangWang/gcap/blob/16611290e7796caaaa1804ac4ca2abedf3eb2be7/DESCRIPTION#L46-L51

gaborcsardi commented 5 months ago

If the package name is different from the repository name, you'll need to specify it explicitly, see https://pak.r-lib.org/reference/pak_package_sources.html#package-names

ASCAT=github::ShixiangWang/ascat/ASCAT@v3-for-gcap-v1
ShixiangWang commented 5 months ago

Thank you :)