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@winehq.org Reporter: osmanx@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.
https://bugs.winehq.org/show_bug.cgi?id=53354
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, source, testcase
https://bugs.winehq.org/show_bug.cgi?id=53354
Vitaly Lipatov lav@etersoft.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |lav@etersoft.ru
https://bugs.winehq.org/show_bug.cgi?id=53354
m0rvj johnpgoodman@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |johnpgoodman@gmail.com
--- Comment #1 from m0rvj johnpgoodman@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.
https://bugs.winehq.org/show_bug.cgi?id=53354
Thomas Bleher ThomasBleher@gmx.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |ThomasBleher@gmx.de
--- Comment #2 from Thomas Bleher ThomasBleher@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@winehq.org/thread... 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.
https://bugs.winehq.org/show_bug.cgi?id=53354
--- Comment #3 from Nikolay Sivov bunglehead@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.
https://bugs.winehq.org/show_bug.cgi?id=53354
--- Comment #4 from Jörn Heusipp osmanx@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.
https://bugs.winehq.org/show_bug.cgi?id=53354
--- Comment #5 from Thomas Bleher ThomasBleher@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).
https://bugs.winehq.org/show_bug.cgi?id=53354
JAzuQbCwGyJtVSSIwVF9PF8gmVmMhnHp@pm.me changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |JAzuQbCwGyJtVSSIwVF9PF8gmVm | |MhnHp@pm.me
--- Comment #6 from JAzuQbCwGyJtVSSIwVF9PF8gmVmMhnHp@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.