-
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] Add Windows CI for R package (fixes #2335) #2936
Conversation
Azure is failing with this error, which I did see one other time during my testing: This is a server for TeX packages. The one time I saw this while I was preparing this PR, it was fixed by just waiting a minute or two and rebuilding, so I'm going to close and reopen to trigger CI. Everything on Travis is passing except our old friend, the |
close-reopen to trigger CI |
@jameslamb Awesome job, thanks! I see Azure is failing again with the error you've mentioned. As we know that it occurs quite often, maybe we should retry download? For example: https://forums.hak5.org/topic/36911-powershell-retry-download-until-complete/?tab=comments#comment-268464 |
a479fd1
to
e54954a
Compare
Ok I addressed and in e54954a. Once I got past those, I also had to add some changes for MSVC. I realized we don't really need On my personal Azure DevOps, the R build took 32 minutes to complete (but did complete successfully) and the Appveyor build timed out after an hour. I'm investigating more on my fork. I think the issue here is that this PR was working for just "compile lib_lightgbm and build the R package that calls it". But now that as of #2901 we're linking to R's shared library, there are additional things I need to fix. |
I'm currently working in my fork on getting the builds to work again now that we're linking to I'm not seeing that behavior locally on my laptop running Windows 10, using MSVC bundled with Visual Studio 16 2019. Will let you all know when this is ready for review, it was probably premature to turn it from Draft to Ready :/ |
3678829
to
248d36d
Compare
Ok here's where we stand:
|
Never. I remember only one issue related to
Maybe Azure blocks some IPs like Travis blocks apts outside of their whitelist?.. |
yeah I was thinking it might be something Azure-specific because I've only ever seen it there. That's a good idea! I have an idea too, going to try it on my fork 😀 |
@jameslamb Line 31 in c870c57
|
248d36d
to
c9ba4d1
Compare
f911585
to
45adca9
Compare
build_r.R
Outdated
@@ -5,6 +5,9 @@ | |||
# Sys.setenv("CXX" = "/usr/local/bin/g++-8") |
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.
this is not strictly related to this PR and is being added in #2957 . It'll disappear from the diff when that gets merged
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.
now that #2957 has been merged, I'll rebase to master
before the next commit I push here
@StrikerRUS thanks for the great review so far! @Laurae2 @guolinke could one of you take a look at this? @StrikerRUS and I will keep talking through miscellaneous things in CI scripts, but I don't want to merge this until an R reviewer also approves. |
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.
@jameslamb Can we fix this warning?
Warning message:
In normalizePath(path.expand(path), winslash, mustWork) :
path[1]="C:/projects/lightgbm/RLibrary/R/lib": The system cannot find the file specified
Please check one more round of review below.
@guolinke Printing out build logs with MinGW allowed to spot many compilation warnings. Can you please check them?
On the point of compilation warnings...if we determine that they were not introduced by this PR (I really think they were not), let's please open a separate issue and not delay this PR any further. The |
Co-Authored-By: Nikita Titov <[email protected]>
I wanted to init the discussion here where we can see these logs live. Of course, they shouldn't prevent merging of this PR in any way.
Ah, OK! |
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.
@jameslamb Thanks a lot for all your hard work! I don't think that the rest minor comments should prevent from merging, but please check them.
Co-Authored-By: Nikita Titov <[email protected]>
@@ -67,6 +67,7 @@ if (!use_precompile) { | |||
# Check if Windows installation (for gcc vs Visual Studio) | |||
if (WINDOWS) { | |||
if (use_mingw) { | |||
print("Trying to build with MinGW") |
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.
Change in another PR print
for message
.
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.
sure! Let's talk about it in a separate issue / PR. We have several other print()
statements in install.libs.R
and no uses of message()
so I'm curious what makes message()
preferable here.
} while(!$?); | ||
} | ||
|
||
$env:R_WINDOWS_VERSION = "3.6.3" |
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.
Do you think we should test with R 4.0 ?
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.
set(LIBR_HOME ${LIBR_HOME} CACHE PATH "R home directory") | ||
set(LIBR_EXECUTABLE ${LIBR_EXECUTABLE} CACHE PATH "R executable") | ||
set(LIBR_INCLUDE_DIRS ${LIBR_INCLUDE_DIRS} CACHE PATH "R include directory") | ||
set(LIBR_LIB_DIR ${LIBR_LIB_DIR} CACHE PATH "R shared libraries directory") |
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.
In another PR, maybe we should change the name and use LIBR_LIB_DIRS
instead of LIBR_LIB_DIR
(cmake Find result variables should be plural for include_dirs / lib_dirs, usually they are placeholders for include_dir / lib_dir if they are singular directories).
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.
In this case it is a single directory. This isn't "all directories passed to the linker in -L
flags", it is "what is the one directory where R.dll
/ R.so
is likely to live".
Anyway, I'm removing LIBR_LIB_DIR
completely in #2963 . It's only being used in MSVC installs, and only indirectly as a way to find LIBR_CORE_LIBRARY
.
Thanks for the helpful reviews! I'm excited to merge this one 😀 |
@guolinke Now as we run R-package tests at Appveyor we'll face corresponding job failures due to CRAN/CTAN network availability issues quite often (for example, refer to the latest master failure). I wonder, is it possible to give maintainers privileges to re-run failed jobs as we have for Travis/Azure? It seems that it is technically possible now: https://www.appveyor.com/docs/team-setup/. |
^ related to #2936 (comment), without that we can find ourselves in this situation where one long-running AppVeyor build is blocking all others from starting: Notice that the build at the bottom has been running for 45 minutes. It is stuck trying to download something from a CTAN mirror. Ideally, I'd like to be able to kill it in the AppVeyor UI. But since I don't have permissions right now all other builds have to wait. |
Gently ping @guolinke for #2936 (comment) |
@StrikerRUS @jameslamb |
@guolinke thanks! Although now that we have #3168 , as soon as that is merged AppVeyor should no longer be a problem 😂 That PR and all others are blocked until you can help us address #3000 (comment) |
@guolinke Thanks a lot! Now I can re-run failed jobs. |
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. |
This PR adds CI support for the R package on Windows. It also bumps up the version of R we test against (on all operating systems) from 3.6.1 to 3.6.3.
As of this PR, 4 R CMD check NOTES remain on Windows. All of them can be addressed in later PRs and none of them were introduced by changes in this PR.
R CMD CHECK NOTES (click for details)
note-1
note-2
note-3
note-4
note-1
: not relevant for us, won't actually show up on CRAN and we shouldn't incur the extra time to install those packages. CRAN will have all Suggests dependencies available.note-2
: only showing up on Windows. Probably some build files not caught by .Rbuildignore. Can be addressed in a follow-up PR.note-3
: addressed by [R-package] adding routine registration in R package (fixes #1910) #2911note-4
: Can be addressed in a follow-up PR.Currently,
.appveyor.yml
onmaster
only has code for the Python package. It has some code there (like setting up thetest-env
conda environment) that is identical to code in.vsts-ci.yml
. In this PR, I decided to consolidate that code in.ci/test_windows.ps1
. That made it easier to do things likeif $env:TASK -eq "r-package"
, and is similar to how we handle Mac and Linux in.ci/test.sh
.The R portion of
.ci/test_windows.ps1
borrows heavily from @StrikerRUS 's setup for theRGF
package (https://github.com/RGF-team/rgf/blob/master/R-package/.R.appveyor.ps1). Thank you for that!This PR has so many commits in it because I spent a lot of time getting this working in the Travis, Appveyor, and Azure DevOps setups for my fork.
successful builds from jameslamb/LightGBM fork
Azure DevOps
AppVeyor
Travis
This PR supports the progress on #629 and would give us more confidence in things like #2901 and #987