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

Boost 1.86 SHA1 compatibility fix #69

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jmakovicka
Copy link

@jmakovicka jmakovicka commented Feb 11, 2025

Checklist

  • Used a personal fork of the feedstock to propose changes
  • Bumped the build number (if the version is unchanged)
  • Reset the build number to 0 (if the version changed)
  • Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
  • Ensured the license file is being packaged.

@conda-forge-admin
Copy link
Contributor

conda-forge-admin commented Feb 11, 2025

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe/meta.yaml) and found it was in an excellent condition.

I do have some suggestions for making it better though...

For recipe/meta.yaml:

  • ℹ️ The recipe is not parsable by parser conda-souschef (grayskull). This parser is not currently used by conda-forge, but may be in the future. We are collecting information to see which recipes are compatible with grayskull.

This message was generated by GitHub Actions workflow run https://github.com/conda-forge/conda-forge-webservices/actions/runs/13292814680. Examine the logs at this URL for more detail.

@jmakovicka
Copy link
Author

@conda-forge-admin please rerender

Copy link
Member

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

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

Thanks! Left 2 comments for your consideration. Happy to merge this once those are addressed.

+ buf << std::hex << std::setfill('0') << std::setw(sizeof(digest[0]) * 2) << digest[i];

return buf.str();
}
Copy link
Member

Choose a reason for hiding this comment

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

I think this is ok, but writing out my reasoning to be sure I'm understanding correctly.

The file you're patching here is in LightGBM's vendored copy of the Boost 1.74 headers.

But here in conda-forge, lib_lightgbm is dynamically linking against the latest libboost-devel (1.87.0 as of this writing).

So this allows LightGBM to be built successfully, by pulling forward a specific breaking change in Boost (the one @sofiageo mentioned in microsoft/LightGBM#6786 (comment)).

Right?

If so I'm ok with that. But this is a fragile state to be in (vendoring headers from a version and then linking against a shared library from a different version).

If you know how to get LightGBM building successfully with Boost 1.87, we'd welcome help upstream (cc @StrikerRUS): microsoft/LightGBM#6582

And also longer-term, LightGBM should really be modified upstream to stop vendoring these headers and to instead expect them to be provided in the build environment (maybe as part of microsoft/LightGBM#6774).

Copy link
Author

Choose a reason for hiding this comment

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

The file you're patching here is in LightGBM's vendored copy of the Boost 1.74 headers.

But here in conda-forge, lib_lightgbm is dynamically linking against the latest libboost-devel (1.87.0 as of this writing).

According to the logs, boost 1.86 is used for during build (and present in the resulting index.json).

So this allows LightGBM to be built successfully, by pulling forward a specific breaking change in Boost (the one @sofiageo mentioned in microsoft/LightGBM#6786 (comment)).

Right?

Yes, the only difference is that my version works with both pre- and post-1.86 boost. The above PR works with >=1.86 only.

If so I'm ok with that. But this is a fragile state to be in (vendoring headers from a version and then linking against a shared library from a different version).

If you know how to get LightGBM building successfully with Boost 1.87, we'd welcome help upstream (cc @StrikerRUS): microsoft/LightGBM#6582

I didn't try 1.87 yet, because most of conda-forge is compatible with 1.86 at maximum.

Copy link
Member

Choose a reason for hiding this comment

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

recipe/meta.yaml Outdated

build:
number: 4
number: 6
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
number: 6
number: 5

There aren't any published *_5 packages, so assuming this was a mistake.

@jmakovicka
Copy link
Author

Changed the patches to

  • keep the build number change only in "Rebuild for libboost 1.86"
  • use size_t for iteration in the sha1 patch to avoid signed/unsigned warnings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants