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

Chris Lamb lamby at debian.org
Tue May 15 20:13:58 UTC 2018

Hi Akira,

> Please mention about SOURCE_DATE_EPOCH at the section of the
> Environment variables in doc/fontconfig-user.sgml

Whoops, I somehow forgot this bit. Updated patch attached:

  commit 9213848ca27ccc3587a1a60539ec7c02fb02016f
  Author: Chris Lamb <chris at chris-lamb.co.uk>
  Date:   Tue May 15 22:11:24 2018 +0200
      Ensure cache checksums are deterministic
      Whilst working on the Reproducible Builds[0] effort, we noticed that
      fontconfig generates unreproducible cache files.
      This is due to fc-cache uses the modification timestamps of each
      directory in the "checksum" and "checksum_nano" members of the _FcCache
      struct. This is so that it can identify which cache files are valid
      and/or require regeneration.
      This patch changes the behaviour of the checksum calculations to prefer
      the value of the SOURCE_DATE_EPOCH[1] environment variable over the
      directory's own mtime. This variable can then be exported by build
      systems to ensure reproducible output.
      If SOURCE_DATE_EPOCH is not set or is newer than the mtime of the
      directory, the existing behaviour is unchanged.
      This work was sponsored by Tails[2].
       [0] https://reproducible-builds.org/
       [1] https://reproducible-builds.org/specs/source-date-epoch/
       [2] https://tails.boum.org/
   doc/fontconfig-user.sgml |  6 ++++-
   src/fccache.c            | 58 +++++++++++++++++++++++++++++++++++++++++++-----
   2 files changed, 57 insertions(+), 7 deletions(-)

You can also merge from the "864082-FcConfigGetFontDirs" branch of
https://github.com/lamby/fontconfig if that is more convenient.

Best wishes,

     : :'  :     Chris Lamb
     `. `'`      lamby at debian.org / chris-lamb.co.uk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Ensure-cache-checksums-are-deterministic.patch
Type: text/x-patch
Size: 5442 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/fontconfig/attachments/20180515/6d0e4930/attachment.bin>

More information about the Fontconfig mailing list