summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorChris Lamb <chris@chris-lamb.co.uk>2018-05-15 22:11:24 +0200
committerAkira TAGOH <akira@tagoh.org>2018-05-16 16:06:46 +0900
commitf098adac54ab86b75a38f2d23fa706a1348f55ba (patch)
tree730a7db937a41060da51953e2125519512c93982 /doc
parent0b85e77ede3497b8533b8fcb67d03d8ad174998d (diff)
Ensure cache checksums are deterministicHEADmaster
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/
Diffstat (limited to 'doc')
-rw-r--r--doc/fontconfig-user.sgml6
1 files changed, 5 insertions, 1 deletions
diff --git a/doc/fontconfig-user.sgml b/doc/fontconfig-user.sgml
index f4f1c425..89df86ef 100644
--- a/doc/fontconfig-user.sgml
+++ b/doc/fontconfig-user.sgml
@@ -802,10 +802,14 @@ is used to specify the default language as the weak binding in the query. if thi
<emphasis>FONTCONFIG_USE_MMAP</emphasis>
is used to control the use of mmap(2) for the cache files if available. this take a boolean value. fontconfig will checks if the cache files are stored on the filesystem that is safe to use mmap(2). explicitly setting this environment variable will causes skipping this check and enforce to use or not use mmap(2) anyway.
</para>
+ <para>
+<emphasis>SOURCE_DATE_EPOCH</emphasis>
+is used to ensure <literal>fc-cache(1)</literal> generates files in a deterministic manner in order to support reproducible builds. When set to a numeric representation of UNIX timestamp, fontconfig will prefer this value over using the modification timestamps of the input files in order to identify which cache files require regeneration. If <literal>SOURCE_DATE_EPOCH</literal> is not set (or is newer than the mtime of the directory), the existing behaviour is unchanged.
+ </para>
</refsect1>
<refsect1><title>See Also</title>
<para>
-fc-cat(1), fc-cache(1), fc-list(1), fc-match(1), fc-query(1)
+fc-cat(1), fc-cache(1), fc-list(1), fc-match(1), fc-query(1), <ulink url="https://reproducible-builds.org/specs/source-date-epoch/">SOURCE_DATE_EPOCH</ulink>.
</para>
</refsect1>
<refsect1><title>Version</title>