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

WIP: [ci] [R-package] re-enable 'rchk' checks #6332

Closed
wants to merge 11 commits into from
Closed

Conversation

jameslamb
Copy link
Collaborator

@jameslamb jameslamb commented Feb 20, 2024

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:

/__w/LightGBM/LightGBM/.ci/test_r_package.sh: line 178: docker: command not found

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 have docker 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, then docker run a container with rchk in it and that package mounted in.

This PR proposes the following:

Benefits of these changes

  • restores a CI job that can be used to catch issues with the R package which otherwise wouldn't be caught until an attempted release to CRAN
  • simplifies the script used by most macOS and Linux R-package CI jobs in the project

How I tested this

Intentionally pushed a change that would create an imbalance of PROTECT() / UNPROTECT() calls in lightgbm_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

@jameslamb
Copy link
Collaborator Author

This PR has fallen far behind and picked up some conflicts with recent changes. Working on a different approach in #6545 .

@jameslamb jameslamb closed this Jul 14, 2024
@jameslamb jameslamb deleted the ci/r-rchk branch July 14, 2024 23:17
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.

1 participant