srawlins / timezone

Time zone database and time zone aware DateTime object for Dart.
BSD 2-Clause "Simplified" License
102 stars 54 forks source link

Update refresh.sh to use explicit `-b fat` option #186

Closed Pante closed 6 months ago

Pante commented 7 months ago

zic changed the default value of -b from fat to slim in 2020c. Using slim may result in incorrectly generated transition times.

srawlins commented 7 months ago

I see from the zic manpage:

Output backward-compatibility data as specified by bloat. If bloat is fat, generate additional data entries that work around potential bugs or incompatibilities in older software, such as software that mishandles the 64-bit generated data. If bloat is slim, keep the output files small; this can help check for the bugs and incompatibilities. The default is slim, as software that mishandles 64-bit data typically mishandles timestamps after the year 2038 anyway. Also see the -r option for another way to alter output size.

I don't see a reason to revert to fat.

Using slim may result in incorrectly generated transition times.

Can you give an example or cite a bug?

Pante commented 7 months ago

I maintain Sugar, another timezone library which relies on this package's zicfile reader & similar tool/refresh.sh script to generate Dart code that represents timezones. While generating the timezones with slim for the 2024a database, it caused the zicfile reader to return truncated timestamps. In particular, for America/Detroit, anything after ~2007 is omitted. It is also reflected in the generated code. Changing it to fat fixed the truncated transition timestamps. I opened this PR as I thought that this package might run into the same issue with truncated transition times.

Sidenote: It seems like I have another PR which fixes a timezone transition bug that has been sitting around waiting to be merged, would be great if you could have a look at it!