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

Fix build with Boost 1.86.0 #2381

Merged
merged 3 commits into from
Sep 16, 2024
Merged

Fix build with Boost 1.86.0 #2381

merged 3 commits into from
Sep 16, 2024

Conversation

dbear496
Copy link
Contributor

A recent update to Boost changed the type of message digests from int[5] to char[20]. This PR updates the handling of message digests to use the updated type.

Fixes #2378.

Copy link
Member

@afh afh left a comment

Choose a reason for hiding this comment

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

Thanks for addressing build issue with boost 1.86.0 and putting up this PR, @dbear496, much appreciated.

The Ledger project somewhat prides itself with maintaining compatibility with older versions of its dependencies.

Please find below a few suggestions that allow ledger to be build with boost 1.86.0 and previous versions. This should also address the CI build failures.

src/filters.cc Outdated Show resolved Hide resolved
src/utils.h Outdated Show resolved Hide resolved
src/utils.h Outdated Show resolved Hide resolved
src/utils.h Outdated Show resolved Hide resolved
src/utils.h Outdated Show resolved Hide resolved
@dbear496
Copy link
Contributor Author

dbear496 commented Sep 14, 2024

I made my changes compatible with older versions of Boost by using Boost's digest_type instead of hard-coding the underlying type we expect Boost to use.

@dbear496 dbear496 requested a review from afh September 15, 2024 01:13
@jwiegley
Copy link
Member

It looks like this PR may need to be rebased onto the current master, since I'm seeing changes here that were merged in by another PR.

@jwiegley
Copy link
Member

@afh Does this PR look good to you now?

@afh
Copy link
Member

afh commented Sep 16, 2024

I'm doing test builds with boost 1.86 and a previous version, while having a closer look at the changes this very moment :)

@afh
Copy link
Member

afh commented Sep 16, 2024

While this PR builds with a previous version of boost, it unfortunately fails when building with boost 1.86.0 with:

src/utils.h:602:18: error: non-const lvalue reference to type 'digest_type' (aka 'unsigned char[20]') cannot bind to a value of unrelated type 'unsigned int[5]'
    sha.get_digest(message_digest);
                   ^~~~~~~~~~~~~~
  include/boost/uuid/detail/sha1.hpp:179:43: note: passing argument to parameter 'digest' here
  inline void sha1::get_digest(digest_type& digest)

Does this ring a bell, @dbear496?

@afh
Copy link
Member

afh commented Sep 16, 2024

Oh wait, I was on the wrong git branch, that did not have this PRs changes applied. Apologies, let me try again, 😅

Copy link
Member

@afh afh left a comment

Choose a reason for hiding this comment

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

Great work, @dbear496, thanks for the improvements and your contribution!! 👍

Happy to report that this PR builds with boost 1.86.0 and previous version (I tested using 1.81.0) and all the tests passed.

@afh afh merged commit 684ccbd into ledger:master Sep 16, 2024
4 checks passed
@dbear496 dbear496 mentioned this pull request Sep 16, 2024
bob-beck pushed a commit to openbsd/ports that referenced this pull request Nov 21, 2024
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.

Build fails with boost 1.86
3 participants