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

Add support for C++20 modules #1252

Open
ChuanqiXu9 opened this issue Feb 16, 2023 · 5 comments
Open

Add support for C++20 modules #1252

ChuanqiXu9 opened this issue Feb 16, 2023 · 5 comments
Labels
feature New or improved feature help wanted The ccache maintainers need your help

Comments

@ChuanqiXu9
Copy link

ChuanqiXu9 commented Feb 16, 2023

C++20 Named Modules introduce new dependent information to the project, so the legacy dependency discovery method doesn't work properly for C++20 Named Modules. clang-scan-deps has just landed the support for discovering dependencies for named modules. The manual can be found here: https://clang.llvm.org/docs/StandardCPlusPlusModules.html#discover-dependencies. It would be pretty cool if ccache could support named modules.

@ChuanqiXu9 ChuanqiXu9 added the feature New or improved feature label Feb 16, 2023
@jrosdahl jrosdahl changed the title ccache can't handle C+20 Named modules properly now Add support for C++20 modules Feb 16, 2023
@jrosdahl jrosdahl added the help wanted The ccache maintainers need your help label Feb 16, 2023
@bharsaklemukesh975
Copy link

Can I work on this?

@ChuanqiXu9
Copy link
Author

Can I work on this?

I don't know ccache a lot. But you can contact me if you need information from modules : )

@bharsaklemukesh975
Copy link

Hello @ChuanqiXu9 , Could you please provide some examples of how to use modules? I will start working on it. Looking forward to learning and implementing modules.

@ChuanqiXu9
Copy link
Author

Hello @ChuanqiXu9 , Could you please provide some examples of how to use modules? I will start working on it. Looking forward to learning and implementing modules.

Hello. https://clang.llvm.org/docs/StandardCPlusPlusModules.html is the document about how to use C++20 modules in clang. And the blog https://www.kitware.com/import-cmake-c20-modules/ tells how to use cmake to compile C++20 modules. It may be a good start to use cmake to compile the hello world example.

And for the ccache, I think the key point is the p1689 format produced from clang-scan-deps. You can find the document in https://clang.llvm.org/docs/StandardCPlusPlusModules.html#discover-dependencies. And you can find the formal paper in https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1689r5.html.

For the more complex example, I think https://github.com/alibaba/async_simple/tree/CXX20Modules is the most complex example for modules as far as I know. You can find there a lot of module interfaces there. So I think it would be a great success if the ccache works for that one. Note that for the above example in async_simple, you would better to use the same standard library otherwise there may be problems.

@kelteseth
Copy link

We now track ccache modules support progress at https://arewemodulesyet.org/tools/ . Feel free to create a PR if the status changes at https://github.com/kelteseth/arewemodulesyet/ 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New or improved feature help wanted The ccache maintainers need your help
Projects
None yet
Development

No branches or pull requests

4 participants