-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Use same TimeZoneInfo implementation on iOS/tvOS as on browser #51457
Conversation
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
Thanks. Makes sense. We're probably going to need to go back to the filters and include some items that are missing, like time zone and some calendars. |
As of right now, MacCatalyst is assuming ICU is installed like the desktop build. We probably should change that since it's supposed to reflect an iOS app. |
Agreed. It could probably be even optional by offering more than one icudt.dat file.
I can change it to use full data for Mac Catalyst and we can re-evaluate it later [for ICU as a whole]. Android also uses the local data, right? It would run into the same deadlock as iOS so I guess it makes sense to change it too, at least as a stop gap measure. |
We weren't able to enable our icu on android because it requires libc++. That would have made the Xamarin android team rather.... unhappy. We are using the system icu there. |
Cool. I was checking just the dotnet/icu repository and what builds were enabled there. Let me know if you prefer Mac Catalyst to behave one way or another in this PR. Aside from that I think it's good enough to unblock the Xamarin preview4 integration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't worry about any other macatalyst change in this PR. I'd rather have that separate.
@akoeplinger please give this a review. |
@steveisok I have not looked into the issue yet (so it might not be applicable) but we do have (legacy) code, inside Mono, to handle TimeZone for macOS/iOS... If it can be reused then it would not require further changes (or more code/data) and remain compatible with the current SDK. |
The missing data are just time zone names and windows/unix time zone conversions tables (new API in .NET 6). Otherwise the implementation peeks directly into |
What's the behavior when we fix the deadlock in our icu fork? Is it just going to fail the lookup and fall back to the invariant name like it does with the minimal implementation? |
src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
Outdated
Show resolved
Hide resolved
…b.Shared.projitems Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
There is some fallback but it's not immediately obvious if it will return the same thing as the minimal implementation. My gut says it would not and that it's untested code path. It would be easy to fix though. runtime/src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.FullGlobalizationData.Unix.cs Lines 102 to 107 in 9b364cf
|
/backport to release/6.0-preview4 |
Started backporting to release/6.0-preview4: https://github.com/dotnet/runtime/actions/runs/764196749 |
Ref: xamarin/xamarin-macios#11175 (comment), https://unicode-org.atlassian.net/browse/ICU-21591
There seems to be a bug in ICU that leads to deadlock when the time zone data are stripped. Since dotnet/icu uses the same stripping of data on all the platforms the time zone data are also not present on iOS/tvOS or any platform that consumes it. So even if the deadlock itself is resolved at some point it makes sense to use the same implementation for all the platforms that rely on the filtered app-local ICU data.
I also enabled to code path on MacCatalyst to keep it consistent with iOS. I am open to change that. Android may need to be treated the same way too.