r-lib / pak

A fresh approach to package installation
https://pak.r-lib.org
643 stars 56 forks source link

BUG: pak wants to upgrade a package contrary to what the default setting of what `upgrade` says #533

Closed gdevenyi closed 10 months ago

gdevenyi commented 10 months ago

Trying to install this package: https://github.com/kdzimm/hierarchicell/blob/master/DESCRIPTION

pak::pkg_install("kdzimm/hierarchicell")
! Using bundled GitHub PAT. Please add your own PAT using `gitcreds::gitcreds_set()`.
✔ Loading metadata database ... done                             

→ Will install 1 package.
→ Will update 1 package.
→ All 2 packages (714.17 kB) are cached.
+ curl          4.3.3 → 5.0.2 [bld][cmp] + ✔ libcurl4-openssl-dev, ✔ libssl-dev
+ hierarchicell         1.0.0 [bld][cmp] (GitHub: 183ef08)
→ Will install 3 system packages:
+ libglpk-dev  - igraph          
+ libgmp3-dev  - igraph          
+ pandoc       - knitr, rmarkdown

I don't expect curl to be upgraded, as no explicit version is mentioned in DESCRIPTION of the other package, and the default for pkg_install is upgrade=FALSE

gdevenyi commented 10 months ago

pak documentation says:

Usage:

     pkg_install(
       pkg,
       lib = .libPaths()[[1L]],
       upgrade = FALSE,
       ask = interactive(),
       dependencies = NA
     )

 upgrade: When ‘FALSE’, the default, pak does the minimum amount of
          work to give you the latest version(s) of ‘pkg’. It will only
          upgrade dependent packages if ‘pkg’, or one of their
          dependencies explicitly require a higher version than what
          you currently have. It will also prefer a binary package over
          to source package, even it the binary package is older.

          When ‘upgrade = TRUE’, pak will ensure that you have the
          latest version(s) of ‘pkg’ and all their dependencies.
gaborcsardi commented 10 months ago
hierarchicell -> Seurat -> httr -> curl

and the latest version of httr requires a curl update:

Imports: curl (>= 5.0.2), jsonlite, mime, openssl (>= 0.8), R6
gdevenyi commented 10 months ago

How can this be the case when Seurat is already installed and not being upgraded?

gaborcsardi commented 10 months ago

It is through some other dependency path then, maybe plotly needs newer httr, which needs newer curl:

❯ pak::pkg_deps_explain("kdzimm/hierarchicell", "curl")
hierarchicell -> Seurat -> httr -> curl
hierarchicell -> Seurat -> plotly -> httr -> curl
hierarchicell -> sva -> genefilter -> AnnotationDbi -> KEGGREST -> httr
  -> curl
hierarchicell -> sva -> genefilter -> annotate -> AnnotationDbi ->
  KEGGREST -> httr -> curl
hierarchicell -> sva -> genefilter -> annotate -> httr -> curl

It is also possible, that while the dependencies are installed, they are broken and do not satisfy their version requirements.

In any case, I can't see your system, so this is guessing game for me, unless you show me the package versions of the whole dependency tree of the package you are installing.