Description
Summary
As I've investigated #2960 as part of #629 , I've learned that packages on CRAN have to be able to build on 32-bit Windows.
I believe that we need to add support for a 32-bit build LightGBM to get the R package to CRAN.
Evidence that this is required
I have not yet found any official statement that says "all R packages have to build on 32-bit Windows", but I see strong evidence that that is true.
You can find the current list of check environments at https://cran.r-project.org/web/checks/check_flavors.html. None of those seem to be 32-bit
but in "Writing R Extensions" I see the following:
On systems which support multiple sub-architectures (principally Windows), R CMD check will install and check a package which contains compiled code under all available sub-architectures.
And in the "R for Windows FAQs":
Packages without compiled code nor a configure.win script will run on both 32- and 64-bit R.
Packages with compiled code but no configure.win nor src/Makefile.win file will be built for both when running on a 64-bit version of Windows if both versions of R are installed.
An empty configure.win is treated in the same way as if none existed. Also, there is a list of packages known to have an architecture-independent configure.win hardcoded into R CMD INSTALL, and for these packages, both architectures will be built under the above conditions. Other packages can be installed with configure.win run for just the first architecture by using option --force-biarch.
Any package can be installed for first one architecture and then the other with option --merge-multiarch, but the package source must be a tarball (and as before, running on a 64-bit version of Windows with both versions of R installed).
Finally, a package without a src/Makefile.win file and no or empty or architecture-independent configure.win file can be installed for both architectures from 32-bit Windows if the 64-bit components were selected when R was installed and option --compile-both is given. Obviously, only the 32-bit installation can be tested.
This is why you see pull requests this in other projects: dmlc/xgboost#5777
I've tried looking in the source for R CMD check but it is very difficult to follow.
Motivation
I believe that we need to add support for a 32-bit build LightGBM to get the R package to CRAN.
Description
To check if the R package works with 32-bit R, try the following:
sh build-cran-package.sh
"C:\Program Files\R\R-4.0.2\bin\i386\R.exe" CMD check lightgbm_3.0.0-1.tar.gz --as-cran
References
There was some discussion about this in #1129 , where it was decided that supporting a 32-bit is possible but that the maintenance burden would be too much. Given that it is needed to get LightGBM to CRAN, I think it should be reconsidered.