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

boost url does not build in single thread #684

Closed
ropieur opened this issue Feb 15, 2023 · 9 comments · Fixed by #689
Closed

boost url does not build in single thread #684

ropieur opened this issue Feb 15, 2023 · 9 comments · Fixed by #689
Assignees

Comments

@ropieur
Copy link

ropieur commented Feb 15, 2023

Hi,
I am wondering the reason why boost url couldn't be used in single threaded.
Woudn't be possible to allow building it in single thread?
Thank you

@pdimov
Copy link
Member

pdimov commented Feb 15, 2023

What specific issue are you having?

@ropieur
Copy link
Author

ropieur commented Feb 15, 2023

Our internal crosscompiler mingw32 (single thread compiler) complaints about std::mutex.

10:20:19  In file included from ./boost/url/grammar/impl/range_rule.hpp:16,
10:20:19                   from ./boost/url/grammar/range_rule.hpp:600,
10:20:19                   from ./boost/url/grammar.hpp:29,
10:20:19                   from ./boost/url.hpp:13,
10:20:19                   from ./boost/url/src.hpp:28,
10:20:19                   from libs/url/src/src.cpp:10:
10:20:19  ./boost/url/grammar/recycled.hpp:108:10: error: 'mutex' in namespace 'std' does not name a type
10:20:19    108 |     std::mutex m_;
10:20:19        |          ^~~~~
10:20:19  ./boost/url/grammar/recycled.hpp:19:1: note: 'std::mutex' is defined in header '<mutex>'; did you forget to '#include <mutex>'?
10:20:19     18 | #include <stddef.h> // ::max_align_t
10:20:19    +++ |+#include <mutex>
10:20:19     19 | 

@vinniefalco
Copy link
Member

vinniefalco commented Feb 17, 2023

Alan, some notes for fixing this:

mutex doesn't work in a single threaded build of libstdc++. you need to, say, provide a macro disabling the mutex in single threaded mode like BOOST_SYSTEM_DISABLE_THREADS:

boostorg/system@53c0084

@ropieur
Copy link
Author

ropieur commented Feb 17, 2023

Thank you @vinniefalco . May I expect to see this improvement in the next release of boost (1.82.0) ?

@vinniefalco
Copy link
Member

Yes

@ropieur
Copy link
Author

ropieur commented Feb 17, 2023

Great to hear. I close the ticket.

@ropieur ropieur closed this as completed Feb 17, 2023
@vinniefalco
Copy link
Member

Well lets keep it open so Alan knows to work on it :)

@vinniefalco vinniefalco reopened this Feb 17, 2023
alandefreitas added a commit to alandefreitas/url that referenced this issue Feb 20, 2023
alandefreitas added a commit to alandefreitas/url that referenced this issue Feb 20, 2023
@alandefreitas
Copy link
Member

@ropieur could you try this branch? This implementation uses BOOST_SYSTEM_DISABLE_THREADS as a reference.

(I'm duplicating #689 (comment) in case @ropieur is getting notifications from the issue only)

alandefreitas added a commit to alandefreitas/url that referenced this issue Feb 21, 2023
alandefreitas added a commit to alandefreitas/url that referenced this issue Feb 21, 2023
alandefreitas added a commit that referenced this issue Feb 22, 2023
@ropieur
Copy link
Author

ropieur commented Mar 13, 2023

@alandefreitas,
Thank you for the fix. Sorry for the delay. I will check internally how we can verify the branch.

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

Successfully merging a pull request may close this issue.

4 participants