r/haskell • u/yitz • Sep 26 '21
Big problems at the timezone database
https://blog.joda.org/2021/09/big-problems-at-timezone-database.html42
u/AshleyYakeley Sep 26 '21
I'm a little bit concerned about this:
And I am in a position where I could well have to defend it, as I am UCLA teaching professor who has institutional obligations in the areas of equity, diversity and inclusion.
Making decisions about the tzdb on the basis of obligations to the University of California seems like a conflict of interest to me?
9
u/1331 Sep 27 '21 edited Sep 27 '21
In the blog post, Colebourne wrote:
(Technically, the data has moved, not been deleted. But the file containing the moved data is never normally used by downstream systems, thus to all intents and purposes it has been deleted.)
I was not aware of such secondary data. Is this the "extras" of the complete distribution? Here are some questions that come to mind.
Is this data normally installed (in /usr/share/zoneinfo), or is it something that is generally only included in the upstream tarball?
Would it be possible for timezone-olson to provide an API to load this data, for applications that need to make use of it? What are the costs/downsides involved?
15
u/AshleyYakeley Sep 27 '21
Yeah, I thought that was pretty weird too. Apparently it's called "backzone" and AFAICT it's something like a build flag that basically no-one switches on, so it doesn't end up installed.
Technically, the data has moved, not been deleted.
"Buried" would be a good word for this.
7
u/1331 Sep 27 '21
Thanks!
Investigating, it is in a file named
backzone, available in the complete and data only distributions. This file is indeed not installed in/usr/share/zoneinfoon my system (Arch). Looking at theMakefile, the relevant build flag isPACKRATDATA:# If you want out-of-scope and often-wrong data from the file 'backzone', use # PACKRATDATA= backzone # To omit this data, use # PACKRATDATA= PACKRATDATA=There seem to be many warnings against using the
backzonedata, so "buried" does indeed seem to be an apt term.Regarding the idea of providing an API to optionally use the
backzonedata, it looks like the biggest problem is getting the data. It is generally not installed by the OS, and a C program must be built and run to process the source file to the binary format that timezone-olson parses.I have tentative plans to develop a package that caches
TimeZoneSeriesdata to serve as a fallback on platforms without/usr/share/zoneinfo. I wrote about it in a blog entry titled Cross-Platform Time Zones in Haskell, but the general idea is to use timezone-olson-th in an internal package and copy the splices to the package that is uploaded to Hackage, which would not need dependencies on timezone-olson or timezone-olson-th. Critically, the package needs to be well maintained so that it is kept current with the IANA updates.If there is interest, perhaps it would be worthwhile to implement an API in that package for
backzonesupport. The C program is built and run on Linux as part of the package build process, so it should not be a problem to use the above flag. Perhaps the biggest drawback is that the size of the package is increased. If the size increase is measured to be significant, perhaps abackzoneversion could be put in a separate package, allowing users to choose on a package level and avoid any unnecessary size increase.2
u/phadej Oct 03 '21
Check https://hackage.haskell.org/package/tzdata so you dont end up reimplementing parts of it.
7
u/1331 Sep 26 '21
There is some discussion on the HN thread as well. I am quite surprised (and disappointed) that such a change is being pushed through.
17
u/yitz Sep 26 '21
As maintainer of some Haskell libraries involving timezones, here is my response.
This thread on /r/java was also cross-posted to /r/programming.