r-lib / remotes

Install R packages from GitHub, GitLab, Bitbucket, git, svn repositories, URLs
https://remotes.r-lib.org/
Other
332 stars 152 forks source link

Force installation of remote dependencies when they provide the required version or point to a specific sha #793

Closed renozao closed 6 months ago

renozao commented 6 months ago

Consider the following DESCRIPTION, of a package stored in GitHub:

Package: packageB
Version: 1.0.0
Imports:
 packageA (>= 2.0)
Remotes:
 org/repo@abcd123

Assume that:

Currently (remotes version 2.5.0), when running the following,

install_github('org/packageB', upgrade = 'never')

then the dependency packageA is not updated despite the fact that the remote org/repo@abcd123 does provide the required package version.

Expected behavior:

If I am not mistaken, this would then be aligned with what install.packages does, when the local version of a dependency does not meet the version requirement.

gaborcsardi commented 6 months ago

Thanks for the suggestion! We are now focusing on https://github.com/r-lib/pak, so this probably won't be implemented here. There is a good chance that pak already does what you need. If not, then please open an issue for pak.

renozao commented 6 months ago

Oh great. Thanks @gaborcsardi for the quick response. I can see a lot of recent activity on pak and it is flagged as "experimental". Would you say it is robust enough already to switch from remotes to pak for setting up production systems?

gaborcsardi commented 6 months ago

Yes, I just changed the experimental badge to stable.

renozao commented 6 months ago

Well, I tried it now on my private package and got an error like this (installed pak from the binary built from Github):

✔ Updated metadata database: 3.05 MB in 8 files.                           
✖ Updating metadata database ... failed                                    
Error:                                                                      
! error in pak subprocess
Caused by error: 
! Could not solve package dependencies:
* <org>/<repo>@<commit>:
  * Can't install dependency memoise (>= 0.31.2) (>= 2.0.1) (>= 1.0.7.1)
  * Can't install dependency R6 (>= 0.31.2) (>= 2.0.1) (>= 1.0.7.1)
  * Can't install dependency Biobase (>= 0.31.2) (>= 2.0.1) (>= 1.0.7.1)
  * Can't install dependency stringr (>= 0.31.2) (>= 2.0.1) (>= 1.0.7.1)
  * Can't install dependency checkmate (>= 0.31.2) (>= 2.0.1) (>= 1.0.7.1)
  * Can't install dependency pkgmaker (>= 0.31.2) (>= 2.0.1) (>= 1.0.7.1)
  * Can't install dependency devtools (>= 2.0.1) (>= 1.0.7.1)
  * Can't install dependency github (>= 1.0.7.1)
  * Can't install dependency plyr (>= 1.0.7.1)
  * Can't install dependency jsonlite (>= 1.0.7.1)
  * Can't install dependency BiocManager (>= 1.0.7.1)
  * Can't install dependency knitr (>= 1.0.7.1)
  * Can't install dependency digest (>= 1.0.7.1)
  * Can't install dependency uuid (>= 1.0.7.1)
  * Can't install dependency reshape2 (>= 1.0.7.1)
  * Can't install dependency qs (>= 1.0.7.1)
  * Can't install dependency withr
* memoise: ! pkgdepends resolution error for .
Caused by error: 
! Invalid line 3 in PACKAGES file: must contain `:` @lib.c:392 (pkgcache_parse_packages_raw)
* R6: ! pkgdepends resolution error for .
Caused by error: 
! Invalid line 3 in PACKAGES file: must contain `:` @lib.c:392 (pkgcache_parse_packages_raw)
* Biobase: ! pkgdepends resolution error for .
Caused by error: 
! Invalid line 3 in PACKAGES file: must contain `:` @lib.c:392 (pkgcache_parse_packages_raw)
...
<list goes on>

There is no such issue when using remotes (except for the problem of the dependency upgrade of course).

gaborcsardi commented 6 months ago

! Invalid line 3 in PACKAGES file: must contain : @lib.c:392 (pkgcache_parse_packages_raw)

So what is your repo? What is in that PACKAGES file?

What do you mean by "installed pak from the binary built from Github"? Like in https://pak.r-lib.org/reference/install.html#pre-built-binaries?

In any case, please open an issue in pak if you think you found a bug.

renozao commented 6 months ago

@gaborcsardi I moved the discussion to an issue in pak. I suppose you'd close this issue as Won't do.