-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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] Make Windows CI fail if R CMD check fails #3435
Conversation
24f24d7
to
aad70cc
Compare
aad70cc
to
6931691
Compare
R-package/R/aliases.R
Outdated
@@ -6,6 +6,7 @@ | |||
# R sources files during installation). | |||
# [return] A named list, where each key is a parameter relevant to lgb.DataSet and each value is a character | |||
# vector of corresponding aliases. | |||
,,,, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm starting by intentionally pushing a change that raises an ERROR in R CMD check
, so we can see that the Windows tests pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
even with this syntax error, all of the Windows tests passed!
https://github.com/microsoft/LightGBM/pull/3435/checks?check_run_id=1204672524
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After adding f916575, the MINGW tests fail as expected
https://github.com/microsoft/LightGBM/pull/3435/checks?check_run_id=1204732555
But the MSVC ones do not! Another issue with how errors are caught by Run-R-Code-Redirect-Stderr
, maybe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after adding e191673, all Windows checks now fail as expected
https://github.com/microsoft/LightGBM/pull/3435/checks?check_run_id=1204756009
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Looks like we cannot rely on Run-R-Code-Redirect-Stderr
...
@@ -181,6 +185,11 @@ if ($env:COMPILER -ne "MSVC") { | |||
Get-Content -Path "$INSTALL_LOG_FILE_NAME" | |||
Write-Output "----- end of build and install logs -----" | |||
Check-Output $install_succeeded | |||
# some errors are not raised above, but can be found in the logs | |||
if (Get-Content "$INSTALL_LOG_FILE_NAME" | Select-String -Pattern "ERROR" -Quiet) { | |||
echo "ERRORs have been found installing lightgbm" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops! Seems that during VS trials and errors (we use them to find any supported VS version) we trigger this condition:
Trying 'Visual Studio 16 2019'
-- Configuring incomplete, errors occurred!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I always forget that Select-String
is case-insensitive by default 🙃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Looks like we cannot rely on Run-R-Code-Redirect-Stderr...
Oh wait, I see why! I might be able to fix this by fixing
Run-R-Code-Redirect-Stderr
.My next few commits here will be to test...I'll comment when it's ready for another review
ok sadly my experiment failed. I thought I just needed to add a return or Exit in Run-R-Code-Redirect-Stderr
but that didn't work. All of the ways we have to catch errors makes it really complicated :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed!
Oh wait, I see why! I might be able to fix this by fixing My next few commits here will be to test...I'll comment when it's ready for another review |
10bba36
to
216c31a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the neat solution!
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. |
In #3405 (comment), I noticed that if
R CMD check
raises anERROR
on Windows, LightGBM's CI doesn't fail. Maybe that is a result of the way we have to interceptstderr
on GitHub Actions Windows environments (LightGBM/.ci/test_r_package_windows.ps1
Lines 15 to 28 in 0fc4c5c
This PR proposes a fix, to be sure that CI fails on changes that break the R package.