Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[R-package] latest {Matrix} requires R>=4.4.0 #6433

Closed
jameslamb opened this issue Apr 30, 2024 · 0 comments · Fixed by #6434
Closed

[R-package] latest {Matrix} requires R>=4.4.0 #6433

jameslamb opened this issue Apr 30, 2024 · 0 comments · Fixed by #6434

Comments

@jameslamb
Copy link
Collaborator

jameslamb commented Apr 30, 2024

Description

{Matrix} v1.7-0 went up on CRAN 3 days ago. It has this in its DESCRIPTION.

Depends: R (>= 4.4.0)

https://cran.r-project.org/web/packages/Matrix/index.html

That is the latest release of R, released just 5 days ago (release notes)

As a result, trying to install and load {lightgbm} in an R 4.3.3 environment raises a warning.

remove.packages(c("lightgbm", "Matrix"))
install.packages("lightgbm", repos = "https://cran.r-project.org")
# Warning: dependency ‘Matrix’ is not available

And trying to load it fails.

library(lightgbm)
# Error: package or namespace load failed for ‘lightgbm’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
# there is no package called ‘Matrix’

This is breaking this project's CI, and will make install.packages("lightgbm") no longer work on older R versions without some manual work to install {Matrix}.

Reproducible example

See any of LightGBM's recent R-package CI jobs or the code snippets I supplied above.

In R 4.3 CI jobs:

Warning message:
package ‘Matrix’ is not available for this version of R
‘Matrix’ version 1.7-0 is in the repositories but depends on R (>= 4.4.0)
‘Matrix’ version 1.7-0 is in the repositories but depends on R (>= 4.5)

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages 

In R 3.6 CI jobs:

Warning message:
package ‘Matrix’ is not available (for R version 3.6.3) 
* checking for file ‘/__w/LightGBM/LightGBM/lightgbm_r/DESCRIPTION’ ... OK
* preparing ‘lightgbm’:
* checking DESCRIPTION meta-information ... OK
* cleaning src
* installing the package to build vignettes
      -----------------------------------
ERROR: dependency ‘Matrix’ is not available for package ‘lightgbm’

Environment info

Latest LightGBM, R <4.4.0.

Additional Comments

From "Installing Packages" in "Writing R Extenstions" (link)

*Something which sometimes puzzles users is that install.packages() may report that a package which they believe should be available is not found. Some possible reasons:
...

  • The package is available, but not for the current version of R or for the type of OS (Unix/Windows).

If the package depends on a version of R later than the one in use, it is possible that an earlier version is available which will work with your version of R: for CRAN look for ‘Old sources’ on the package’s CRAN landing page and manually retrieve an appropriate version (of comparable age to your version of R).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant