[R-package] always name the shared library 'lightgbm', not 'lib_lightgbm' #6432
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This proposes ensuring that the shared library for R packages builds is always called
lightgbm.{dll,dylib,so}
, notlib_lightgbm.{dll,dylib,so}
.Notes for Reviewers
Why not standardize on
lib_lightgbm
instead?Much of the standard R tooling prefers that the main shared library for a package be named
{package}.so
, notlib_{package}.so
. See, for example, this: https://cran.r-project.org/doc/manuals/R-exts.html#useDynLib.That is why the package we ship to CRAN uses the library name
lightgbm.{dll,dylib,so}
.Is this a breaking change?
No.
It does not change anything about the CRAN package.
For the CMake-based package, it changes the library filename but that library is only intended to be used by the
{lightgbm}
library, not externally linked to by any other programs.Why did all this complexity exist in the first place?
Honestly.... because I didn't really understand CMake back when setting up this project's R packaging stuff a few years ago 😬