-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
4 test failures on OpenBSD x86_64 (chrono-test, gtest-extra-test, xchar-test, posix-mock-test) #3670
Comments
chrono-test and xchar-test failures indicate that locales are broken on your platform. Not sure if we can do much about it. |
Do you think it could be because of something I didn't install or configure? It's a very vanilla installation I did. |
The test is written such that it would pass even if you didn't have the correct locale installed. The problem is that your standard library is lying about the presence of locales: it successfully constructs a locale but the constructed locale behaves as classic/English. |
What standard library do you use and what does this code print on your system? #include <ctime>
#include <iomanip>
#include <iostream>
int main() {
std::time_t t = std::time(nullptr);
std::cout.imbue(std::locale("es_ES.UTF-8"));
std::cout << std::put_time(std::localtime(&t), "%a");
} |
I have a tentative fix for the posix-mock-test: 6b0082e. |
Looks like OpenBSD uses LLVM's: https://man.openbsd.org/intro.3
|
Whereas on my Mac I get "mar"; for 'martes' I assume? today being Tuesday. So wait, "Wed" makes no sense at all... oh wait the clock is wrong in that VM! |
OK, after a magic reboot, it now outputs "Tue" which is at least the right day, but the wrong language. (On my test FreeBSD VM, I also get "mar", like on my Mac.) |
Giving the output in the wrong language looks like a bug. It should either respect the locale or give an error (https://godbolt.org/z/KoW8YPqfc) when constructing an unsupported locale. Could be related to (https://man.openbsd.org/setlocale.3):
|
@seanm, could you report the issue to libc++ with the |
I can certainly do that, yes. Do you think I should report to OpenBSD or to LLVM libc++? |
I suggest reporting to LLVM libc++ even if there might be some underlying issue with system APIs. |
So it's not a libc++ bug. Filed here instead: https://marc.info/?l=openbsd-bugs&m=170010336105473&w=2 |
This is not a bug in {fmt} but intentional behaviour in the OpenBSD C library for security reasons and well documented on our locale(1), setlocale(3), wcsftime(3), and strftime(3) manual pages. Please close this ticket as invalid. |
I tried building current master (f76603f) on OpenBSD 7.3 on x86_64. It built. There were 4 test failures however. Verbose output below:
The text was updated successfully, but these errors were encountered: