r/haskell • • Sep 26 '21

Big problems at the timezone database

https://blog.joda.org/2021/09/big-problems-at-timezone-database.html
43 Upvotes

9 comments sorted by

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.

0

u/[deleted] Sep 26 '21

[deleted]

20

u/Zeno_of_Elea Sep 27 '21

I don't think that OP was hypothesizing that 100 million people use the dates, their comment was

Absolute numbers, not percentages - if you ruin things for 100 million people, I don't really care that it's only a small percentage of the global population.

So they're saying percentages don't tell the whole story without knowing what the percent is out of.

1

u/yitz Sep 29 '21

You're right, it's totally hypothetical. But it should be required of someone who wants to destroy data being distributed to servers worldwide to provide the numbers to prove that it is not harmful before making such a change. It should not be required of those objecting to such a change. Until there are hard numbers, verifiable, that the change is causing no harm, the change should not be allowed.

42

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/zoneinfo on my system (Arch). Looking at the Makefile, the relevant build flag is PACKRATDATA:

# 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 backzone data, so "buried" does indeed seem to be an apt term.

Regarding the idea of providing an API to optionally use the backzone data, 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 TimeZoneSeries data 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 backzone support. 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 a backzone version 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.