From: "Ludovic Courtès" <ludo@gnu.org>
To: Sarah Morgensen <iskarian@mgsn.dev>
Cc: 49107@debbugs.gnu.org
Subject: [bug#49107] [PATCH core-updates] gnu: fontconfig: Use (locally) deterministic caching
Date: Wed, 07 Jul 2021 23:16:09 +0200 [thread overview]
Message-ID: <87sg0pomee.fsf@gnu.org> (raw)
In-Reply-To: <d2647ed721b9f12b1267427409455e385ffaa12d.1624063731.git.iskarian@mgsn.dev> (Sarah Morgensen's message of "Fri, 18 Jun 2021 17:52:05 -0700")
Hi,
Sarah Morgensen <iskarian@mgsn.dev> skribis:
> Make fontconfig use directory contents rather than modification time to
> determine cache validity (by pretending that mtime is broken).
>
> * gnu/packages/patches/fontconfig-cache-ignore-mtime.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Register it.
> * gnu/packages/fontutils.scm (fontconfig)[source]: Use it.
> [arguments]: Unset SOURCE_DATE_EPOCH for tests.
> ---
> gnu/local.mk | 1 +
> gnu/packages/fontutils.scm | 7 ++++++-
> .../patches/fontconfig-cache-ignore-mtime.patch | 15 +++++++++++++++
> 3 files changed, 22 insertions(+), 1 deletion(-)
> create mode 100644 gnu/packages/patches/fontconfig-cache-ignore-mtime.patch
>
> Hello Guix,
>
> This patch attempts to make fontconfig's caching work seamlessly on Guix,
> instead of requiring users to manually run `fc-cache -f` after installing or
> removing fonts. This addresses <https://issues.guix.gnu.org/18640>.
>
> Fontconfig usually uses a directory's mtime as its checksum. However, when
> fontconfig detects a "broken mtime" filesystem, it will generate a directory
> checksum from the directory listing contents. This is slightly slower, as it has
> to stat all the files in all font directories. Unconditionally enabling this
> mode should get us more regular behavior.
Nice, sounds like an improvement!
Does Fontconfig stats all these files every time an application starts?
Did you compare ‘strace -c some app’ with and without this change, to
get an idea of what it costs?
> I am not confident this method is fully deterministic; particular filesystem
> capabilities may still be an implicit imput in the checksums. This should only
> matter when distributing pre-generated caches.
>
> Fontconfig does honor SOURCE_DATE_EPOCH, but without a reliable mtime,
> fontconfig has no way of knowing when to update such a cache. SOURCE_DATE_EPOCH
> is now disabled for the tests because they assume working cache invalidation.
So tests fail is we leave SOURCE_DATE_EPOCH, right?
Thanks for addressing this longstanding issue! (And apologies for the
delay… Now’s a good time to get semi-high-level changes like this one
in ‘core-updates’.)
Ludo’.
next prev parent reply other threads:[~2021-07-07 21:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-19 0:52 [bug#49107] [PATCH core-updates] gnu: fontconfig: Use (locally) deterministic caching Sarah Morgensen via Guix-patches via
2021-07-07 21:16 ` Ludovic Courtès [this message]
2021-07-08 1:17 ` Sarah Morgensen via Guix-patches via
2021-07-12 8:30 ` bug#49107: " Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sg0pomee.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=49107@debbugs.gnu.org \
--cc=iskarian@mgsn.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.