[Fontconfig] [PATCH] Please make the output of cache files reproducible

Chris Lamb lamby at debian.org
Fri Jun 9 01:11:09 UTC 2017


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"

… 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/


     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: reproducible.diff.txt
URL: <https://lists.freedesktop.org/archives/fontconfig/attachments/20170609/ec56044a/attachment.txt>

More information about the Fontconfig mailing list