-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[DRAFT][libc++][modules] Improves std.compat module. #74945
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
Conversation
You can test this locally with the following command:darker --check --diff -r cd6e462d012f289cc4ec12927ca8198f9ed1469e...755d04c9279b197ee93e97d4c3c84ea8cc4eb25a libcxx/utils/generate_libcxx_cppm_in.py View the diff from darker here.--- generate_libcxx_cppm_in.py 2023-12-10 11:54:32.000000 +0000
+++ generate_libcxx_cppm_in.py 2023-12-10 11:56:56.308250 +0000
@@ -13,11 +13,10 @@
from libcxx.header_information import header_restrictions
from libcxx.header_information import headers_not_available
def write_file(module):
-
# TODO REMOVE THIS HACK, WE NEED A BETTER WAY TO DETECT C HEADERS
Module_headers = (
module_headers
if module == "std"
else [
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick action.
I am wondering if we can make this better to remove the duplicated includes completely (like ).
For example, is it valid to do the following:
export module std.compat;
export import std;
export using double_t = std::double_t;
Probably we can. For now I was mainly focusing on getting |
Based on @ChuanqiXu9's suggestion in llvm#71438.
b4031b7
to
755d04c
Compare
This patch is on hold. There are issues to get this working in our build infrastructure. For unrelated reasons to this patch there are some improvements I want to make in the infrastructure. I expect that that solves my issues with this patch too. |
Got it. I was curious why it is problematic since I thought the cmake should handle that well. But if we can't land this before the branching of 18, I'll strongly suggest to not ship the std.compat module since this patch is essential to the usability of std.compat module. |
I expected that too, but it didn't. The other issue is the test infrastructure using CMake is problematic for several reasons. The main reason to use CMake was the module partition per header. Since we changed that design we only have 2 modules to build. This can be done manually. The proof-of-concept I have removes about 200 lines of code and removes the CMake 3.26 requirement to test modules with libc++. (Users still need a new CMake when they want to use modules.)
I'm not sure that's a good idea. However I expect to finish the code part next week. Due to holidays it might take a bit longer than usual to land. |
If I read correctly, do you mean there is a problem in cmake to handle the dependencies? If yes, we need to report that to cmake.
Yeah, it is not hurry since we still have one month from that. And in case we can't make it, it shouldn't be a bad idea to not ship std.compat module only since I think std module should work in most cases. |
I'm not sure whether it's a cmake issue. I do some manual dependency management. So it might be my code that's wrong. This code is quite "old". It was written when cmake and clang-scan-deps was still under heavy development. I never cleaned it up. Doing that was originally the plan to do in this PR, but I switched to a different approach. |
I've created a stacked review for multiple module changes. Since this was not part of a stacked review I've created a new PR #76330. |
Based on @ChuanqiXu9's suggestion in #71438.