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

[ci] upgrade to R 4.1.2 in CI, change approach to macOS-latest R CI builds (fixes #4988) #4989

Merged
merged 12 commits into from
Feb 1, 2022

Conversation

jameslamb
Copy link
Collaborator

Fixes #4988.

See #4988 for a description of recent CI issues with R macOS builds.

I believe it could be related to GitHub Actions upgrading its macOS-latest environment to macOS 11.x 2 days ago. See actions/runner-images#4048.

Searched around GitHub a bit and found a discussion in r-lib/actions that seems relevant. r-lib/actions#412 describes an issue where older R installers can't create the necessary symlinks to R and Rscript on macOS 11.x.

The changes in this PR are based on the changes that that project used to fix that issue: r-lib/actions@a1c2c67

@jameslamb jameslamb requested a review from StrikerRUS January 30, 2022 03:43
@jameslamb jameslamb marked this pull request as draft January 30, 2022 03:53
@jameslamb jameslamb removed the request for review from StrikerRUS January 30, 2022 03:53
@jameslamb jameslamb changed the title [ci] manually create symlinks to R entrypoints on macOS (fixes #4988) WIP: [ci] manually create symlinks to R entrypoints on macOS (fixes #4988) Jan 30, 2022
@jameslamb
Copy link
Collaborator Author

It looks like these symlink changes fixed the issue for R 3.6.x, but not R 4.1.x: https://github.com/microsoft/LightGBM/runs/4994766651?check_suite_focus=true

I noticed at https://cran.r-project.org/bin/macosx/base/ that R 4.1.2 was published in November 2021. This project's CI currently uses R 4.1.1, published in August 2021.

I pushed 8117a05 updated the R version to 4.1.2, hoping that that version's installer would work with macOS 11.x. Probably a good idea to do this anyway, per #3763.

@jameslamb jameslamb changed the title WIP: [ci] manually create symlinks to R entrypoints on macOS (fixes #4988) WIP: [ci] upgrade to R 4.1.2 in CI , change approach to macOS-latest R CI builds (fixes #4988) Jan 30, 2022
@jameslamb jameslamb changed the title WIP: [ci] upgrade to R 4.1.2 in CI , change approach to macOS-latest R CI builds (fixes #4988) WIP: [ci] upgrade to R 4.1.2 in CI, change approach to macOS-latest R CI builds (fixes #4988) Jan 30, 2022
@jameslamb jameslamb changed the title WIP: [ci] upgrade to R 4.1.2 in CI, change approach to macOS-latest R CI builds (fixes #4988) [ci] upgrade to R 4.1.2 in CI, change approach to macOS-latest R CI builds (fixes #4988) Jan 30, 2022
@jameslamb jameslamb marked this pull request as ready for review January 30, 2022 22:21
@jameslamb jameslamb requested a review from StrikerRUS as a code owner January 30, 2022 22:21
@jameslamb
Copy link
Collaborator Author

Ok I think this is ready for review! Sorry that the research is split between comments here and on #4988, I should have tried to keep them all in one place.

Summary of changes:

@StrikerRUS
Copy link
Collaborator

Thanks for looking into this!

Why can't we use the latest versions of macOS and R together? I believe this is the most popular scenario among users.

Maybe we can use Homebrew installation for R?

@jameslamb
Copy link
Collaborator Author

Why can't we use the latest versions of macOS and R together?

I don't know, but I can see in #4988 (comment) that GitHub itself was also not able to build the latest version of R on the macOS-latest environment.

When I tried that with R 4.1.2 from CRAN, I saw the following error (build link)

installer: Error - the package path specified was invalid: '/Users/runner/work/LightGBM/LightGBM/R.pkg'.

Maybe we can use Homebrew installation for R?

Maybe. I've never used R from homebrew before (in this project, other projects, or personally) so I can't say how that differs from the .pkg packages provided by CRAN or what other issues we might face with it.

If you want to try that you're welcome to push commits to this branch. But I don't have much time to devote to LightGBM this week so I can't commit to trying that. I think this PR in its current state is sufficient to unblock CI in this project without losing any coverage of OS-compiler-R_version combinations, as until a few days ago we were also not testing the R package with R 4.1.2 + macOS 11.x.

@StrikerRUS
Copy link
Collaborator

Also linking related feature request: actions/runner-images#4960.

@StrikerRUS
Copy link
Collaborator

When I tried that with R 4.1.2 from CRAN, I saw the following error (build link)

Could you please document this in a new our internal feature request?

Copy link
Collaborator

@StrikerRUS StrikerRUS left a comment

Choose a reason for hiding this comment

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

LGTM except one suggestion below.
Thank you for unblocking CI!

export R_MAC_VERSION=4.1.1
export R_LINUX_VERSION="4.1.1-1.2004.0"
export R_MAC_VERSION=4.1.2
export R_LINUX_VERSION="4.1.2-1.2004.0"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess we need update all R versions in this list (4.0 -> 4.1), not only for macOS

matrix:
include:
################
# CMake builds #
################
- os: ubuntu-latest
task: r-package
compiler: gcc
r_version: 3.6
build_type: cmake
- os: ubuntu-latest
task: r-package
compiler: gcc
r_version: 4.0
build_type: cmake
- os: ubuntu-latest
task: r-package
compiler: clang
r_version: 3.6
build_type: cmake
- os: ubuntu-latest
task: r-package
compiler: clang
r_version: 4.0
build_type: cmake
- os: macOS-latest
task: r-package
compiler: gcc
r_version: 3.6
build_type: cmake
- os: macOS-latest
task: r-package
compiler: gcc
r_version: 4.0
build_type: cmake
- os: macOS-latest
task: r-package
compiler: clang
r_version: 3.6
build_type: cmake
- os: macOS-latest
task: r-package
compiler: clang
r_version: 4.0
build_type: cmake
- os: windows-latest
task: r-package
compiler: MINGW
toolchain: MINGW
r_version: 3.6
build_type: cmake
- os: windows-latest
task: r-package
compiler: MINGW
toolchain: MSYS
r_version: 4.0
build_type: cmake
# Visual Studio 2017
- os: windows-2016
task: r-package
compiler: MSVC
toolchain: MSVC
r_version: 3.6
build_type: cmake
# Visual Studio 2019
- os: windows-2019
task: r-package
compiler: MSVC
toolchain: MSVC
r_version: 4.0
build_type: cmake
# Visual Studio 2022
- os: windows-2022
task: r-package
compiler: MSVC
toolchain: MSVC
r_version: 4.0
build_type: cmake
###############
# CRAN builds #
###############
- os: windows-latest
task: r-package
compiler: MINGW
toolchain: MINGW
r_version: 3.6
build_type: cran
- os: windows-latest
task: r-package
compiler: MINGW
toolchain: MSYS
r_version: 4.0
build_type: cran
- os: ubuntu-latest
task: r-package
compiler: gcc
r_version: 4.0
build_type: cran
- os: macOS-latest
task: r-package
compiler: clang
r_version: 4.0
build_type: cran
################
# Other checks #
################
- os: ubuntu-latest
task: r-rchk
compiler: gcc
r_version: 4.0
build_type: cran

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah yep you're right! Updated in 7cb0fd0

@jameslamb
Copy link
Collaborator Author

could you please document this in a new feature request?

Added #4990 and added it to #2302

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ci] [R-package] macOS builds failing to install R
2 participants