[R-package] move R source files into R-package, reduce duplication in build_r.R#3087
Conversation
There was a problem hiding this comment.
There are some other files that should be updated:
https://github.com/microsoft/LightGBM/blob/master/CMakeLists.txt
https://github.com/microsoft/LightGBM/blob/master/.github/CODEOWNERS
I don't think anything in Good catch on https://github.com/microsoft/LightGBM/blob/master/.github/CODEOWNERS#L18-L20 |
|
Currently looking into this Here's the relevant source code in |
it was this: cpplint/cpplint#139 The fix is using |
StrikerRUS
left a comment
There was a problem hiding this comment.
LGTM!
Removing my "changes requested" review status.
… build_r.R (lightgbm-org#3087) * [R-package] move R source files into R-package * fix linting warning * stuff
… build_r.R (lightgbm-org#3087) * [R-package] move R source files into R-package * fix linting warning * stuff
|
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 this PR, I propose moving the R-specific C++ source files into the
R-packagedirectory. For CRAN builds, it's necessary for those files to be at the root level of the R-package'ssrc/directory (notsrc/src/like we currently use when we copy in files).R CMD BUILDautomatically compiles any.c,.cc, or.cppfiles it finds insrc/.I also think there's a nice organizational benefit to having as much of the R package's code inside
R-package/as possible.This PR also proposes some simplifications to
build_r.R. We were repeating the string literal"lightgbm_r"a lot, and I think it would be better to store it in one constant at the top of the script.This is only moving files around and will not change anything for our users.
How this helps us get to CRAN
This is the next PR on the road to #629 . I'm working on #2960 in my fork. That PR includes build steps for the R package which only use the CRAN toolchain (e.g. no Visual Studio, no CMake).
That PR on my fork right now has a large diff that would be difficult to review, and it needs a bit more work. So I'd like to propose the first batch of changes here.