r-lib / pkgdepends

R Package Dependency Resolution
https://r-lib.github.io/pkgdepends/
Other
102 stars 30 forks source link

repeated versions in solution failure print #302

Open pawelru opened 1 year ago

pawelru commented 1 year ago

minimal reprex:

x <- pkgdepends::new_pkg_installation_proposal(c("cran/cli@1.0.0", "cran/lifecycle@0.1.0", "cran/magrittr@1.0.0", "cran/rlang@0.1", "cran/styler@1.0.0"), config = list(library = tempfile()))
x
x$solve()
x$get_solution()

outcome:

r$> x$get_solution()
<pkg_solution>
+ result: FAILED
(...)
x failures:
* cran/lifecycle@0.1.0: Can't install dependency rlang (>= 0.4.0)
* rlang: Conflicts with cran/rlang@0.1
* cran/styler@1.0.0:
  * Can't install dependency purrr
  * Can't install dependency tibble
* purrr:
  * Can't install dependency cli (>= 3.4.0) (>= 1.0.3) (>= 1.5.0) (>= 0.4.10)
  * Can't install dependency lifecycle (>= 1.0.3) (>= 1.5.0) (>= 0.4.10)
  * Can't install dependency magrittr (>= 1.5.0) (>= 0.4.10)
  * Can't install dependency rlang (>= 0.4.10)
* cli: Conflicts with cran/cli@1.0.0
* lifecycle: Conflicts with cran/lifecycle@0.1.0
* magrittr: Conflicts with cran/magrittr@1.0.0
* tibble:
  * Can't install dependency lifecycle (>= 1.0.0) (>= 1.0.2)
  * Can't install dependency rlang (>= 1.0.2)

Please have a look at the report for purr. For the very first child rows it lists all the versions (i.e. cli (>= 3.4.0) (>= 1.0.3) (>= 1.5.0) (>= 0.4.10) whereas it should be cli (>= 3.4.0) only.

gaborcsardi commented 1 year ago

For the record, that happens because different packages have different version requirements. We could "collapse" them into a single one, it is not entirely straightforward, though.