<html><head><style>pre,code,address {
margin: 0px;
}
h1,h2,h3,h4,h5,h6 {
margin-top: 0.2em;
margin-bottom: 0.2em;
}
ol,ul {
margin-top: 0em;
margin-bottom: 0em;
}
blockquote {
margin-top: 0em;
margin-bottom: 0em;
}
</style></head><body><p>Hi,</p><p>On Sat, 2026-06-27 at 12:49 +0200, Paul Gevers wrote:</p><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
<p>Hi,</p><p>On 27-06-2026 12:43, Paul Gevers wrote:</p><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
<div><br></div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
<p>Lazarus's .chm files have never built reproducibly.</p></blockquote>
</blockquote>
<p>By the way, in 2017 and before things were reproducible occasionally. I recall I did spend time on getting it there.</p><p>Paul</p></blockquote><div>
</div><div>I've tried to investigate this issues and came to the following conclusion based on multiple analysis about what is causing the non-reproducibility in the <code>lcl.chm</code> build.</div><div>
</div><p>The Compiled HTML Help (CHM) generation process uses FPC's built-in <code>chmwriter.pas</code> (which is compiled into the <code>fpdoc</code> utility). It has two runtime calls to <code><b><font color="#1a5fb4">SysUtils.Now</font></b></code> that embed timestamps into the binary:</p><ol>
<li><strong>CHM Header:</strong> <code><font color="#1a5fb4"><b>TITSFWriter.InitITSFHeader</b></font></code> sets <code><font color="#1a5fb4"><b>TimeStamp := NToBE(MilliSecondOfTheDay(Now));</b></font></code></li>
<li><strong>System Stream:</strong> <code><b><font color="#1a5fb4">TChmWriter.WriteSYSTEM</font></b></code> sets a metadata entry with <code><b><font color="#1a5fb4">FSection0.WriteDWord(NToLE(MilliSecondOfTheDay(Now)));</font></b></code></li>
</ol><div>
</div><p>Because these calls use the system clock at runtime, the generated CHM files differ byte-for-byte depending on the exact millisecond they are built. Setting the <code><b><font color="#1a5fb4">SOURCE_DATE_EPOCH</font></b></code> environment variable has no effect because <code><b><font color="#1a5fb4">SysUtils.Now</font></b></code> is a standard FPC runtime function and does not read it.-- </p><pre><code>Cheers,
Mazen Neifer
Debian Developer
</code></pre><div>
</div><div><br></div></body></html>