Re: on module cache files



On 05/14/2010 09:08 PM, Matthias Clasen wrote:
> I'm pondering changing the way we treat the gdk-pixbuf.loaders and
> gtk.immodules files in GTK3. Currently, we locate these in
> $sysconfdir/gtk-3.0, but that is subtly wrong, since the content of
> the files is architecture dependent (library paths...). In Fedora,
> we've been shipping a hack to look for the file in /etc/gtk-3.0/$host
> instead, but that is not very robust, since it relies on the host
> triplets of config.guess in the tarball and the build system to match.
> 
> The change I am considering is to simple locate the cache files in the
> same directory as the modules they refer to, e.g
> $libdir/gtk-3.0/3.0.0/loaders/gdk-pixbuf.loaders. The recently
> introduced cache for GIO modules already uses this approach.
> 
> Am I overlooking a reason why this is not a good idea ?

Definitely a good idea.

I should definitely do something along those lines for pango also.  Couple
things to keep in mind:

  - Including the cache file in the directory itself makes the directory
timestamp useless for cache freshness checking.  Not a huge deal if require
explicit calls to the caching tools upon any change.  But it still may be a
good idea to keep them outside.  Say, $libdir/gtk-3.0/3.0.0/loaders.cache
instead.  Not sure.

  - Keeping them in /var/cache/ like fontconfig does.  That work for
fontconfig because it includes the cache version in the file names.  And we
are talking about caching the actual contents, not a listing.  So, may not
apply here.


Something that I've want to think about for a while is to provide the
module-list caching facility at the GModule level since many projects use
that.  May be a good time to think about that.  If we do unify it, we can then
switch to a GVariant-based storage easily.


behdad


> Matthias


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