View Issue Details

IDProjectCategoryView StatusLast Update
0032937FPCCompilerpublic2020-10-18 14:20
ReporterJuliana Oliveira Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
PlatformArch and SuseOSLinux 
Product Version3.0.4 
Summary0032937: TZ and TZDIR env vars being overwritten in Arch & Suse Linux
DescriptionDear 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 InformationRelates to the previous bug http://www.hu.freepascal.org/lists/fpc-devel/2015-November/036324.html
TagsNo tags attached.
Fixed in Revision
FPCOldBugId
FPCTarget
Attached Files

Relationships

related to 0029325 resolvedFlorian Enable reproducible builds of FPC. 

Activities

Thaddy de Koning

2018-01-03 11:18

reporter   ~0105280

Last edited: 2018-01-03 11:27

View 2 revisions

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.

Anton Kavalenka

2018-01-03 15:14

reporter   ~0105288

0029325: Enable reproducible builds of FPC.

Marco van de Voort

2018-01-03 15:42

manager   ~0105289

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.

Marco van de Voort

2018-01-03 15:59

manager   ~0105290

From what I can see FPC only queries TZ, not TZDIR, is that POSIX?

Juliana Oliveira

2018-01-11 21:50

reporter   ~0105676

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.

Issue History

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