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

Cygwin problem caused by config.hpp defining BOOST_USE_UCONTEXT #172

Open
pdimov opened this issue Jun 3, 2021 · 10 comments
Open

Cygwin problem caused by config.hpp defining BOOST_USE_UCONTEXT #172

pdimov opened this issue Jun 3, 2021 · 10 comments

Comments

@pdimov
Copy link
Member

pdimov commented Jun 3, 2021

#if ! defined(BOOST_USE_UCONTEXT) && defined(__CYGWIN__)
# define BOOST_USE_UCONTEXT
#endif

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
Copy link
Member Author

pdimov commented Jun 3, 2021

Ah, that's #155. Well it breaks one of Fiber or Coroutine, then.

@olk
Copy link
Member

olk commented Jun 3, 2021

boost.coroutine is deprecated

@pdimov
Copy link
Member Author

pdimov commented Jun 3, 2021

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

@olk
Copy link
Member

olk commented Jun 3, 2021 via email

@pdimov
Copy link
Member Author

pdimov commented Jun 3, 2021

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
Copy link
Member Author

pdimov commented Jun 3, 2021

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.

@olk
Copy link
Member

olk commented Jun 4, 2021

New Fiber failure after the latest changes

fixed

@pdimov
Copy link
Member Author

pdimov commented Jun 4, 2021

fixed

Indeed, thanks.

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

I've looked at your PR boostorg/asio#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.

@corngood
Copy link

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

@olk
Copy link
Member

olk commented Sep 18, 2022

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?!

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