Skip to content
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

[lightgbm] Add open-source library lightgbm to vcpkg #39395

Merged
merged 16 commits into from
Jun 21, 2024

Conversation

dsmith111
Copy link
Contributor

@dsmith111 dsmith111 commented Jun 19, 2024

Add open-source library lightgbm to vcpkg
LightGBM GitHub Repo: https://github.com/microsoft/LightGBM

  • Changes comply with the maintainer guide.
  • The name of the port matches an existing name for this component on https://repology.org/ if possible, and/or is strongly associated with that component on search engines.
  • Optional dependencies are resolved in exactly one way. For example, if the component is built with CMake, all find_package calls are REQUIRED, are satisfied by vcpkg.json's declared dependencies, or disabled with CMAKE_DISABLE_FIND_PACKAGE_Xxx.
  • The versioning scheme in vcpkg.json matches what upstream says.
  • The license declaration in vcpkg.json matches what upstream says.
  • The installed as the "copyright" file matches what upstream says.
  • The source code of the component installed comes from an authoritative source.
  • The generated "usage text" is accurate. See adding-usage for context.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is in the new port's versions file.
  • Only one version is added to each modified port's versions file.

@dsmith111
Copy link
Contributor Author

De-vendored dependencies listed in vcpkg.json. "Fast double parser" is not a vcpkg port, however "Fast float parser" is which is the successor to "Fast double parser". Do not want to alter lightgbm to utilize the new library. Pulled sub-module git commit and copied into expected folder as seen done elsewhere in this repo.

@dsmith111 dsmith111 marked this pull request as ready for review June 20, 2024 01:14
@LilyWangLL LilyWangLL self-assigned this Jun 20, 2024
@LilyWangLL LilyWangLL added the category:new-port The issue is requesting a new library to be added; consider making a PR! label Jun 20, 2024
ports/lightgbm/vcpkg.json Outdated Show resolved Hide resolved
ports/lightgbm/vcpkg.json Outdated Show resolved Hide resolved
ports/lightgbm/portfile.cmake Outdated Show resolved Hide resolved
@LilyWangLL
Copy link
Contributor

Feature passed with following triplets:

x86-windows
x64-windows
x64-windows-static

@LilyWangLL
Copy link
Contributor

Note: I will be converting your PR to draft status. When you respond, please revert to "ready for review". That way, I can be aware that you've responded since you can't modify the tags.

@LilyWangLL LilyWangLL marked this pull request as draft June 20, 2024 09:04
@dsmith111 dsmith111 marked this pull request as ready for review June 20, 2024 14:40
@dsmith111
Copy link
Contributor Author

Note: I will be converting your PR to draft status. When you respond, please revert to "ready for review". That way, I can be aware that you've responded since you can't modify the tags.

Thanks for the review. Made the requested changes. Let me know if the description isn't condensed enough.

LilyWangLL
LilyWangLL previously approved these changes Jun 21, 2024
@LilyWangLL LilyWangLL added the info:reviewed Pull Request changes follow basic guidelines label Jun 21, 2024
)

# Fast double parser is a non-vcpkg dependency of LightGBM
vcpkg_from_github(
Copy link
Member

Choose a reason for hiding this comment

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

It seems like this should be a separate port instead of vendoring it into this one.

Copy link
Contributor Author

@dsmith111 dsmith111 Jun 21, 2024

Choose a reason for hiding this comment

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

Devendored fast double parser based on a PR to convert it into a port as well:
#39421

Pulled this into a draft (as it will now break until the above PR is merged). Will perform an empty push to retrigger CI once the fast double parser (a header only library) is resolved.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@BillyONeal, this has been resolved. Thanks for the timely review on the fast double parser PR!

install(
DIRECTORY ${FMT_INCLUDE_DIR}/
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/LightGBM/utils
- FILES_MATCHING PATTERN "*.h"
Copy link
Member

Choose a reason for hiding this comment

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

Is this fix submitted upstream?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, removed from this PR

Copy link
Member

Choose a reason for hiding this comment

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

I mean, wasn't it fixing some sort of problem by being here? I just want to make sure that changes we make get appropriately upstreamed instead of remaining only in our own patches forever.

Copy link
Contributor Author

@dsmith111 dsmith111 Jun 21, 2024

Choose a reason for hiding this comment

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

When I was devendoring a few of the original packages, I thought there was an issue here. But no, it was related to something else. The patch for this pattern wasn't needed here.

@dsmith111 dsmith111 marked this pull request as draft June 21, 2024 05:00
@LilyWangLL LilyWangLL removed the info:reviewed Pull Request changes follow basic guidelines label Jun 21, 2024
@dsmith111 dsmith111 marked this pull request as ready for review June 21, 2024 21:37
-set(FMT_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/external_libs/fmt/include")
-include_directories(${FMT_INCLUDE_DIR})
+find_path(FAST_DOUBLE_PARSER_INCLUDE_DIR fast_double_parser.h)
+set(FAST_DOUBLE_PARSER_INCLUDE_DIR ${VCPKG_INCLUDE_DIR})
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
+set(FAST_DOUBLE_PARSER_INCLUDE_DIR ${VCPKG_INCLUDE_DIR})

The find_path should do that, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the catch.

set(Boost_USE_STATIC_LIBS ON)
endif()
- find_package(Boost 1.56.0 COMPONENTS filesystem system REQUIRED)
+ find_package(Boost 1.56.0 COMPONENTS filesystem system compute REQUIRED)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
+ find_package(Boost 1.56.0 COMPONENTS filesystem system compute REQUIRED)
+ find_package(Boost COMPONENTS filesystem system compute REQUIRED)

Copy link
Member

Choose a reason for hiding this comment

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

Sorry for the split review :/

Copy link
Contributor Author

@dsmith111 dsmith111 Jun 21, 2024

Choose a reason for hiding this comment

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

Can you explain this change? Why would we want to remove the minimum version the original CMakeLists was asking for.

Copy link
Member

Choose a reason for hiding this comment

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

In general we don't want version constraints in the build system, since we consider version under the control of the ultimate downstream customer. But given that build passed it's not worth resetting over this.

@BillyONeal BillyONeal merged commit c4467cb into microsoft:master Jun 21, 2024
17 checks passed
@BillyONeal
Copy link
Member

Thanks for the new port!

@dsmith111
Copy link
Contributor Author

Thanks for the new port!

Thanks for taking the time to review!

@dsmith111 dsmith111 deleted the smithdavi/newport-lightgbm branch June 21, 2024 22:17
@LilyWangLL LilyWangLL added the info:reviewed Pull Request changes follow basic guidelines label Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR! info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants