pkgdepends icon indicating copy to clipboard operation
pkgdepends copied to clipboard

Solver fails with Config/Needs/... indirect dependency configuration

Open pawelru opened this issue 7 months ago • 2 comments

library(pkgdepends)

deps_1 <- c("config/needs/foo", pkg_dep_types_hard())
deps_2 <- list(
    direct = c("config/needs/foo", pkg_dep_types_hard()),
    indirect = pkg_dep_types()
)
deps_3 <- list(
    direct = c("config/needs/foo", pkg_dep_types_hard()),
    indirect = c("config/needs/bar", pkg_dep_types()) # <- here!
)

foo <- function(deps) {
    ip <- new_pkg_installation_proposal("r-lib/rlang", config = list(dependencies = deps))
    ip$solve()
    ip$get_solution()
}

foo(deps_1) # OK
#> ℹ Loading metadata database
#> ✔ Loading metadata database ... done
#> 
#> <pkg_solution>
#> + result: OK
#> + refs:
#>   - r-lib/rlang
#> + constraints (2):
#>   - select rlang exactly once
#>   - `r-lib/rlang` is not satisfied by `installed::/Users/ruckip/Library/R/arm64/4.3/library/rlang`
#> + solution:
#>   - r-lib/rlang
foo(deps_2) # OK
#> <pkg_solution>
#> + result: OK
#> + refs:
#>   - r-lib/rlang
#> + constraints (27915):
#>   - `rnaturalearthhires` resolution failed
#>   - `starsdata` resolution failed
#>   - `cmdstanr` resolution failed
#>   - `glmmADMB` resolution failed
#>   - `ffbase` resolution failed
#>   - `spDataLarge` resolution failed
#>   - `mnlogit` resolution failed
#>   - `Zelig` resolution failed
#>   - `ergm.userterms` resolution failed
#>   - `corpus.useR.2008.abstracts` resolution failed
#>   ...
#> + solution:
#>   - r-lib/rlang
foo(deps_3) # FAIL
#> Error in value$ref %in% private$state$ref && !value$direct: 'length = 18' in coercion to 'logical(1)'

Created on 2024-01-04 with reprex v2.0.2

pawelru avatar Jan 04 '24 16:01 pawelru