Bug#864082: [Fontconfig] Next steps for a reproducible Fontconfig?

Alexander Larsson alexander.larsson at gmail.com
Mon Apr 1 15:35:13 BST 2019


On Tue, Mar 26, 2019 at 9:09 AM Alexander Larsson
<alexander.larsson at gmail.com> wrote:
>
> On Tue, Mar 26, 2019 at 7:15 AM Akira TAGOH <akira at tagoh.org> wrote:
> >
> > Hi Alex,
> >
> > Have you tried new implementation yet? I believe it should be
> > reflected our discussion though, I want to see some comment from you
> > because flatpak is only customer for salt thing so far. if it works, I
> > can commit it to master and make a release for them.
>
> I have not, but I will put it on the list, will have a look later this week.

So, i'm trying to test this, but I'm running into a weird issue I
don't understand.
I started by creating a new flatpak runtime, deriving from gnome 3.30,
adding just the fontconfig from your branch.
All the files requred are here:
  https://gist.github.com/alexlarsson/8912637dd6173591a8dec7c043cfa01d
Including a build.sh which will build the entire thing.

The weird thing is that i'm failing to create the cache in one of two cases.
What happens is that flatpak-builder first builds the SDK, and after
building that it runs the "cleanup-commands", which (see the gist for
the commands) produces this output:


CLEANUP SDK
created /etc/fonts/conf.d/50-flatpak-salted.conf:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
        <dir salt="qgVrnz2LCleEbiNkHl5936ZRZAu1zHAN">/usr/share/fonts</dir>
</fontconfig>
regenerating system caches for sdk
Fontconfig warning: "/usr/etc/fonts/fonts.conf", line 33: empty font
directory name ignored
Fontconfig warning:
"/usr/share/fontconfig/conf.avail/05-reset-dirs-sample.conf", line 7:
empty font directory name ignored
/usr/share/fonts: caching, new cache contents: 0 fonts, 7 dirs
/usr/share/fonts/cantarell: caching, new cache contents: 5 fonts, 0 dirs
/usr/share/fonts/dejavu: caching, new cache contents: 22 fonts, 0 dirs
/usr/share/fonts/eosrei-emojione: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/gnu-free: caching, new cache contents: 12 fonts, 0 dirs
/usr/share/fonts/google-crosextra-caladea: caching, new cache
contents: 4 fonts, 0 dirs
/usr/share/fonts/google-crosextra-carlito: caching, new cache
contents: 4 fonts, 0 dirs
/usr/share/fonts/liberation-fonts: caching, new cache contents: 12 fonts, 0 dirs
/run/host/fonts: skipping, no such directory
/run/host/user-fonts: skipping, no such directory
/usr/share/fonts/cantarell: skipping, looped directory detected
/usr/share/fonts/dejavu: skipping, looped directory detected
/usr/share/fonts/eosrei-emojione: skipping, looped directory detected
/usr/share/fonts/gnu-free: skipping, looped directory detected
/usr/share/fonts/google-crosextra-caladea: skipping, looped directory detected
/usr/share/fonts/google-crosextra-carlito: skipping, looped directory detected
/usr/share/fonts/liberation-fonts: skipping, looped directory detected
/usr/cache/fontconfig: cleaning cache directory
/app/cache/fontconfig: not cleaning non-existent cache directory
/run/host/fonts-cache: not cleaning non-existent cache directory
/run/host/user-fonts-cache: not cleaning non-existent cache directory
/usr/var/cache/fontconfig: cleaning cache directory
fc-cache: succeeded
resulting /usr/cache/fontconfig:
total 184
-rw-rw-r-- 1 1000 1000  2536 Apr  1 14:25
240592bdd7bdf1b16d89e7edeb4d2486-le64.cache-7
-rw-rw-r-- 1 1000 1000 77096 Apr  1 14:25
38abaa55af3aedbc13e8d17a987f8026-le64.cache-7
-rw-rw-r-- 1 1000 1000 47104 Apr  1 14:25
46df990863fe9cfbed3fe21e89696ec6-le64.cache-7
-rw-rw-r-- 1 1000 1000  6936 Apr  1 14:25
612dd7798ef7fe64f776a6e49f128560-le64.cache-7
-rw-rw-r-- 1 1000 1000  8376 Apr  1 14:25
b599ef9b1adc87dbcc1c41de14b1d733-le64.cache-7
-rw-rw-r-- 1 1000 1000  6312 Apr  1 14:25
b5aefa49b91159320ae79a3bc3a8ec09-le64.cache-7
-rw-r--r-- 1 1000 1000   200 Apr  1 14:25 CACHEDIR.TAG
-rw-rw-r-- 1 1000 1000   424 Apr  1 14:25
e9903abff2d89c54a7d6bfcd0dde9b25-le64.cache-7
-rw-rw-r-- 1 1000 1000 19928 Apr  1 14:25
e9b75eee6795385ae3f53a200406b963-le64.cache-7

Then it starts over with the platform (non-devel runtime) and does
something similar to it.
This produces the following output:

CLEANUP PLATFORM
created /etc/fonts/conf.d/50-flatpak-salted.conf:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
        <dir salt="PuTGYxt52HAPvmas5WLHWop2OrTheh5g">/usr/share/fonts</dir>
</fontconfig>
regenerating system caches for platform
Fontconfig warning: "/usr/etc/fonts/fonts.conf", line 33: empty font
directory name ignored
Fontconfig warning:
"/usr/share/fontconfig/conf.avail/05-reset-dirs-sample.conf", line 7:
empty font directory name ignored
/usr/share/fonts: caching, new cache contents: 0 fonts, 7 dirs
/usr/share/fonts/cantarell: caching, new cache contents: 5 fonts, 0 dirs
/usr/share/fonts/dejavu: caching, new cache contents: 22 fonts, 0 dirs
/usr/share/fonts/eosrei-emojione: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/gnu-free: caching, new cache contents: 12 fonts, 0 dirs
/usr/share/fonts/google-crosextra-caladea: caching, new cache
contents: 4 fonts, 0 dirs
/usr/share/fonts/google-crosextra-carlito: caching, new cache
contents: 4 fonts, 0 dirs
/usr/share/fonts/liberation-fonts: caching, new cache contents: 12 fonts, 0 dirs
/run/host/fonts: skipping, no such directory
/run/host/user-fonts: skipping, no such directory
/usr/share/fonts/cantarell: skipping, looped directory detected
/usr/share/fonts/dejavu: skipping, looped directory detected
/usr/share/fonts/eosrei-emojione: skipping, looped directory detected
/usr/share/fonts/gnu-free: skipping, looped directory detected
/usr/share/fonts/google-crosextra-caladea: skipping, looped directory detected
/usr/share/fonts/google-crosextra-carlito: skipping, looped directory detected
/usr/share/fonts/liberation-fonts: skipping, looped directory detected
/usr/cache/fontconfig: cleaning cache directory
/usr/cache/fontconfig: invalid cache file:
240592bdd7bdf1b16d89e7edeb4d2486-le64.cache-7
/usr/cache/fontconfig: invalid cache file:
38abaa55af3aedbc13e8d17a987f8026-le64.cache-7
/usr/cache/fontconfig: invalid cache file:
b5aefa49b91159320ae79a3bc3a8ec09-le64.cache-7
/usr/cache/fontconfig: invalid cache file:
612dd7798ef7fe64f776a6e49f128560-le64.cache-7
/usr/cache/fontconfig: invalid cache file:
e9b75eee6795385ae3f53a200406b963-le64.cache-7
/usr/cache/fontconfig: invalid cache file:
e9903abff2d89c54a7d6bfcd0dde9b25-le64.cache-7
/usr/cache/fontconfig: invalid cache file:
b599ef9b1adc87dbcc1c41de14b1d733-le64.cache-7
/usr/cache/fontconfig: invalid cache file:
46df990863fe9cfbed3fe21e89696ec6-le64.cache-7
/app/cache/fontconfig: not cleaning non-existent cache directory
/run/host/fonts-cache: not cleaning non-existent cache directory
/run/host/user-fonts-cache: not cleaning non-existent cache directory
/usr/var/cache/fontconfig: cleaning cache directory
fc-cache: succeeded
resulting /usr/cache/fontconfig:
total 4
-rw-r--r-- 1 1000 1000 200 Apr  1 14:27 CACHEDIR.TAG

I don't understand why its generating cache files with the same
filenames, even though the salt for /usr/share/fonts is different.
And why does it think they are invalid after having just generated
them? (The script that generates the 50-flatpak-salted.conf removes
all caches, so the claimed to be invalid files are definitely created
by fc-cache...)

Also, i worry about the fact that it seems to list all the fonts in
/usr/share/fonts twice, the second time complaining about looping.
Maybe the reset-dirs is not working in fc-cache, so its picking up the
first instance of /usr/share/fonts?

Also, why is it warning about
"/usr/share/fontconfig/conf.avail/05-reset-dirs-sample.conf"? Why is
it even trying to parse this file? It should not be used?



More information about the Pkg-freedesktop-maintainers mailing list