[Bug 53354] New: Wine should provide icu.dll
https://bugs.winehq.org/show_bug.cgi?id=53354 Bug ID: 53354 Summary: Wine should provide icu.dll Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs(a)winehq.org Reporter: osmanx(a)problemloesungsmaschine.de Distribution: --- Created attachment 72742 --> https://bugs.winehq.org/attachment.cgi?id=72742 tzdb.exe Windows since at least version Windows 10 19H1 ships a icu.dll in the system directory. The VS2022 (and I think also VS2019) C++ standard library in C++20 mode uses this DLL to implement the timezone database as specified by the C++ standard. The standard library loads this DLL dynamically with LoadLibraryExW (see <https://github.com/microsoft/STL/blob/ef62d3fa0b8e4e2406b9bb74e916e1ca8a1df802/stl/src/tzdb.cpp#L66>) and throws a std::system_error (see <https://github.com/microsoft/STL/blob/ef62d3fa0b8e4e2406b9bb74e916e1ca8a1df802/stl/src/tzdb.cpp#L354> and <https://github.com/microsoft/STL/blob/ef62d3fa0b8e4e2406b9bb74e916e1ca8a1df802/stl/src/tzdb.cpp#L455>) when it cannot load it. In order to provide compatibility with modern Windows versions, IMHO Wine should thus ship a compatible icu.dll. A similar issue also exists for older Windows versions even on the Microsoft side (see <https://github.com/microsoft/STL/issues/1911>). This issue arose since I recently modernized timezone handling in OpenMPT by using C++20 chrono. For now, I have worked around the problem in OpenMPT. See <https://bugs.openmpt.org/view.php?id=1618> and <https://source.openmpt.org/browse/openmpt?op=comp&compare[]=/trunk/OpenMPT/@17667&compare[]=/trunk/OpenMPT/@17668>. Simple test case: ``` // cl /std:c++20 /permissive- /EHsc /O2 /W4 tzdb.cpp #include <chrono> #include <iostream> #include <stdexcept> #include <windows.h> int main() { try { std::chrono::get_tzdb_list(); } catch (const std::exception & e) { std::cerr << "FAIL: " << e.what() << std::endl; return 1; } std::cout << "OK" << std::endl; return 0; } ``` tzdb.exe attached. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=53354 Austin English <austinenglish(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source, testcase -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=53354 Vitaly Lipatov <lav(a)etersoft.ru> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lav(a)etersoft.ru -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=53354 m0rvj <johnpgoodman(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |johnpgoodman(a)gmail.com --- Comment #1 from m0rvj <johnpgoodman(a)gmail.com> --- Yes this has become important... We need two dlls icuuc.dll icuin.dll The libraries are open source which should help. https://github.com/unicode-org/icu. I have found installing the dlls lets me install the app I maintain for winehq but once running we get a crash so we have to recommend users continue with the old version for now. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=53354 Thomas Bleher <ThomasBleher(a)gmx.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ThomasBleher(a)gmx.de --- Comment #2 from Thomas Bleher <ThomasBleher(a)gmx.de> --- Microsoft patches the ICU library, and thankfully provides the patches as open source: https://github.com/microsoft/icu . I think Wine should use this library as its base. Windows also installs some files needed by ICU to c:\windows\globalization\icu, notably: - icudtl.dat - metaZones.res - timezoneTypes.res - windowsZones.res - zoneinfo64.res Some apps need these files to work properly; AFAIK these files are all derived from ICU data, but I haven't yet tried to reproduce these files from the published repo. I asked at https://www.winehq.org/mailman3/hyperkitty/list/wine-devel(a)winehq.org/thre... how to best add ICU to Wine (since I don't know how best to add a relatively large library like ICU to Wine), but did not receive a reply yet. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=53354 --- Comment #3 from Nikolay Sivov <bunglehead(a)gmail.com> --- I think there are two options basically. We either import that in its entirety under /libs or use addon model same as wine-mono or wine-gecko. If it was only used from crt modules, we didn't have to use exactly icu.dll, but I think current versions also provide headers for ICU itself to be used directly by applications. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=53354 --- Comment #4 from Jörn Heusipp <osmanx(a)problemloesungsmaschine.de> --- I do not think an addon module like mono or gecko would be desirable here. At least in the MSVC C++ Standard library case that I originally outlined, any user would only ever notice the missing addon when things do not work correctly and possibly crash. There is no practical way to detect the need for ICU in this case before running the program, and even at runtime the user could only ever get notified about the missing DLLs by Wine modifying LoadLibrary and friends to print an explicit warning in this particular case, which sounds like kind of the wrong approach to me. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=53354 --- Comment #5 from Thomas Bleher <ThomasBleher(a)gmx.de> --- Thanks Nikolay for the guideline - that is helpful! I agree with Jörn that ideally Wine should include ICU by default. However, ICU is quite a bit larger than currently imported libraries - just the icu directory of the microsoft icu repo is >170MB. Not sure whether such a large library will be accepted directly? I'm currently testing whether I can cross-compile the Microsoft ICU libraries on Linux. I notice that while Microsoft publishes the source code at https://github.com/microsoft/icu, it doesn't seem to publish the build script for the system DLL - the patches mention a define ICU_DATA_DIR_WINDOWS, which has to be set for the system DLL, but there doesn't seem to be any build rules that set it. This also means that the nuget packages that are published by Microsoft (see https://www.nuget.org/profiles/ms-icu), whose build script are included in the repo, probably cannot be used directly as system libraries (though I haven't tried this yet). -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=53354 JAzuQbCwGyJtVSSIwVF9PF8gmVmMhnHp(a)pm.me changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |JAzuQbCwGyJtVSSIwVF9PF8gmVm | |MhnHp(a)pm.me --- Comment #6 from JAzuQbCwGyJtVSSIwVF9PF8gmVmMhnHp(a)pm.me --- In case anyone wanted to take this to completion, https://github.com/FaithLife-Community/icu/releases/tag/72.1-custom%2B4 is getting very close to figuring out what Microsoft did (using the open source repo + publicly available docs). Still for some reason some locales had to be removed in order for it to work. This commit has more details: https://github.com/FaithLife-Community/icu/commit/1138d63bd36528734f372b0da1... Github actions is setup, these binaries should work for other wine apps if needed. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=53354 --- Comment #7 from Jörn Heusipp <osmanx@problemloesungsmaschine.de> --- Given the mess (see <https://bugs.openmpt.org/view.php?id=1933>) that was caused by adding icu.dll in Wine 10.20 and adding stub functions that just crash, I have to strongly recommend to not do that. Not adding the functions is actually preferable as it would cause MSVC STL to fail the GetProcAddress calls instead of calling crashing functions. We had to yet again work-around what Wine has done. Given that is has been suggested that 11.1 will do the same as 10.20 has done (<https://gitlab.winehq.org/wine/wine/-/commit/ff0d64407266f7b9780f05845dd34c58c11ecae7>), we have now blacklisted proper tzdb support for all past, current, and future Wine versions in OpenMPT. Roughly 50% of our users on Wine are using Wine staging and not Wine stable, so it is important for us that OpenMPT also works with intermediate development releases of Wine. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (2)
-
WineHQ Bugzilla -
WineHQ Bugzilla