Skip to content

pkgdepends (and pak) fail when GitHub packages depend on each other and different versions are requested #471

Description

@vandenman

I noticed that pkgdepends fails to resolve multiple github packages that depend on each other:
A reprex:

on d59d4ee I get:

obj <- pkgdepends::new_pkg_deps(c(
  pkgdepends = "r-lib/pkgdepends@d59d4ee3b702d3ff2a38450ace2ae3050d17fc35",
  pkgcache   = "r-lib/pkgcache@93010c2f496705395f70c284c8925fe72bc092f3"
))

sol <- obj$solve()$get_solution()
print(sol)

gives output:

<pkg_solution>
+ result: FAILED
+ refs:
  - r-lib/pkgcache@93010c2f496705395f70c284c8925fe72bc092f3
  - r-lib/pkgdepends@d59d4ee3b702d3ff2a38450ace2ae3050d17fc35
+ constraints (62):
  - select pkgdepends exactly once
  - select pkgcache exactly once
  - select callr at most once
  - select cli at most once
  - select curl at most once
  - select desc at most once
  - select filelock at most once
  - select jsonlite at most once
  - select lpSolve at most once
  - select otel at most once
  ...
x failures:
* r-lib/pkgdepends@d59d4ee3b702d3ff2a38450ace2ae3050d17fc35: Can't install dependency r-lib/pkgcache@feature/ppm-sso (>= 2.2.0)
* r-lib/pkgcache@feature/ppm-sso: Conflicts with r-lib/pkgcache@93010c2f496705395f70c284c8925fe72bc092f3

there appears to be a conflict with the remote from the DESCRIPTION r-lib/pkgcache@feature/ppm-sso and the explicitly requested r-lib/pkgcache@93010c2f496705395f70c284c8925fe72bc092f3. This also happens when there are no branches listed, e.g., Remotes: r-lib/pkgcache would have also errored.

Originally observed when using renv to restore a lockfile using pak on CI, which failed to resolve the dependencies. This behavior appears to be in pkgdepends already since v0.8.0 (or earlier, I didn't test that far back). Perhaps this is intended, but it does complicate reproducibility. Note that the error did not surface with pak 0.9.5, only since 0.10.0. Still, this felt like the right place for the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions