-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix CFTimeZone crashes on Windows #5070
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
Fix CFTimeZone crashes on Windows #5070
Conversation
@swift-ci please test |
59269b1
to
48e7023
Compare
@swift-ci please test |
@swift-ci please test Windows platform |
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.
I'm okay with the approach, but I think that we should update the script that generates the mapping.
Ah I didn't realize there was a script that generates the mapping - do you know where that lives? |
@swift-ci please test |
@swift-ci please test Windows platform |
I could've sworn that I checked that in >.< ... maybe I didn't - it was some XSLT horror. I might've just shoved it into the commit message :(. For now, lets go ahead and get this merged. |
} | ||
__CFTimeZoneIdentifierPair *current = data; | ||
while (current->source) { | ||
if (strcmp(current->source, buffer) == 0) { |
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.
We can probably do better than a linear search as a polish later
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.
Yeah ideally maybe we could pre-sort this and perform a binary search or perhaps even a fancier solution with some calculated hashes to create a dictionary-like lookup, but I'll do that as a followup on main
and just cherry-pick this back to 6.0
Do we want this in release/6.0 too if it's crashing the tests? |
Yeah, this causes crashes in things that call down to some |
* Fix CFTimeZone crashes on Windows * Fix build failure
CFTimeZone on Windows requires mappings between the Windows and Olson timezone identifiers. We unfortunately lost those mappings in the build for the re-core. This PR adds those mappings back which resolves crashes when calling into
CFTimeZone
. We add them back as literals in code rather than as plist resource files to make it easily compatible with both the CMake and SwiftPM builds. I've confirmed that when running tests on Windows the tests no longer crash withCFTimeZone
issues