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

Please, remove the new Boost dependency #982

Closed
aberaud opened this issue Sep 16, 2021 · 9 comments
Closed

Please, remove the new Boost dependency #982

aberaud opened this issue Sep 16, 2021 · 9 comments

Comments

@aberaud
Copy link
Contributor

aberaud commented Sep 16, 2021

Boost was not required by previous versions of msgpack-c and it was working just fine.

msgpack-c was a very lightweight library, while Boost is huge, and has a super complex and boost-specific build system, even when only using headers.

There seems to be no actual technical reason to require Boost, beyond ease of maintenance for msgpack-c maintainers. But this decision pushes the maintenance cost of the new dependency to every user of the library!

This would add a significant new dependency to our project and significant new short-term and long-term maintenance costs, for a library that is not actually required by msgpack... Please reconsider adding Boost as a dependency.

@redboltz
Copy link
Contributor

Since the version 1.2.0 (Sep 2015), msgpack-c has already depended on the Boost Libraries.
See:
https://github.com/msgpack/msgpack-c/tree/cpp-1.2/include/msgpack/predef
https://github.com/msgpack/msgpack-c/tree/cpp-1.2/include/msgpack/preprocessor

It was a weird approach. Get some version of the Boost Libraries and convert them to msgpack as follows:
https://github.com/msgpack/msgpack-c/blob/cpp-1.2/CMakeLists.txt#L79-L87
It was very difficult to maintain. Boost License allows this approach but this is a kind of hidden dependency.
In addition, the converted boost could be the different version of user's boost version.

There were many problems. So we decided to more straight forward approach.
If you don't want to install boost libraries, you don't need to do that.
Just copy boost headers on the specific directory, and add the directory to the include path.
This is almost the same approach as the version 1.2.0 did.
msgpack-c (C++) should work on this approach.
There is one small constraint that you can't do test. But it is the similar as older versions of msgpack-c. That requires gtest 1.7.0 to test.

@aberaud
Copy link
Contributor Author

aberaud commented Sep 16, 2021

Thanks a lot for the explanation.
Even though I understand the reasons behind this choice, the previous approach still added significant value for non-Boost users of the library. Since the library is developed only once and used many times by many people, the total cost of maintaining and using this library skyrocketed.

Given the low number of changes in the project since last year, I still believe it would be reasonably possible to make Boost optional again. Please consider that possibility, as it would truely make life simpler for many users (see #978 for instance).

In our project, we build a tree of dependencies for many target platforms, like MSVC, Linux, iOS, macOS, Android, so every new dependency means significant long-term maintenance to integrate it and maintain it into our build system.

We used to see msgpack-c as a lightweight, low maintenance cost, and low-risk dependency. All of these assumptions now seem to be false. We probably would not have chosen msgpack as a serialization format to begin with if it required adding Boost to our project (and maintaining it in our build system in the long run just for that serialization library).

@redboltz
Copy link
Contributor

I think that you can fork the project and introduce Boost conversion approach again on your fork.
You can use any version of Boost (not too old) as converting source.
I recommend that if some fix is found is the boost (Predef and Preprosessor), you need to updated your converted source.

Or msgpack-c (C) is not depends on boost. It could be a candidate.

@redboltz
Copy link
Contributor

@ygj6 , could you post commet?

@HorstBaerbel
Copy link

HorstBaerbel commented Jan 20, 2022

This pulls in the whole of Boost and zlib when using this library via Conan and there's nothing one do about it (which, agreed, is not fully msgpacks fault). Additionally currently the Conan recipe for boost/1.78.0 + MSVC is broken, so msgpack-cxx is basically unusable for me...
It would probably be a lot of work, but shouldn't the stdlib be enough? For tests imo catch2 is better anyway.

@redboltz
Copy link
Contributor

redboltz commented Feb 5, 2022

It seems that the Conan MSVC boost issue. I guess that is would be solved soon.
Boost is not only for test. See #982 (comment)

@redboltz
Copy link
Contributor

redboltz commented Feb 8, 2022

I created #1001
You can remove boost package dependency using cmake -DMSGPACK_USE_BOOST=OFF.
Could someone try this?
However, the implicit dependency of boost is never removed. msgpack-c C++ depends on boost preprocessor and predef as version 3.0.0.

In C++ compiler, when you set -DMSGPACK_NO_BOOST option (define MSGPACK_NO_BOOST macro), then msgpack-c use the implicit converted boost libraries instead of normal boost libraries.

I have no plan to change the default value MSGPACK_USE_BOOST to OFF.
I'm not sure package management system but the package manager can set the cmake option and can create msgpack-c package without boost packeage.

@aberaud
Copy link
Contributor Author

aberaud commented Feb 10, 2022

Thanks a lot for your work !

@redboltz
Copy link
Contributor

Solved by #1002. msgpack-c implicitly depends on boost even if MSGPACK_NO_BOOST is defined.

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

No branches or pull requests

3 participants