[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-fontconfig
Subject:    Re: [Fontconfig] [PATCH] Please make the output of cache files reproducible
From:       Akira TAGOH <akira () tagoh ! org>
Date:       2017-07-03 12:59:43
Message-ID: CACT-Cx3NL=NW2Mgq-wKQU9OmEC1wA1NYgSkC1mFq=6Q-54YLgA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Sorry, I missed this.

How about creating your tool with FcConfigGetFontDirs()? I don't get why
fc-cache needs to have such options. fc-cache isn't an interface to make
the config readable.

On Fri, Jun 9, 2017 at 10:11 AM, Chris Lamb <lamby@debian.org> wrote:

> Hi,
>
> Whilst working on the Reproducible Builds[0] effort, we noticed that
> fontconfig — in its usual usage — generates un-reproducible cache files.
>
> This is due to it using the timestamps of each directory in the
> "checksum" member of the _FcCache struct. This is so that it can identify
> which cache files remain valid and/or require regeneration.
>
> Whilst we could zero-out the checksum, we would actually need it still
> function correctly. Therefore, I've attached a patch that adds an option
> to list all the configured font directories; that way, distributions,
> etc. can modify the mtimes of these files in advance
>
> For example, I'm about to propose the following to Debian's fontconfig
> "postinst" script:
>
>   if [ -n "$SOURCE_DATE_EPOCH" ]; then
>     fc-cache -s --list-dirs | \
>       xargs -I{} find {} -type d -follow -newermt "@$SOURCE_DATE_EPOCH"
> -print0 2>/dev/null | \
>       xargs -0r touch --date="@$SOURCE_DATE_EPOCH"
>   fi
>
> … and then we make the usual calls to, for example:
>
>   $ fc-cache -s -f -v
>
>
> (This work was sponsored by Tails[1].)
>
>
>  [0] https://reproducible-builds.org/
>  [1] https://tails.boum.org/
>
>
> Regards,
>
> --
>       ,''`.
>      : :'  :     Chris Lamb
>      `. `'`      lamby@debian.org / chris-lamb.co.uk
>        `-
>
> _______________________________________________
> Fontconfig mailing list
> Fontconfig@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/fontconfig
>
>


-- 
Akira TAGOH

[Attachment #5 (text/html)]

<div dir="ltr">Sorry, I missed this.<div><br></div><div>How about creating your tool \
with FcConfigGetFontDirs()? I don&#39;t get why fc-cache needs to have such options. \
fc-cache isn&#39;t an interface to make the config readable.</div></div><div \
class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 9, 2017 at 10:11 AM, \
Chris Lamb <span dir="ltr">&lt;<a href="mailto:lamby@debian.org" \
target="_blank">lamby@debian.org</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">Hi,<br> <br>
Whilst working on the Reproducible Builds[0] effort, we noticed that<br>
fontconfig — in its usual usage — generates un-reproducible cache files.<br>
<br>
This is due to it using the timestamps of each directory in the<br>
&quot;checksum&quot; member of the _FcCache struct. This is so that it can \
identify<br> which cache files remain valid and/or require regeneration.<br>
<br>
Whilst we could zero-out the checksum, we would actually need it still<br>
function correctly. Therefore, I&#39;ve attached a patch that adds an option<br>
to list all the configured font directories; that way, distributions,<br>
etc. can modify the mtimes of these files in advance<br>
<br>
For example, I&#39;m about to propose the following to Debian&#39;s fontconfig<br>
&quot;postinst&quot; script:<br>
<br>
   if [ -n &quot;$SOURCE_DATE_EPOCH&quot; ]; then<br>
      fc-cache -s --list-dirs | \<br>
         xargs -I{} find {} -type d -follow -newermt &quot;@$SOURCE_DATE_EPOCH&quot; \
-print0 2&gt;/dev/null | \<br>  xargs -0r touch \
--date=&quot;@$SOURCE_DATE_EPOCH&quot;<br>  fi<br>
<br>
… and then we make the usual calls to, for example:<br>
<br>
   $ fc-cache -s -f -v<br>
<br>
<br>
(This work was sponsored by Tails[1].)<br>
<br>
<br>
  [0] <a href="https://reproducible-builds.org/" rel="noreferrer" \
target="_blank">https://reproducible-builds.<wbr>org/</a><br>  [1] <a \
href="https://tails.boum.org/" rel="noreferrer" \
target="_blank">https://tails.boum.org/</a><br> <br>
<br>
Regards,<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
         ,&#39;&#39;`.<br>
        : :&#39;   :        Chris Lamb<br>
        `. `&#39;`         <a href="mailto:lamby@debian.org">lamby@debian.org</a> / \
<a href="http://chris-lamb.co.uk" rel="noreferrer" \
target="_blank">chris-lamb.co.uk</a><br>  `-<br>
</font></span><br>______________________________<wbr>_________________<br>
Fontconfig mailing list<br>
<a href="mailto:Fontconfig@lists.freedesktop.org">Fontconfig@lists.freedesktop.<wbr>org</a><br>
 <a href="https://lists.freedesktop.org/mailman/listinfo/fontconfig" rel="noreferrer" \
target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/fontconfig</a><br>
 <br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div \
class="gmail_signature" data-smartmail="gmail_signature">Akira TAGOH</div> </div>


[Attachment #6 (text/plain)]

_______________________________________________
Fontconfig mailing list
Fontconfig@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/fontconfig


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic