[fpc-devel] Timezones

Zachary Vance za3k at za3k.com
Sun Nov 15 04:20:50 CET 2015


I'm reporting a bug the Debian reproducibility team came across (in 2.6.4-1), trying to make Pascal builds reproducible. The end goal is to see UTC timestamped output of ppudump.

My understanding of the current behavior is that the timezone file is chosen something like this:

TIMEZONE_FILE = [CONTENT of /etc/timezone if it exists]:/etc/localtime:/usr/lib/zoneinfo/localtime[:/usr/share/zoneinfo if BSD]:/var/db/timezone/localtime:localtime
If TIMEZONE_FILE doesn't start with / (is a relative path), prepend (${TZDIR} or /usr/share/zoneinfo)

This means that if /etc/timezone or /etc/localtime exist, there is no way to specify that UTC should be used.

---

The desired behavior probably be to respect the TZ environment variable, which is currently ignored, so the new list would be:

TIMEZONE_FILE = ${TZ}:[CONTENT of /etc/timezone if it exists]:/etc/localtime:/usr/lib/zoneinfo/localtime[:/usr/share/zoneinfo if BSD]:/var/db/timezone/localtime:localtime
If TIMEZONE_FILE doesn't start with / (is a relative path), prepend (${TZDIR} or /usr/share/zoneinfo)

Additionally, POSIX says that if TZ is set but invalid or empty, it should default to UTC, not to localtime.



More information about the fpc-devel mailing list