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] [ci] Manually install 'Matrix' (fixes #6433) #6434

Merged
merged 2 commits into from
Apr 30, 2024
Merged

Conversation

jameslamb
Copy link
Collaborator

@jameslamb jameslamb commented Apr 30, 2024

fixes #6433

R 4.4.0 was released 4 days ago. In that same timeframe, the latest version of {Matrix} was released with a floor of Depends: R (>=4.4.0).

As a result, running install.packages("Matrix") on any version of R older than v4.4.0 fails to install {Matrix}. {lightgbm} tries to maintain compatibility with R >= 3.6, so this broke most of this project's CI jobs 🙃

This PR tries to fix it by manually installing {Matrix} from old sources, as recommended in "Writing R Extensions" (see links in #6433).

Notes for Reviewers

Maybe this will be fixed in the future?

I'm not really understanding this discussion on R-devel about it: https://stat.ethz.ch/pipermail/r-devel/2024-April/083383.html.

But there's a suggestion there that maybe in the near future install.packages("Matrix") will select an older version when run on versions of R prior to v4.4.0.

According to this post on r-pkg-devel from 3 weeks ago, this choice of >=4.4.0 for the new {Matrix} was intentional, but the authors expected that R's tooling would hide that version from older R users: https://stat.ethz.ch/pipermail/r-package-devel/2024q2/010640.html.

Matrix 1.7-0 has been on CRAN now for while (i.e. 'March' has remained as announced), but
because of the ABI change and the problem it can cause for some users
we have made it 'Depends: R (>= 4.4.0)'
i.e., you 'see' the new Matrix only once you use R 4.4.0

@jameslamb jameslamb marked this pull request as ready for review April 30, 2024 02:46
Copy link
Collaborator

@borchero borchero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jameslamb jameslamb merged commit cd365e9 into master Apr 30, 2024
38 checks passed
@jameslamb jameslamb deleted the fix/ci branch April 30, 2024 13:02
@sdettle
Copy link

sdettle commented Jun 10, 2024

I don't know if this is the right place to put this, but I was having trouble using R in an anaconda env (only supports r-base 4.3, and reticulate needs matrix. The complete fix was this.

install.packages('lattice')
install.packages('https://cran.r-project.org/src/contrib/Archive/Matrix/Matrix_1.6-5.tar.gz')
install.packages("reticulate")

This is all documented above, but here it is concisely put.

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

Successfully merging this pull request may close these issues.

[R-package] latest {Matrix} requires R>=4.4.0
3 participants