-
Notifications
You must be signed in to change notification settings - Fork 580
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
Bump Boost shipped for Windows to v1.87 #10278
base: master
Are you sure you want to change the base?
Conversation
@julianbrost @yhabteab @oxzi In your own interest, please pin Boost to < v1.87 for now. boost::asio::spawn() doesn't take boost::coroutines::attributes anymore. |
... which is pretty annoying, seems that it works only with fibers now: boostorg/asio@df973a8#diff-4f46281483e5218aa919801a401dcd5b4c19704daa16f036e52da35a2860109dL1320 Definitely nothing for v2.14.4! |
That's only a very short-term solution. This will turn into a bigger problem as soon as any distro starts shipping that version. So this needs a proper solution in any case. |
Exactly. A bridge technology. I mean, aren't you happy that I'm
Yet, both Ubuntu 25 and Fedora 42 have Boost 1.83. OpenBSD 7.7 has v1.84 yet, on NixOS pinning is easiest of all I guess and MacOS isn't even officially supported.
Sure. A long-term solution. |
I don't say this must go into 2.14.4, I'm just saying that we shouldn't wait until "oh fuck, Fedora 44 is here and we can't build packages". |
0fb35e6
to
31e2cce
Compare
Note
|
A theoretical option is still doing the AL2-move, i.e building Icinga-boost 1.86 packages for that one or two $OS. (It's funny because normally that's been done due to Boost being too OLD, not too NEW.😅) Sound radical, but:
Note on the test failureUnmodified(WHERE master = 1065d3b)
This just says us the Timeout callback, Has the coroutine even been started?--- a/test/base-io-engine.cpp
+++ b/test/base-io-engine.cpp
@@ -20,2 +20,3 @@ BOOST_AUTO_TEST_CASE(timeout_run)
boost::asio::spawn(strand, [&](boost::asio::yield_context yc) {
+ BOOST_CHECK_EQUAL(called, 1337);
boost::asio::deadline_timer timer (io); Now the test fails exactly like above, not with 1337, so the answer is no. We need to go deeper...--- a/test/base-io-engine.cpp
+++ b/test/base-io-engine.cpp
@@ -2,40 +2,46 @@
#include "base/io-engine.hpp"
#include "base/utility.hpp"
#include <boost/asio.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <BoostTestTargetConfig.h>
+#include <memory>
#include <thread>
using namespace icinga;
BOOST_AUTO_TEST_SUITE(base_io_engine)
BOOST_AUTO_TEST_CASE(timeout_run)
{
boost::asio::io_context io;
boost::asio::io_context::strand strand (io);
int called = 0;
+ auto workGuard (std::make_unique<decltype(boost::asio::make_work_guard(io))>(boost::asio::make_work_guard(io)));
boost::asio::spawn(strand, [&](boost::asio::yield_context yc) {
+ BOOST_CHECK_EQUAL(called, 1337);
boost::asio::deadline_timer timer (io);
Timeout timeout (strand, boost::posix_time::millisec(300), [&called] { ++called; });
BOOST_CHECK_EQUAL(called, 0);
timer.expires_from_now(boost::posix_time::millisec(200));
timer.async_wait(yc);
BOOST_CHECK_EQUAL(called, 0);
timer.expires_from_now(boost::posix_time::millisec(200));
timer.async_wait(yc);
+ workGuard = nullptr;
});
std::thread eventLoop ([&io] { io.run(); });
+ BOOST_CHECK_EQUAL(called, 23);
io.run();
+ BOOST_CHECK_EQUAL(called, 42);
eventLoop.join();
BOOST_CHECK_EQUAL(called, 1);
}
BOOST_AUTO_TEST_CASE(timeout_cancelled) This one was my previous printf-debugger and it hangs at |
It was removed in Boost 1.87.
not just boost::coroutines::detail::forced_unwind. This is needed because as of Boost 1.87, boost::asio::spawn() uses Fiber, not Coroutine v1. boostorg/asio@df973a85ed69f021 This is safe because every actual exception shall inherit from std::exception. Except forced_unwind and its Fiber equivalent, so that `catch(const std::exception&)` doesn't catch them and only them.
lib/base/io-engine.hpp
Outdated
boost::coroutines::attributes(GetCoroutineStackSize()) // Set a pre-defined stack size. | ||
#endif // BOOST_VERSION >= 108700 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record, this affects only Windows, currently. (Remember! WE control what we ship there.)
boost::coroutines::attributes(GetCoroutineStackSize()) // Set a pre-defined stack size. | ||
#endif // BOOST_VERSION >= 108000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also affects:
- Fedora 39+ (all)
- Ubuntu 24.04+
No description provided.