Skip to content

fix(oss): explicitly enable coroutine support on g++#2503

Closed
ben-- wants to merge 1 commit into
facebook:mainfrom
ben--:oss-gcc-coroutine
Closed

fix(oss): explicitly enable coroutine support on g++#2503
ben-- wants to merge 1 commit into
facebook:mainfrom
ben--:oss-gcc-coroutine

Conversation

@ben--

@ben-- ben-- commented Sep 17, 2025

Copy link
Copy Markdown
Contributor

g++ doesn't enable coroutines by default and some upcoming changes require them. This change adds the necessary compiler flag on the open source build. The code here is brought over from fbthrift:

https://github.com/facebook/fbthrift/blob/main/CMakeLists.txt#L71-L75

Tested by including folly in a sapling build with PYTHON_EXTENSIONS enabled.

@mszabo-wikia

Copy link
Copy Markdown
Contributor

o/ I dug up the conversation where I landed this change in fbthrift (facebook/fbthrift#615) and it seems this flag might not be needed on GCC >=11 if c++20 is required (which is now the folly default). Sapling still seems to default to c++17, I wonder if that may be the issue?

@ben--

ben-- commented Nov 3, 2025

Copy link
Copy Markdown
Contributor Author

@mszabo-wikia is correct -- this change is not required if building with -std=c++20 on GCC version 11 or above.

However, if this change is dropped, someone may want to update README.md which currently reads:

folly supports gcc (5.1+), clang, or MSVC

I'm not arguing one way or another here, but folly needs to decide what its backwards-compatibility strategy ought to be.

@ben-- ben-- closed this Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants