Closed schloerke closed 9 months ago
Did you try specifying the older package with a URL? E.g.
url::https://cloud.r-project.org/src/contrib/Archive/cli/cli_1.0.0.tar.gz
Workflow run: https://github.com/rstudio/shinycoreci/runs/6474734756?check_suite_focus=true
It looks like it's set up to work, but is failing due to digest
not being available:
Run r-lib/actions/setup-r-dependencies@v2
Run ## Installing pak
Installing pak
Dependency resolution
ℹ Creating lockfile '.github/pkg.lock'
✖ Creating lockfile '.github/pkg.lock' [414ms]
Error: Error: <callr_remote_error: there is no package called ‘digest’>
in process 8314
-->
<simpleError in loadNamespace(name): there is no package called ‘digest’>
Stack trace:
12. (function (...) ...
13. base:::withCallingHandlers(cli_message = function(msg) { ...
14. get("lockfile_create_internal", asNamespace("pak"))(...)
15. pkgdepends::new_pkg_installation_proposal(pkg, config = list(library = lib, ...
16. pkg_installation_proposal$new(refs, config = config, ...)
17. pkgdepends:::initialize(...)
[18](https://github.com/rstudio/shinycoreci/runs/6474734756?check_suite_focus=true#step:5:18). pkg_plan$new(refs, config = config, library = config$library, ...
19. pkgdepends:::initialize(...)
20. pkgdepends:::pkgplan_init(self, private, refs, config, library, ...
21. pkgdepends:::parse_pkg_refs(refs)
22. pkgdepends:::parser(this_refs, ...)
23. pkgdepends:::vcapply(specs, function(x) digest::digest(x))
24. base:::vapply(X, FUN, FUN.VALUE = character(1), ...)
25. pkgdepends:::FUN(X[[i]], ...)
26. base:::`::`(digest, digest)
27. base:::getExportedValue(pkg, name)
28. base:::asNamespace(ns)
29. base:::getNamespace(ns)
30. base:::tryCatch(loadNamespace(name), error = function(e) stop(e))
31. base:::tryCatchList(expr, classes, parentenv, handlers)
32. base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
33. value[[3L]](cond)
34. base:::stop(e)
35. (function (e) ...
36. base:::stop(e)
37. (function (e) ...
x there is no package called ‘digest’
Execution halted
Error: Process completed with exit code 1.
I can see {digest}
is being used within {pkgdeps}
and is Suggests-ed.
Sorry, what I meant was a URL to the proper rjson version, that cli url was an example from the docs.
Also, https://github.com/rstudio/shinycoreci/actions/runs/2340008025/workflow#L21-L22
packages:
- "any::highcharter, any::radiant, any::sessioninfo"
- "any::highcharter, url::https://cloud.r-project.org/src/contrib/Archive/cli/cli_1.0.0.tar.gz, any::radiant, any::sessioninfo"
is somewhat suspicious to me, I am not sure it that format works. I would think that you'll need one package per line, or a single comma separated package list in string.
This works for me on R 3.6:
> pak::pkg_install("highcharter")
Error: Cannot install packages:
* highcharter: Can't install dependency rjson
* rjson: Needs R >= 4.0.0
Type .Last.error.trace to see where the error occurred
> pak::pkg_install(c("highcharter", "url::https://cran.r-project.org/src/contrib/Archive/rjson/rjson_0.2.20.tar.gz"))
→ Will install 36 packages.
→ Will update 1 package.
...
Suspicious, but valid GHA step code. (You are correct in that is not valid R code.)
The ${{ matrix.packages }}
value is being placed directly in the r-lib/actions/setup-r-dependencies
's packages
field (link):
r-lib/actions/setup-r-dependencies@v2
with:
packages: any::highcharter, url::https://cloud.r-project.org/src/contrib/Archive/cli/cli_1.0.0.tar.gz, any::radiant, any::sessioninfo
extra-packages: any::rcmdcheck
cache-version: 11
cache: true
pak-version: stable
working-directory: .
dependencies: "all"
Cleaner example of digest
not being found when trying to install cli
from url: https://github.com/rstudio/shinycoreci/runs/6496066259?check_suite_focus=true#step:5:71
^^ Workflow file: https://github.com/rstudio/shinycoreci/actions/runs/2347835298/workflow#L38
Sorry, the links are dead now. :( Do you still have this issue?
Workflow run: https://github.com/rstudio/shinycoreci/actions/runs/8071246523/job/22050463917
Error:
Error:
! error in pak subprocess
Caused by error:
! Could not solve package dependencies:
* any::sessioninfo: Can't install dependency cli (>= 3.1.0)
* cli: Conflicts with url::https://cran.r-project.org/src/contrib/Archive/cli/cli_3.1.0.tar.gz
* url::https://cran.r-project.org/src/contrib/Archive/cli/cli_3.1.0.tar.gz:
* Can't install dependency glue
* Can't install dependency testthat
* glue: Needs R >= 3.6
* testthat: Needs R >= 3.6.0
Problem:
cli@3.1.0
. cli@3.1.0
require {glue}
and {testthat}
{glue}
and {testthat}
require R >= 3.6.Goal:
{glue}
and {testthat}
) when the latest versions can not be installed?I know I used a url for {cli}
, but it was to have a stable talking point. In reality, packages update their minimum R version all the time and I'd like to not have to play whack-a-mole as new package installation issues are created.
Both {glue}
and {testthat}
do not have minimum versions within {cli}
. It would be great if an installable version of both packages could automatically be found.
(It can easily be that the answer is "no", as R only works with the latest versions of packages. But it would dramatically make my life easier to not play package version whack-a-mole.)
This is unfortunately not possible in practice, for two reasons. First, there is no easily accessible metadata that contains all versions of all packages. Second, even if we had this data, it would be a very challenging (and NP-complete) integer programming problem to find a set of packages that can be installed together.
In general, the choices you have is
So, for your specific problem, if you really want to do this, you'll also need to pin the versions of glue and testthat. I expect the old glue version to work well in this case, but testthat has many dependencies, and having an old testthat with new dependencies is not tested at all, and I expect you to run into problems, and you'll probably need to pin more package versions.
Btw. you can also a PPM snapshot to install old packages, as far as pak is concerned that is just option 1, with a custom repository.
Thank you @gaborcsardi for the suggestions!
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue and include a link to this issue
Describe the bug
I'd like to install
{highcharter}
onubuntu
R v3.6.{highcharter}
depends on{rjson}
whose latest version depends on R >= v4.0. When I install dependencies,r-lib/actions/setup-r-dependencies
fails to install an appropriate version.Even if I manually install a valid version of
{rjson}
before,r-lib/actions/setup-r-dependencies
will try to install the latest version.(I understand this may be a
{pkgdepends}
bug/feature, but I also didn't see any API to change within r-lib/actions.)To Reproduce
Workflow (Link)
``` # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: branches: [shinyverse_remotes] # pull_request: # branches: [main, master] name: Install Debug jobs: debug: runs-on: ${{ matrix.config.os }} name: ${{ matrix.config.os }} (${{ matrix.config.r }} - ${{ matrix.prep-install }}) strategy: fail-fast: false matrix: packages: - "any::highcharter, any::radiant, any::sessioninfo" # - "highcharter, radiant, sessioninfo" prep-install: - true - false config: - {os: macOS-latest, r: '3.5'} - {os: windows-latest, r: '3.5'} - {os: ubuntu-latest, r: '3.5'} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} R_KEEP_PKG_SOURCE: yes steps: - uses: actions/checkout@v2 - uses: r-lib/actions/setup-pandoc@v2 - uses: r-lib/actions/setup-r@v2 with: r-version: ${{ matrix.config.r }} use-public-rspm: true - name: Install rjson if: matrix.prep-install shell: Rscript {0} run: | install.packages("remotes") remotes::install_version("rjson", "0.2.20") remotes::install_version("radiant", "1.3.2") - uses: r-lib/actions/setup-r-dependencies@v2 with: packages: ${{ matrix.packages }} extra-packages: any::rcmdcheck cache-version: "10" ```Related error message (Link to full logs):
Expected behavior
I'd love to be able to have
pkgdepends
install the newest valid version of the package.I'd at least like for
r-lib/actions/setup-r-dependencies
to not try to update a currently installed package.Additional context
Also happens for
{radiant}
on R v3.5 (and prolly many other packages), but it is the same situation.Mac and windows R v3.5 get around the issue by installing the latest binary version which is does not have an invalid dependency on the R version. However, ubuntu likes to install from source, which is always the latest version of the package.
cc @MadhulikaTanuboddi