context icon indicating copy to clipboard operation
context copied to clipboard

Cygwin problem caused by config.hpp defining BOOST_USE_UCONTEXT

Open pdimov opened this issue 4 years ago • 10 comments

https://github.com/boostorg/context/blob/fb0f3eab4d14ce2de4cf3a5446c8a0f735a9282d/include/boost/context/detail/config.hpp#L33-L35

defines BOOST_USE_UCONTEXT on Cygwin. This causes Fiber to fail to build, because it tries to use ucontext, but Context is built with fcontext.

If Context is built with ucontext instead, Fiber builds, but then Coroutine fails, because it needs fcontext:

https://github.com/boostorg/coroutine/blob/4e47f98d44ad0d5d487788ed6eb4d347489e5483/src/detail/coroutine_context.cpp#L68

Should config.hpp be defining BOOST_USE_UCONTEXT on Cygwin?

pdimov avatar Jun 03 '21 16:06 pdimov

Ah, that's https://github.com/boostorg/context/pull/155. Well it breaks one of Fiber or Coroutine, then.

pdimov avatar Jun 03 '21 16:06 pdimov

boost.coroutine is deprecated

olk avatar Jun 03 '21 18:06 olk

ASIO depends on Coroutine, so whether it's "deprecated" or not is of no relevance. It must work.

pdimov avatar Jun 03 '21 19:06 pdimov

ASIO should switch to boost.context instead of using deprecated boost.coroutine.

Peter Dimov @.***> schrieb am Do., 3. Juni 2021, 21:00:

ASIO depends on Coroutine, so whether it's "deprecated" or not is of no relevance. It must work.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/boostorg/context/issues/172#issuecomment-854104454, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG7IQAFT52VI24AOK2TICTTQ7GN7ANCNFSM46BERHOA .

olk avatar Jun 03 '21 19:06 olk

That's not my department. I'm just seeing that Fiber fails to build on Cygwin, and am telling you that it does, and why.

pdimov avatar Jun 03 '21 22:06 pdimov

New Fiber failure after the latest changes:

[ 21%] Building CXX object libs/fiber/CMakeFiles/boost_fiber.dir/src/algo/algorithm.cpp.o
In file included from /home/travis/build/boostorg/boost-root/libs/fiber/src/algo/algorithm.cpp:9:0:
/home/travis/build/boostorg/boost-root/libs/fiber/include/boost/fiber/context.hpp:26:42: fatal error: boost/context/detail/apply.hpp: No such file or directory
compilation terminated.

pdimov avatar Jun 03 '21 22:06 pdimov

New Fiber failure after the latest changes

fixed

olk avatar Jun 04 '21 04:06 olk

fixed

Indeed, thanks.

ASIO should switch to boost.context instead of using deprecated boost.coroutine.

I've looked at your PR https://github.com/boostorg/asio/pull/55 that does exactly that, but it seems to me that even if accepted, it won't solve the issue here. It would just move the dependency on fcontext from Coroutine to Asio, but building Context with ucontext will still break asio::spawn.

pdimov avatar Jun 04 '21 23:06 pdimov

I've been able to get fcontext working in cygwin as described here:

https://cygwin.com/pipermail/cygwin-developers/2020-September/011970.html

It also seems the ucontext is broken for the same reason that fcontext was:

https://cygwin.com/pipermail/cygwin-developers/2021-December/012536.html

corngood avatar Dec 22 '21 02:12 corngood

I've been able to get fcontext working in cygwin as described here:

https://cygwin.com/pipermail/cygwin-developers/2020-September/011970.html

It also seems the ucontext is broken for the same reason that fcontext was:

https://cygwin.com/pipermail/cygwin-developers/2021-December/012536.html

This means that some fixes have to be done in the cygwin?!

olk avatar Sep 18 '22 14:09 olk