D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 15376 - The time zone name conversions should not be compiled into Phobos
Summary: The time zone name conversions should not be compiled into Phobos
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P1 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-23 03:20 UTC by Jonathan M Davis
Modified: 2016-03-19 20:22 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jonathan M Davis 2015-11-23 03:20:08 UTC
As it stands, every time that Microsoft changes the list of time zones that they have, tzDatabaseNameToWindowsTZName and windowsTZNameToTZDatabaseName in std.datetime have to be updated, and it's proven to be a maintenance problem (not to mention that it means that older releases won't work properly with Windows machines that have been properly updated). So, we should introduce a way to get those conversions at runtime rather than compile time (presumably by reading in the windowsZones.xml file that the conversions come from in the first place) and then deprecate tzDatabaseNameToWindowsTZName, windowsTZNameToTZDatabaseName, and TimeZone.getTimeZone.
Comment 2 github-bugzilla 2016-01-23 14:06:03 UTC
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/635cecee557bf5e82b2f614dd19e41383505c3f7
Fix for issue# 15376. Get time zone conversions at runtime.

It's proven to be a maintenance problem to maintain the time zone
conversions between the IANA TZ database names and the Windows time zone
names in std.datetime. So, rather than compiling them in, this provides
a way to get them at runtime (which will also make it so in the future,
older releases can work properly on up-to-date Windows boxes, which is
not the case currently with regards to time zone conversions). The
current conversion functions can be deprecated after parseTZConversions
has been out for a release (so that it's possible for users to compile
their code for two releases in a row without getting deprecation
messages).

https://github.com/D-Programming-Language/phobos/commit/6be2087858765bdf8b3439ba9cfc4fc2d5e543a7
Merge pull request #3824 from jmdavis/issue15376

Fix for issue# 15376. Get time zone conversions at runtime.
Comment 3 Jonathan M Davis 2016-02-08 02:54:08 UTC
Technically, removing the functions with the hard-coded conversions would be what's required to fix this bug per its title, but the new functionality is in place now, and the old functionality will be deprecated after the new functionality has been out for a release and eventually removed with the completion of the deprecation cycle, so I'm going to mark this as fixed.