emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.91k stars 3.32k forks source link

Handle trailing % in strftime #23045

Open hoodmane opened 1 day ago

hoodmane commented 1 day ago

"In glibc a trailing % in strftime() acts like printf, ie it's a literal %". This is breaking some Python tests. I've applied the patch suggested here: https://www.openwall.com/lists/musl/2022/12/19/2

hoodmane commented 1 day ago

I guess this would have to be addressed upstream with musl though.

sbc100 commented 1 day ago

Perhaps the python tests themselves should be updated? Otherwise they cannot run on any musl-based platform (e.g. alpine linux).

hoodmane commented 20 hours ago

Generally I try to fix both sides =) https://github.com/python/cpython/pull/127528

hoodmane commented 20 hours ago

I think it works on other musl systems as long as they support wide characters. The problem affects systems that use musl or bsd libc and where HAVE_WCSFTIME is false.

sbc100 commented 16 hours ago

Ah.. In that case we can/should also be including wcsftime.. i don't know why we don't already include that.

hoodmane commented 15 hours ago

I looked into turning that on too but I couldn't figure out how it was determined. But I think this change is an improvement in either case.

sbc100 commented 15 hours ago

This change lgtm with comments addressed.

sbc100 commented 15 hours ago

wcsftime being added in https://github.com/emscripten-core/emscripten/pull/23061