r-lib / pak

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

Cryptic error in gh actions when lockfile creation failed (caused by malformed DESCRIPTION) #632

Closed olivroy closed 1 month ago

olivroy commented 1 month ago

I don't really know how this happened.

I get the same locally with pak::lockfile_create()...

My imports are

Imports:
    bigD,
    commonmark
    readr,
    dplyr,
    gt,
    janitor,
    lubridate,
    parsedate,
    pkgload,
    plotly,
    quarto,
    rlang (>= 1.1.0),
    rvest,
    stringr,
    tidyr,
    usethis,
    yaml

in DESCRIPTION

  ✖ Creating lockfile '.github/pkg.lock' [759ms]

  Error: 
  ! error in pak subprocess
  Caused by error in `if (any(bad <- types == "")) { …`:
  ! missing value where TRUE/FALSE needed
  ---
  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$solve()
   4. private$plan$solve(policy = private$policy)
   5. pkgdepends:::pkgplan_solve(self, private, match.arg(policy))
   6. self$resolve()
   7. pkgdepends:::pkgplan_resolve(self, private)
   8. pkgdepends:::synchronise(self$async_resolve())
   9. asNamespace("pkgcache")$synchronise(...)
  10. base::stop(priv$value)
  11. global (function (e) …
  Execution halted
gaborcsardi commented 1 month ago

A comma is missing after commonmark.

olivroy commented 1 month ago

Ooops, thanks! Should have known..

Could pak validate the DESCRIPTION ? AFAICT, this is not really implemented anywhere. desc::desc_validate() is not implemented. and I ran usethis::use_tidy_description(), but it didn't let me know either.