firebase / firebase-cpp-sdk

Firebase C++ SDK
http://firebase.google.com
Apache License 2.0
279 stars 115 forks source link

[Bug] Windows Server 2016+2019 missing icu.dll #1541

Open awakecoding opened 9 months ago

awakecoding commented 9 months ago

[REQUIRED] Please fill in the following fields:

Since https://github.com/firebase/firebase-cpp-sdk/pull/1332, support for Windows Server 2016+2019 was broken due to a new dependency on icu.dll, which is only available on Windows 10, Windows 11, and Windows Server 2022.

[REQUIRED] Please describe the issue here:

Two symbols are now imported from icu.dll (ucal_getTimeZoneIDForWindowsID and u_errorName). The relevant code is in app/src/locale.cc.

Steps to reproduce:

Build for Windows, try running on Windows Server 2016 or 2019, hit the following issue:

image

Relevant Code:

The imported function is only used for time zone id mapping, the code should be modified to either use a different Windows API, or try loading icu.dll dynamically (LoadLibrary+GetProcAddress) with a proper fallback when the DLL and function is absent.

google-oss-bot commented 9 months ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

jonsimantov commented 9 months ago

This is required because a number of Firebase REST requests need to specify time zones by their IANA name rather than their Windows name, and icu.dll is the recommend way to convert between the two according to this post.

As a temporary workaround, I would suggest trying to build your own copy of icu.dll from Microsoft's open-source repo and including it with the executable.