-
-
Notifications
You must be signed in to change notification settings - Fork 382
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
Support for boost asio #490
Comments
Well The commit you're referencing is part of #482 which is a follow up to #457. And while I wouldn't use the word support (since Crow is using, not supporting a dependency), yes, the idea is to get off of boost and use the standalone ASIO library instead. I understand that since some people have boost, why bother installing ASIO. But there are also 2 other categories of people, one that doesn't have boost installed, and another that dislikes boost for being a massive package. I would love to flip a switch and have both versions working, unfortunately if you look at #457, it is not at all the case. |
A lot of the deboostification is about migration to std:: so, makes a lot of sense. However, Boost.ASIO and vanilla ASIO are esseentially 100% compatible. It seems like the extra work in supporting both would be relatively minor, perhaps just shuffling some includes around, and adding some ifdef's or namespace aliases. WebSocket++ does this here: https://github.com/zaphoyd/websocketpp/blob/1b11fd301531e6df35a6107c1e8665b1e77a2d8e/websocketpp/common/asio.hpp#L45 Only supporting vanilla asio makes it much more difficult for Crow to share an io_context with other ASIO libraries (e.g. Boost.Beast or RPC frameworks like asio-grpc etc. It also means any future work on asynchronous handlers will be less useful (because you won't be able to compose asynchronous operations with service code that uses Boost.ASIO) Integrating libraries using different event loop implementations is tricky and painful, and Crow doesn't expose interfaces for making this possible. Looking at asio vanilla, at just one distro (Manjaro/Arch)
|
As the author of the #457 and the follow-up #482 PR, I'll just throw in my opinion too. I've generally disliked using Boost due to its sheer size. Asio is a part of it, but the rest just isn't needed for Crow, as it can just rely on standard features. That's why I made the push away from Boost as a dependency in favor of standalone Asio. I agree with you that supporting both would be really cool though. |
Trying to understand the above discussion, and sorry if this doesnt belong here, but the https://crowcpp.org/master/getting_started/setup/linux/ says nothing about boost is required, but I cant cmake/make without boost? |
I belong in the camp that doesn't have boost installed by default. The move to the standalone ASIO was great for me as I could drop 37 header dependencies from my project. One thing to note is that the ASIO Standalone (boost dependency free) may not be supported in the future. See chriskohlhoff/asio#1208. @TheQue42 : I ran into a similar problem in #585. If you're using HEAD then, you no longer need boost. You will need the headers from the ASIO repo. When building make sure your compiler include path can find the headers, and pass the |
Thanks for xia-stan, I finally comiple helloworld example as |
Any update on this? Really unfortunate Crow can't be used with an existing code base already having boost as a dependency. |
No. Actually there are no plans to support boost, but if you need it, feel free to add a pull request containing support for boost::asio. |
Hi guys,
What's the story with 3a48507? Is the Boost version of ASIO no longer going to be supported?
It would be preferable in my view, given that Boost is a dependency for so many code bases for other reasons, that the Boost flavor is still supported, otherwise you're just forcing an additional dependency on users.
The text was updated successfully, but these errors were encountered: