[Fontconfig] Re: incompatible changes in cache format

Patrick Lam plam at MIT.EDU
Tue Feb 14 07:52:55 PST 2006


Mike FABIAN wrote:
> Your change in the cache format causes crashes on systems where
> old caches are still around, i.e. it causes crashes after updating.

Yes, I bet it would.

Ideally we wouldn't change the cache format once fontconfig becomes
stable.  But I guess that's not a very satisfactory answer, because we
might have to change the cache format more than we might like.  One
option is to increment the cache version number (fonts.cache-3, etc).

> fcint.h contains a magic number
> 
>     #define FC_CACHE_MAGIC 0xFC02FC02
> 
> which appears to be intended for that purpose.

The magic number just helps determine that it's a fontconfig cache, but
I suppose it could be changed.  The other thing is that there's a line
for determining architectures (by recording sizeof various things); this
line could also have a version number incorporated into it.

The question, I guess, is how often we're going to have these
incompatible changes.  If it's not very often, then we increment the
filename number.  If it's going to be more often than that, we can
change the magic number.  I'm not really sure which is best.

>     fc-cache -v
> 
> run as root doesn't generate new caches in /var/cache/fontconfig,
> it just skips:
> 
>     mfabian at magellan:~$ sudo fc-cache -v
>     fc-cache: "/usr/share/fonts": skipping, 0 fonts, 3 dirs
>     [...]

That's probably a straight out bug that ought to be fixed.  I'll take a
10-minute look at it today.

pat


More information about the Fontconfig mailing list