pak
pak copied to clipboard
Extra dependencies fields in DESCRIPTION using Config/Needs does not work
This is on Windows 10 and R 4.0.4 with last version of pak dev
> pak::pak_update()
Current version is the latest, no need to update.
I added this field a a DESCRIPTION
Config/Needs/website: r-lib/pkgdown,rstudio/webshot2
With remotes the extra dependencies are correctly found using
remotes::dev_package_deps(dependencies = c("hard", "Config/Needs/website"))
With pak, I got an error:
> pak::pkg_deps(".", dependencies = c("hard", "Config/Needs/website"))
Error: cannot coerce type 'builtin' to vector of type 'any'
Type .Last.error.trace to see where the error occured
Run `rlang::last_error()` to see where the error occurred.
> .Last.error.trace
Stack trace:
12. (function (...) ...
13. base:::withCallingHandlers(cli_message = function(msg) { ...
14. get("pkg_deps_internal", asNamespace("pak"))(...)
15. pak:::pkg_deps_internal2(pkg, upgrade, dependencies)
16. deps$solve()
17. private$plan$solve(policy = private$policy)
18. pkgdepends:::pkgplan_solve(self, private, match.arg(policy))
19. self$resolve()
20. pkgdepends:::pkgplan_resolve(self, private)
21. pkgdepends:::synchronise(self$async_resolve())
22. asNamespace("pkgcache")$synchronise(...)
23. self$async_resolve()
24. pkgdepends:::pkgplan_async_resolve(self, private)
25. pkgdepends:::new_resolution(config = private$config, cache = private$cache, ...
26. resolution$new(config, cache, library, remote_types)
27. pkgdepends:::initialize(...)
28. pkgdepends:::res_init(self, private, config, cache, library, ...
29. pkgdepends:::as_pkg_dependencies(config$dependencies)
30. base:::lapply(res, function(x) { ...
31. pkgdepends:::FUN(X[[i]], ...)
32. base:::unique(hard, setdiff(c, "hard"))
33. base:::unique.default(hard, setdiff(c, "hard"))
34. base:::setdiff(c, "hard")
35. base:::as.vector(x)
36. base:::.handleSimpleError(function (e) ...
37. h(simpleError(msg, call))
38. base:::stop(e)
39. (function (e) ...
x cannot coerce type 'builtin' to vector of type 'any'
Yeah definitely true, we have not ported that remotes feature over to pak as of yet.
pkgdepends supports it from the doc. Seems to be just a bug - Thanks @gaborcsardi !
Oh, didn't know that @gaborcsardi had already added support for it 👍
@cderv I built a new binary for R 4.0.x Windows, you can try pak::pak_update()
. I haven't actually tested it much, so I might need to reopen this...
I confirm it works with this fix. No error and extra dependencies are correctly found!
Oh, that's great, because it did not work for the thing I tried. :) Let me write some tests for this...