Re: [PATCH] Please make the output of cache files reproducible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


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@xxxxxxxxxx> wrote:

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].)



     : :'  :     Chris Lamb
     `. `'`      lamby@xxxxxxxxxx /

Fontconfig mailing list

Fontconfig mailing list

[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux