WIP: [ci] [R-package] re-enable 'rchk' checks #6332
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #6266, I'm working on making this project's shell scripts stricter, so they exit with a non-0 exit code the first time anything goes wrong (e.g. some variable they require isn't set or somme command they run fails).
This revealed that the CI job supposed to be checking the R package with
rchck
has not actually been working!That job currently prints this:
And then just exits "successfully" with an exit code of 0 🙃
(link to recent build from master)
I suspect that that's been silently broken for over a year... since #5638. That PR moved all of the Linux R-package jobs inside of containers, but the
ubuntu:latest
image doesn't havedocker
in it and isn't set up for docker-in-docker by default. Following the docs in https://github.com/kalibera/rchk/blob/master/doc/DOCKER.md, that job expects to build the R package on the host, thendocker run
a container withrchk
in it and that package mounted in.This PR proposes the following:
rchk
-related code out into its own script, similar to https://github.com/microsoft/LightGBM/blob/master/.ci/test_r_package_valgrind.shrchk
-specific branches and special conditions in.ci/test_r_package.sh
rchk
to its own section in the config for R-package GitHub Actions jobsBenefits of these changes
How I tested this
Intentionally pushed a change that would create an imbalance of
PROTECT()
/UNPROTECT()
calls inlightgbm_R.cpp
. Saw this check fail as expected.(build link)
Then reverted that and saw it passing on this branch.
References
The
rchk
job was first added here in #4449.CRAN
rchk
check description: https://raw.githubusercontent.com/kalibera/cran-checks/master/rchk/README.txt (linked from https://cran.r-project.org/web/checks/check_issue_kinds.html).How to run
rchk
: https://github.com/kalibera/rchk/blob/master/doc/DOCKER.md