pulsar-client-cpp icon indicating copy to clipboard operation
pulsar-client-cpp copied to clipboard

[Bug] Build breaks with boost-libs-1.87.0: fatal error: 'boost/asio/io_service.hpp' file not found

Open yurivict opened this issue 11 months ago • 9 comments

Search before asking

  • [x] I searched in the issues and found nothing similar.

Version

In file included from /usr/ports/net-p2p/pulsar-client-cpp/work/pulsar-client-cpp-3.7.0/lib/BatchMessageKeyBasedContainer.cc:24:
/usr/ports/net-p2p/pulsar-client-cpp/work/pulsar-client-cpp-3.7.0/lib/ClientConnection.h:34:10: fatal error: 'boost/asio/io_service.hpp' file not found
   34 | #include <boost/asio/io_service.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Version: 3.7.0 clang-19 FreeBSD 14.2

Minimal reproduce step

n/a

What did you expect to see?

n/a

What did you see instead?

n/a

Anything else?

No response

Are you willing to submit a PR?

  • [ ] I'm willing to submit a PR!

yurivict avatar Feb 16 '25 07:02 yurivict

It's recommended to build via vcpkg so that the dependency version could be consistent with the tests. Boost might introduce breaking changes so that it's hard to maintain code compatibility with all versions. Currently the tested version is 1.83: https://github.com/apache/pulsar-client-cpp/blob/fca38274ea2587f0980c40af83d8886ea73538e9/vcpkg.json#L16

I tried upgrading the dependency to 1.86 before but the PR is drafted due to my lack of time recently: https://github.com/apache/pulsar-client-cpp/blob/fca38274ea2587f0980c40af83d8886ea73538e9/vcpkg.json#L16

BewareMyPower avatar Feb 21 '25 03:02 BewareMyPower

It's recommended to build via vcpkg [...]

Ports/packages can't do this. They always use other packages as dependencies.

yurivict avatar Feb 21 '25 04:02 yurivict

They always use other packages as dependencies.

Sorry I don't understand it. Did you mean your project depends on Boost 1.87 so that the version is pinned?

BTW, it's acceptable to support latest Boost version. I tried upgrading Boost to 1.86 before (https://github.com/apache/pulsar-client-cpp/pull/459) but it's not in progress now due to lack of time.

BewareMyPower avatar Feb 21 '25 04:02 BewareMyPower

Sorry I don't understand it. Did you mean your project depends on Boost 1.87 so that the version is pinned?

The version is pinned because only one boost version can be installed in the system at any given time.

yurivict avatar Feb 21 '25 07:02 yurivict

Can boost compatibility be fixed?

yurivict avatar Mar 06 '25 16:03 yurivict

Yes, but I'm busy recently. It should not be a hard job, let me try today.

BewareMyPower avatar Mar 07 '25 02:03 BewareMyPower

I just tried 1.87. There are many API changes not only just the io_service, so it still needs some time to adapt the latest Boost.Asio API.

BewareMyPower avatar Mar 07 '25 03:03 BewareMyPower

As a workaround, you can add Asio (not Boost.Asio) directly into your project and build with -DUSE_ASIO=ON option.

BewareMyPower avatar Mar 07 '25 04:03 BewareMyPower

I drafted a PR (https://github.com/apache/pulsar-client-cpp/pull/477) but might not have time addressing failed tests (if possible) next week.

BewareMyPower avatar Mar 09 '25 14:03 BewareMyPower

@BewareMyPower I noticed it's been a while since the last update - just checking if you're still working on this?

hdu-sdlzx avatar Sep 30 '25 09:09 hdu-sdlzx

No.

BewareMyPower avatar Sep 30 '25 14:09 BewareMyPower

But I will pick up this issue soon

BewareMyPower avatar Oct 03 '25 11:10 BewareMyPower