Skip to content

[R-package] always name the shared library 'lightgbm', not 'lib_lightgbm'#6432

Merged
jameslamb merged 7 commits intomasterfrom
r/library-name
May 1, 2024
Merged

[R-package] always name the shared library 'lightgbm', not 'lib_lightgbm'#6432
jameslamb merged 7 commits intomasterfrom
r/library-name

Conversation

@jameslamb
Copy link
Collaborator

@jameslamb jameslamb commented Apr 29, 2024

This proposes ensuring that the shared library for R packages builds is always called lightgbm.{dll,dylib,so}, not lib_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, not lib_{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 😬

@jameslamb jameslamb changed the title WIP: [R-package] always name the shared library 'lightgbm', not 'lib_lightgbm' [R-package] always name the shared library 'lightgbm', not 'lib_lightgbm' May 1, 2024
@jameslamb jameslamb marked this pull request as ready for review May 1, 2024 02:27
@jameslamb jameslamb mentioned this pull request May 1, 2024
33 tasks
Copy link
Collaborator

@borchero borchero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jameslamb jameslamb merged commit da9bb5f into master May 1, 2024
@jameslamb jameslamb deleted the r/library-name branch May 1, 2024 17:55
@github-actions
Copy link
Contributor

github-actions bot commented May 8, 2025

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants