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] [R-package] incorrect R version being used on some R-package CI jobs #5640

Closed
jameslamb opened this issue Dec 20, 2022 · 2 comments · Fixed by #6107
Closed

[ci] [R-package] incorrect R version being used on some R-package CI jobs #5640

jameslamb opened this issue Dec 20, 2022 · 2 comments · Fixed by #6107

Comments

@jameslamb
Copy link
Collaborator

jameslamb commented Dec 20, 2022

Description

At least on Linux, r-package CI jobs in this project appear to be using the wrong R version.

For example, on the most recent r-package (ubuntu-22.04, gcc, R 3.6, cmake build on master (build link), I see the following in the logs.

* using R version 4.2.2 Patched (2022-11-10 r83330)
* using platform: x86_64-pc-linux-gnu (64-bit)

and

R CMD check build logs:
...
installing via 'install.libs.R' to /home/runner/work/LightGBM/LightGBM/lightgbm.Rcheck/00LOCK-lightgbm/00new/lightgbm
-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is GNU 11.3.0
...
-- R version passed into FindLibR.cmake: 4.2.2

This means that at least for some combinations of operating system, compiler, and build type, the R package is not actually being tested against R 3.6.

Reproducible example

I noticed this on ubuntu-22.04 (ubuntu-latest) Linux R 3.6 jobs, but it might be happening on others.

Environment info

At least latest master (a174893), unsure how long this has been going on.

Additional Comments

I suspect that this is happening because of a combination of the following:

At least for Linux jobs, I hope that #5638 will prevent this "silently fell back to software from GitHub Actions" issue.

To close this issue, CI checks should be added which explicitly confirm that the expected version of R was used, similar to

# this check makes sure that CI builds of the package
# actually use MM_MALLOC preprocessor definition
if [[ $R_BUILD_TYPE == "cran" ]]; then
mm_malloc_working=$(
cat $BUILD_LOG_FILE \
| grep --count -E "checking whether MM_MALLOC work.*yes"
)
else
mm_malloc_working=$(
cat $BUILD_LOG_FILE \
| grep --count -E ".*Performing Test MM_MALLOC - Success"
)
fi
if [[ $mm_malloc_working -ne 1 ]]; then
echo "MM_MALLOC test was not passed"
exit -1
fi

I remember @StrikerRUS recommended that in the past, but I can't find the comment to link to.

@jameslamb
Copy link
Collaborator Author

The correct version is being used on macOS and Linux CI jobs, per this:

used_correct_r_version=$(
cat $LOG_FILE_NAME \
| grep --count "using R version ${R_VERSION}"
)
if [[ $used_correct_r_version -ne 1 ]]; then
echo "Unexpected R version was used. Expected '${R_VERSION}'."
exit -1
fi

So only Windows checks need to still be added. I'll put up a PR for that shortly.

Copy link

This issue 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 Dec 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant