-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[libcxx] Export the formatter_integral for module build. #131778
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
|
@llvm/pr-subscribers-libcxx Author: Haojian Wu (hokein) ChangesChromium encounters another similar issue, https://crbug.com/400870610 Workaround #120108. Full diff: https://github.com/llvm/llvm-project/pull/131778.diff 1 Files Affected:
diff --git a/libcxx/include/module.modulemap b/libcxx/include/module.modulemap
index 43072aa0fb0f1..1dc1dc845cafd 100644
--- a/libcxx/include/module.modulemap
+++ b/libcxx/include/module.modulemap
@@ -926,7 +926,10 @@ module std [system] {
module to_chars { header "__charconv/to_chars.h" }
module to_chars_base_10 { header "__charconv/to_chars_base_10.h" }
module to_chars_floating_point { header "__charconv/to_chars_floating_point.h" }
- module to_chars_integral { header "__charconv/to_chars_integral.h" }
+ module to_chars_integral {
+ header "__charconv/to_chars_integral.h"
+ export * // TODO: Workaround for https://github.com/llvm/llvm-project/issues/120108
+ }
module to_chars_result { header "__charconv/to_chars_result.h" }
module traits { header "__charconv/traits.h" }
@@ -1316,7 +1319,10 @@ module std [system] {
module formatter_char { header "__format/formatter_char.h" }
module formatter_floating_point { header "__format/formatter_floating_point.h" }
module formatter_integer { header "__format/formatter_integer.h" }
- module formatter_integral { header "__format/formatter_integral.h" }
+ module formatter_integral {
+ header "__format/formatter_integral.h"
+ export * // TODO: Workaround for https://github.com/llvm/llvm-project/issues/120108
+ }
module formatter_output { header "__format/formatter_output.h" }
module formatter_pointer { header "__format/formatter_pointer.h" }
module formatter_string { header "__format/formatter_string.h" }
|
|
Can you please provide a publicly accessible explanation of the issue? https://crbug.com/400870610 is not accessible from here, and we should strive to make commit messages self-explanatory. FWIW I don't see a problem with the patch assuming the explanation makes sense, but I'd like to understand it first! |
|
I changed visibility of the bug. |
Thanks, I updated the PR description. |
|
Thanks for sharing additional information. Can you describe how you're building? You seem to be using flags that are different from the ones we use in the CI, because we do have a modules build and various modules related tests, none of which triggered this issue. I'd like to check in a regression test for this. |
|
Chromium uses |
|
@ian-twilightcoder @Bigcheese Can you make a statement about the level of support of Note that I'm not trying to push back on this patch, but I'm trying to figure out what our support matrix must be and how to catch these issues before our users (e.g. Chrome) runs into them because we have never considered those use cases. If the answer is "yes, we should be supporting |
|
We use That includes building libc++, although we use a wrapper around public STL headers rather than the module maps provided by libc++ for technical reasons. (Those wrappers just That being said, why would |
|
What is the status of this PR? |
|
There seems to be conflicts that prevent merging. I'm not opposing this patch, but I'd like us to add coverage for |
|
I have rebased this PR. |
|
@ldionne can we land this patch first to unblock the issue currently affecting chromium? I agree that adding CI to cover this case is important, but setting that up might take some time. |
|
Not sure why, but original link failure somehow disappeared in chromium. So feel free to close this. Thanks. |
There seems to be an underlying compiler bug that we haven't yet addressed that keeps evading us. (Getting a minimal reproducer is really hard with modules). |
+1, I believe this bug is still not fixed. We got lucky that unrelated changes have made it "sleep" again. I'm closing it for now. We know the reasons for #120108, fixing it properly will take some work -- the light-weight fix doesn't work since it breaks much existing code. |
Chromium encounters another similar issue, https://crbug.com/400870610. Workaround #120108 by adding necessary
export *.In Chromium, the
vulkan_to_string.hppfile (included byVkStringify.cpp) uses thestd::formatfunction. The relevant include path isformat_functions.h -> __format/format_integer.h -> __format/formatter_integral.h -> __charconv/to_chars_integral.hWhen building
VkStringify.cppwith libc++ modules, some internal function templates fail to instantiate due to template unreachability (caused by the clang bug #120108). This leads to linker errors, as seen in the build failures: