View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0032937 | FPC | Compiler | public | 2018-01-03 02:09 | 2020-10-18 14:20 |
Reporter | Juliana Oliveira | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | new | Resolution | open | ||
Platform | Arch and Suse | OS | Linux | ||
Product Version | 3.0.4 | ||||
Summary | 0032937: TZ and TZDIR env vars being overwritten in Arch & Suse Linux | ||||
Description | Dear maintainers, In order to make Pascal reproducible on Linux, the Reproducible Builds team have been using TZ and TZDIR vars to force UTC timezone when analyzing ppudumps. Recently we found that this solution, which works as intended on Debian based distros AFAWK, is working neither on Arch Linux nor OpenSuse Tumbleweed. It appears that env vars are being overwritten by local timezone. A few examples follow: | Debian Unstable +------+--------------+---------+ | TZ | TZDIR | ppudump | +------+--------------+---------+ | :UTC | /nonexistent | UTC | | :UTC | --- | UTC | | --- | --- | Local | +------+--------------+---------+ | Ubuntu Bionic +------+--------------+---------+ | TZ | TZDIR | ppudump | +------+--------------+---------+ | :UTC | /nonexistent | UTC | | :UTC | --- | UTC | | --- | --- | Local | +------+--------------+---------+ | OpenSuse Tumbleweed +-------------------------+---------------------+---------+ | TZ | TZDIR | ppudump | +-------------------------+---------------------+---------+ | :UTC | /nonexistent | Local | | :UTC | --- | Local | | :UTC | /usr/share/zoneinfo | Local | | UTC | /usr/share/zoneinfo | Local | | /usr/share/zoneinfo/UTC | --- | Local | | --- | --- | Local | +-------------------------+---------------------+---------+ | Arch +-------------------------+---------------------+---------+ | TZ | TZDIR | ppudump | +-------------------------+---------------------+---------+ | :UTC | /nonexistent | Local | | :UTC | --- | Local | | :UTC | /usr/share/zoneinfo | Local | | UTC | /usr/share/zoneinfo | Local | | /usr/share/zoneinfo/UTC | --- | Local | | --- | --- | Local | +-------------------------+---------------------+---------+ UTC timezones are only achieved on both Arch and Suse by linking UTC to /etc/localtime (ln -sf /usr/share/zoneinfo/UTC /etc/localtime) | ||||
Additional Information | Relates to the previous bug http://www.hu.freepascal.org/lists/fpc-devel/2015-November/036324.html | ||||
Tags | No tags attached. | ||||
Fixed in Revision | |||||
FPCOldBugId | |||||
FPCTarget | |||||
Attached Files |
|
|
Within the context of deterministic builds you are correct. I seem to remember I filed a similar bug against an issue that also affects reproducable builds, but I can't find it. Note that to achieve reproducable builds, imho you are responsible for verifying and validating any environment variable because an environment is only reproducable if you validate it and adapt it to expectation. Note the compile process for the compiler does not rely on environment variables perse: they can be overridden with make options. I don't know if this is the case for TZ, but anyway as you wrote: that's platform. |
|
0029325: Enable reproducible builds of FPC. |
|
I would compare straces of simple programs with both builds (debian and one of the failing distros), and compare them near where zoneinfo is read. Maybe the FPC code doesn't follow symlinks or opens something in read write that is only readable on those distros. It would give a clue where to start. |
|
From what I can see FPC only queries TZ, not TZDIR, is that POSIX? |
|
FPC seems to query TZDIR in rtl/unix/timezone.inc:196. Even if it only used TZ, TZ is not being set or it's being overwritten. You can see in some examples that even when TZ is set to absolute paths without TZDIR, still doesn't work. I don't believe TZDIR is POSIX, just UNIX. |
Date Modified | Username | Field | Change |
---|---|---|---|
2018-01-03 02:09 | Juliana Oliveira | New Issue | |
2018-01-03 11:18 | Thaddy de Koning | Note Added: 0105280 | |
2018-01-03 11:27 | Thaddy de Koning | Note Edited: 0105280 | View Revisions |
2018-01-03 15:14 | Anton Kavalenka | Note Added: 0105288 | |
2018-01-03 15:42 | Marco van de Voort | Note Added: 0105289 | |
2018-01-03 15:59 | Marco van de Voort | Note Added: 0105290 | |
2018-01-11 21:50 | Juliana Oliveira | Note Added: 0105676 | |
2020-10-18 14:20 | Marco van de Voort | Relationship added | related to 0029325 |