Skip to contentSkip to conversation

Jonathan Liu : fontcache.bbclass: prepend to PACKAGEFUNCS instead of appending

oe-commits Superseded Martin Jansa 4 participants 24 messages Mar 21, 2015 – Apr 20, 2015 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 8 lines · On Mon, Mar 16, 2015 at 05:42:36PM +0000, [email protected] wrote:
Module: openembedded-core.git
Branch: master
Commit: f0e3db4eaacc32423934ce09b91bc619dc5dbd21
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=f0e3db4eaacc32423934ce09b91bc619dc5dbd21
Author: Jonathan Liu <[email protected]>
Date:   Mon Mar  9 12:13:56 2015 +1100
Quoted 8 lines

fontcache.bbclass: prepend to PACKAGEFUNCS instead of appending

Appending to PACKAGEFUNCS results in the font packages missing the postinst/postrm scripts and the fontconfig cache not being generated in /var/cache/fontconfig when creating images or installing font packages. This is because the package data has already been emitted by emit_pkgdata in PACKAGEFUNCS. Prepend to PACKAGEFUNCS to ensure add_fontcache_postinsts is executed before emit_pkgdata.

It's not caused by this change, but fixing this issue revealed that fc-cache doesn't really work here.

Every time the intercept_scripts/update_font_cache executes qemu it gets "stuck" eating a lot of cpu and memory until it dies. Is anyone alse seeing this behavior?

WARNING: The postinstall intercept hook 'update_font_cache' failed (exit code: 137)! See log for details!
WARNING: The postinstalls for the following packages will be postponed for first boot: liberation-fonts
ERROR: The following packages could not be configured offline and rootfs is read-only: ['liberation-fonts']
ERROR: Function failed: do_rootfs

bitbake 32618 98.8 67.1 11031512 10983420 pts/3 R+ 03:00 4:53
qemu-i386 -r 2.6.32 -L /OE/rootfs -E uD_LIBRARY_PATH=/OE/rootfs//usr/lib:/OE/rootfs//lib /OE/rootfs/usr/bin/fc-cache --sysroot=/OE/rootfs

Quoted 27 lines

[YOCTO #7410]

---

 meta/classes/fontcache.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/fontcache.bbclass +1 -1
index ad5892c..dfbdfa1 100644
@@ -42,4 +42,4 @@ python add_fontcache_postinsts() {
         d.setVar('pkg_postrm_%s' % pkg, postrm)
 }
 
-PACKAGEFUNCS += "add_fontcache_postinsts"
+PACKAGEFUNCS =+ "add_fontcache_postinsts"
Signature · 5 lines
-- 
_______________________________________________
Openembedded-commits mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-commits
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#2 lore raw
Quoted 25 lines · Martin Jansa
Quoted 8 lines · On Mon, Mar 16, 2015 at 05:42:36PM +0000, [email protected] wrote:
Module: openembedded-core.git
Branch: master
Commit: f0e3db4eaacc32423934ce09b91bc619dc5dbd21
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=f0e3db4eaacc32423934ce09b91bc619dc5dbd21
Author: Jonathan Liu <[email protected]>
Date:   Mon Mar  9 12:13:56 2015 +1100
Quoted 8 lines

fontcache.bbclass: prepend to PACKAGEFUNCS instead of appending

Appending to PACKAGEFUNCS results in the font packages missing the postinst/postrm scripts and the fontconfig cache not being generated in /var/cache/fontconfig when creating images or installing font packages. This is because the package data has already been emitted by emit_pkgdata in PACKAGEFUNCS. Prepend to PACKAGEFUNCS to ensure add_fontcache_postinsts is executed before emit_pkgdata.

It's not caused by this change, but fixing this issue revealed that fc-cache doesn't really work here.

Every time the intercept_scripts/update_font_cache executes qemu it gets "stuck" eating a lot of cpu and memory until it dies. Is anyone alse seeing this behavior?

Quoted 7 lines

WARNING: The postinstall intercept hook 'update_font_cache' failed (exit code: 137)! See log for details!
WARNING: The postinstalls for the following packages will be postponed for first boot: liberation-fonts
ERROR: The following packages could not be configured offline and rootfs is read-only: ['liberation-fonts']
ERROR: Function failed: do_rootfs

bitbake 32618 98.8 67.1 11031512 10983420 pts/3 R+ 03:00 4:53
qemu-i386 -r 2.6.32 -L /OE/rootfs -E uD_LIBRARY_PATH=/OE/rootfs//usr/lib:/OE/rootfs//lib /OE/rootfs/usr/bin/fc-cache --sysroot=/OE/rootfs

There are a couple of bugs in the bugzilla around this. One seemed to be related to circular symlinks in udev's ptest package which was supposedly fixed. The other claims to have been resolved by upgrading fontconfig to a version which doesn't have issues with circular paths.

There is general confusion about how to reproduce the issue and what the real problem is though.

Does your system have any recursive directory structures?

I'd like to get to the bottom of the issue and fix it once and for all but we likely need more info.

Cheers,

Richard

#3 lore raw
Quoted 39 lines · Richard Purdie
Quoted 25 lines · Martin Jansa
Quoted 8 lines · On Mon, Mar 16, 2015 at 05:42:36PM +0000, [email protected] wrote:
Module: openembedded-core.git
Branch: master
Commit: f0e3db4eaacc32423934ce09b91bc619dc5dbd21
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=f0e3db4eaacc32423934ce09b91bc619dc5dbd21
Author: Jonathan Liu <[email protected]>
Date:   Mon Mar  9 12:13:56 2015 +1100
Quoted 8 lines

fontcache.bbclass: prepend to PACKAGEFUNCS instead of appending

Appending to PACKAGEFUNCS results in the font packages missing the postinst/postrm scripts and the fontconfig cache not being generated in /var/cache/fontconfig when creating images or installing font packages. This is because the package data has already been emitted by emit_pkgdata in PACKAGEFUNCS. Prepend to PACKAGEFUNCS to ensure add_fontcache_postinsts is executed before emit_pkgdata.

It's not caused by this change, but fixing this issue revealed that fc-cache doesn't really work here.

Every time the intercept_scripts/update_font_cache executes qemu it gets "stuck" eating a lot of cpu and memory until it dies. Is anyone alse seeing this behavior?

Quoted 7 lines

WARNING: The postinstall intercept hook 'update_font_cache' failed (exit code: 137)! See log for details!
WARNING: The postinstalls for the following packages will be postponed for first boot: liberation-fonts
ERROR: The following packages could not be configured offline and rootfs is read-only: ['liberation-fonts']
ERROR: Function failed: do_rootfs

bitbake 32618 98.8 67.1 11031512 10983420 pts/3 R+ 03:00 4:53
qemu-i386 -r 2.6.32 -L /OE/rootfs -E uD_LIBRARY_PATH=/OE/rootfs//usr/lib:/OE/rootfs//lib /OE/rootfs/usr/bin/fc-cache --sysroot=/OE/rootfs

There are a couple of bugs in the bugzilla around this. One seemed to be related to circular symlinks in udev's ptest package which was supposedly fixed. The other claims to have been resolved by upgrading fontconfig to a version which doesn't have issues with circular paths.

Quoted 4 lines

There is general confusion about how to reproduce the issue and what the real problem is though.

Does your system have any recursive directory structures?

I've tried to build a bit smaller image after sending the report and in that do_rootfs it finished successfully. I'll try to re-execute this to see if I get consistent results.

The bigger image has only few more packages in it, so if this is the case and smaller always works while bigger always fails I should be able to quickly find out which package/file is causing this.

I'll check the circular symlinks, I know there are some ptest packages in the bigger one.

Thanks

Quoted 7 lines

I'd like to get to the bottom of the issue and fix it once and for all but we likely need more info.

Cheers,

Richard

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#4 lore raw
Quoted 49 lines · Martin Jansa
Quoted 39 lines · Richard Purdie
Quoted 25 lines · Martin Jansa
Quoted 8 lines · On Mon, Mar 16, 2015 at 05:42:36PM +0000, [email protected] wrote:
Module: openembedded-core.git
Branch: master
Commit: f0e3db4eaacc32423934ce09b91bc619dc5dbd21
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=f0e3db4eaacc32423934ce09b91bc619dc5dbd21
Author: Jonathan Liu <[email protected]>
Date:   Mon Mar  9 12:13:56 2015 +1100
Quoted 8 lines

fontcache.bbclass: prepend to PACKAGEFUNCS instead of appending

Appending to PACKAGEFUNCS results in the font packages missing the postinst/postrm scripts and the fontconfig cache not being generated in /var/cache/fontconfig when creating images or installing font packages. This is because the package data has already been emitted by emit_pkgdata in PACKAGEFUNCS. Prepend to PACKAGEFUNCS to ensure add_fontcache_postinsts is executed before emit_pkgdata.

It's not caused by this change, but fixing this issue revealed that fc-cache doesn't really work here.

Every time the intercept_scripts/update_font_cache executes qemu it gets "stuck" eating a lot of cpu and memory until it dies. Is anyone alse seeing this behavior?

Quoted 7 lines

WARNING: The postinstall intercept hook 'update_font_cache' failed (exit code: 137)! See log for details!
WARNING: The postinstalls for the following packages will be postponed for first boot: liberation-fonts
ERROR: The following packages could not be configured offline and rootfs is read-only: ['liberation-fonts']
ERROR: Function failed: do_rootfs

bitbake 32618 98.8 67.1 11031512 10983420 pts/3 R+ 03:00 4:53
qemu-i386 -r 2.6.32 -L /OE/rootfs -E uD_LIBRARY_PATH=/OE/rootfs//usr/lib:/OE/rootfs//lib /OE/rootfs/usr/bin/fc-cache --sysroot=/OE/rootfs

There are a couple of bugs in the bugzilla around this. One seemed to be related to circular symlinks in udev's ptest package which was supposedly fixed. The other claims to have been resolved by upgrading fontconfig to a version which doesn't have issues with circular paths.

Quoted 4 lines

There is general confusion about how to reproduce the issue and what the real problem is though.

Does your system have any recursive directory structures?

I've tried to build a bit smaller image after sending the report and in that do_rootfs it finished successfully. I'll try to re-execute this to see if I get consistent results.

Quoted 6 lines

The bigger image has only few more packages in it, so if this is the case and smaller always works while bigger always fails I should be able to quickly find out which package/file is causing this.

I'll check the circular symlinks, I know there are some ptest packages in the bigger one.

In my case it's reproducible by adding udev-ptest to image, more specifically having these 2 directories in rootfs:
usr/lib/udev/ptest/test/sys/devices usr/lib/udev/ptest/test/sys/bus

deleting them and re-triggering the qemu works.
I can also confirm that it's not just lack of memory on the build machine. It triggers OOM killer after using 64GB as well as on machine with just 8GB.

fc-bug/rootfs-broken$ time ../../../../sysroots/x86_64-linux/usr/bin/qemu-i386 -r 2.6.32 -L . -E LD_LIBRARY_PATH=usr/lib:lib usr/bin/fc-cache --sysroot=. ... OOM killer in an hour or 2 ... (this time I didn't get a log, because it killed almost everything else except qemu-i386 :)
fc-bug/rootfs-broken$ cd ..
fc-bug$ cp -ra rootfs-broken rootfs-broken-without-udev-ptest-bus-devices
fc-bug$ cd rootfs-broken-without-udev-ptest-bus-devices
fc-bug/rootfs-broken-without-udev-ptest-bus-devices$ rm -rf usr/lib/udev/ptest/test/sys/devices/ usr/lib/udev/ptest/test/sys/bus/ fc-bug/rootfs-broken-without-udev-ptest-bus-devices$ time ../../../../sysroots/x86_64-linux/usr/bin/qemu-i386 -r 2.6.32 -L . -E LD_LIBRARY_PATH=usr/lib:lib usr/bin/fc-cache --sysroot=.

real    0m30.424s
user    0m29.714s
sys     0m0.548s

Comparing strace shows the broken one to cycle a lot in directories like this:
< getdents(51, /* 8 entries */, 32768) = 248
< openat(AT_FDCWD, "//home/jenkins/anaconda/build-starfish-dizzy/build/BUILD/work/qemux86-starfish-linux/fc-bug/rootfs-broken/./usr/lib/udev/ptest/test/sys/dev/block/8:1/subsystem/loop2/bdi/subsystem/0:16/subsystem/0:16/subsystem/0:16/subsystem/0:16/subsystem/0:16/subsystem/0:16/subsystem/0:16/subsystem/0:16/subsystem/0:16/subsystem/0:16/subsystem/0:16/subsystem/0:16/subsystem/0:16/subsystem/0:16/subsystem/0:16/subsystem/0:16/subsystem/8:16/subsystem/8:0/power", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 52

This issue forced me to finally set ulimit in my builds so that I can kill the right process a bit sooner (instead of waiting for it to eat e.g. 128GB)

I'll try to create smaller reproducer and check newer fontconfig.

Quoted 13 lines

Thanks

Quoted 7 lines

I'd like to get to the bottom of the issue and fix it once and for all but we likely need more info.

Cheers,

Richard

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#5 lore raw
Quoted 6 lines · Martin Jansa

In my case it's reproducible by adding udev-ptest to image, more specifically
having these 2 directories in rootfs:
usr/lib/udev/ptest/test/sys/devices usr/lib/udev/ptest/test/sys/bus

oe-core 3f799b should mean that those directories are in a tarball instead of unpacked on the rootfs. Do you have that commit?

Ross

#6 lore raw
Quoted 11 lines · Ross
Quoted 6 lines · Martin Jansa

In my case it's reproducible by adding udev-ptest to image, more specifically
having these 2 directories in rootfs:
usr/lib/udev/ptest/test/sys/devices usr/lib/udev/ptest/test/sys/bus

oe-core 3f799b should mean that those directories are in a tarball instead of unpacked on the rootfs. Do you have that commit?

Oh, thanks for pointer. I was seeing the same issue in dizzy and master build, but this change can explain why I wasn't able to reproduce it in master yesterday.

Quoted 1 line

Ross

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#7 lore raw
Quoted 4 lines · Martin Jansa

Oh, thanks for pointer. I was seeing the same issue in dizzy and master build, but this change can explain why I wasn't able to reproduce it in master yesterday.

Sounds like we should backport that to dizzy (CCing Armin).

Ross

#8 lore raw
Quoted 8 lines · Ross
Quoted 4 lines · Martin Jansa

Oh, thanks for pointer. I was seeing the same issue in dizzy and master build, but this change can explain why I wasn't able to reproduce it in master yesterday.

Sounds like we should backport that to dizzy (CCing Armin).

yes, I've verified that I can reproduce this issue in master after reverting this change and that it resolves the issue in dizzy if I backport it with one other change (just to apply it cleanly with additional bugfix), I've referenced the fontcache.bbclass fix, these 3 should go in only together.

My bigger image build is still running, but this fix is definitely helping.

Thanks,

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#9 lore raw
Quoted 6 lines · Martin Jansa

yes, I've verified that I can reproduce this issue in master after reverting this change and that it resolves the issue in dizzy if I backport it with one other change (just to apply it cleanly with additional bugfix), I've referenced the fontcache.bbclass fix, these 3 should go in only together.

So I just managed to replicate and root-cause this a bit. Good news:
found this in qemu's bugzilla. Bad news: it's been open since 2013.

https://bugs.launchpad.net/qemu/+bug/1245703

The startup code iterates all files in the "sysroot" and cyclic symlinks cause it to iterate forever. So for now the official advice is "don't have cyclic symlinks in your rootfs, or qemu breaks".

Ross

#10 lore raw
In reply to Martin Jansa
Quoted 10 lines · Martin Jansa
Quoted 9 lines · Ross
Quoted 6 lines · Martin Jansa

In my case it's reproducible by adding udev-ptest to image, more specifically
having these 2 directories in rootfs:
usr/lib/udev/ptest/test/sys/devices usr/lib/udev/ptest/test/sys/bus

Quoted 6 lines
Quoted 2 lines

oe-core 3f799b should mean that those directories are in a tarball instead of unpacked on the rootfs. Do you have that commit?

Oh, thanks for pointer. I was seeing the same issue in dizzy and master build, but this change can explain why I wasn't able to reproduce it in master yesterday.

I've found the reason why it was failing for me in master even with this udev fix when building our internal images.

The problem is that we have fontconfig bbappend which sets:
WEBOS_FONTCONFIG_CACHE = "${datadir}/fontconfig/cache" EXTRA_OECONF_append = " --with-cache-dir=${WEBOS_FONTCONFIG_CACHE}"

and this oe-core commit:
commit 23393c6685860d0b1c459874d35395360d0b6d3c

Author: Jonathan Liu <[email protected]>
Date:   Mon Mar 9 13:28:37 2015 +1100

postinst-intercepts/update_font_cache: fix ownership of fontconfig cache

adds:
chown -R root:root $D${localstatedir}/cache/fontconfig

Which doesn't exist in our builds and chown and whole postinst interceptor fails.

I'll send patch to make fontconfig cache dir configureable so that we don't need to overlay fontcache.bbclass as well as scripts/postinst-intercepts/update_font_cache

Thanks,

Quoted 5 lines
Quoted 2 lines

Ross

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#11 lore raw

PATCH 1/1 fontcache: allow to pass different fontconfig cache dir

---
 meta/classes/fontcache.bbclass                | 4 ++--
 scripts/postinst-intercepts/update_font_cache | 4 +---
 2 files changed, 3 insertions(+), 5 deletions(-)
meta/classes/fontcache.bbclass +2 -2
index dfbdfa1..d122387 100644
@@ -8,11 +8,11 @@ inherit qemu
 
 FONT_PACKAGES ??= "${PN}"
 FONT_EXTRA_RDEPENDS ?= "fontconfig-utils"
-
+FONTCONFIG_CACHE_DIR ?= "${localstatedir}/cache/fontconfig"
 fontcache_common() {
 if [ "x$D" != "x" ] ; then
 	$INTERCEPT_DIR/postinst_intercept update_font_cache ${PKG} mlprefix=${MLPREFIX} bindir=${bindir} \
-		libdir=${libdir} base_libdir=${base_libdir} localstatedir=${localstatedir}
+		libdir=${libdir} base_libdir=${base_libdir} fontconfigcachedir=${FONTCONFIG_CACHE_DIR}
 else
 	fc-cache
 fi
scripts/postinst-intercepts/update_font_cache +1 -3
index 3907f25..c8c6018 100644
@@ -2,6 +2,4 @@
 
 PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D/${libdir}:$D/${base_libdir}\
 					$D${bindir}/fc-cache --sysroot=$D
-chown -R root:root $D${localstatedir}/cache/fontconfig
-
-
+chown -R root:root $D${fontconfigcachedir}
Signature · 1 line
2.3.4
#12 lore raw

Re: [PATCH] fontcache: allow to pass different fontconfig cache dir

Quoted 2 lines · Martin Jansa

+FONTCONFIG_CACHE_DIR ?= "${localstatedir}/cache/fontconfig"

So how is fontconfig told to read fonts from this location?

Ross

#13 lore raw

Re: [PATCH] fontcache: allow to pass different fontconfig cache dir

Quoted 6 lines · Ross
Quoted 2 lines · Martin Jansa

+FONTCONFIG_CACHE_DIR ?= "${localstatedir}/cache/fontconfig"

So how is fontconfig told to read fonts from this location?

I think it's the same
--with-cache-dir
parameter which says where to generate the cache and then read it in runtime.

I didn't change it in fontconfig recipe, because the default is already matching with FONTCONFIG_CACHE_DIR, do you want me to pass --with-cache-dir parameter? I agree that it could be less surprising for people who want to change it, but on the other hand if upstream moves default cache location in some newer fontconfig version, then the person updating the recipe should check FONTCONFIG_CACHE_DIR value as well.

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#14 lore raw

PATCH v2 1/1 fontcache: allow to pass different fontconfig cache dir

---
v2: added --with-cache-dir to fontconfig EXTRA_OECONF in case that was
what Ross wanted

 meta/classes/fontcache.bbclass                        | 4 ++--
 meta/recipes-graphics/fontconfig/fontconfig_2.11.1.bb | 4 +++-
 scripts/postinst-intercepts/update_font_cache         | 4 +---
 3 files changed, 6 insertions(+), 6 deletions(-)
meta/classes/fontcache.bbclass +2 -2
index dfbdfa1..d122387 100644
@@ -8,11 +8,11 @@ inherit qemu
 
 FONT_PACKAGES ??= "${PN}"
 FONT_EXTRA_RDEPENDS ?= "fontconfig-utils"
-
+FONTCONFIG_CACHE_DIR ?= "${localstatedir}/cache/fontconfig"
 fontcache_common() {
 if [ "x$D" != "x" ] ; then
 	$INTERCEPT_DIR/postinst_intercept update_font_cache ${PKG} mlprefix=${MLPREFIX} bindir=${bindir} \
-		libdir=${libdir} base_libdir=${base_libdir} localstatedir=${localstatedir}
+		libdir=${libdir} base_libdir=${base_libdir} fontconfigcachedir=${FONTCONFIG_CACHE_DIR}
 else
 	fc-cache
 fi
meta/recipes-graphics/fontconfig/fontconfig_2.11.1.bb +3 -1
index 797b321..7c5b4b4 100644
@@ -37,6 +37,8 @@ DEBIAN_NOAUTONAME_fontconfig-utils = "1"
 
 inherit autotools pkgconfig
 
-EXTRA_OECONF = " --disable-docs --with-default-fonts=${datadir}/fonts"
+FONTCONFIG_CACHE_DIR ?= "${localstatedir}/cache/fontconfig"
+
+EXTRA_OECONF = " --disable-docs --with-default-fonts=${datadir}/fonts --with-cache-dir=${FONTCONFIG_CACHE_DIR}"
 
 BBCLASSEXTEND = "native"
scripts/postinst-intercepts/update_font_cache +1 -3
index 3907f25..c8c6018 100644
@@ -2,6 +2,4 @@
 
 PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D/${libdir}:$D/${base_libdir}\
 					$D${bindir}/fc-cache --sysroot=$D
-chown -R root:root $D${localstatedir}/cache/fontconfig
-
-
+chown -R root:root $D${fontconfigcachedir}
Signature · 1 line
2.3.5
#15 lore raw

Re: [PATCHv2] fontcache: allow to pass different fontconfig cache dir

Quoted 47 lines · Martin Jansa

---
v2: added --with-cache-dir to fontconfig EXTRA_OECONF in case that was
what Ross wanted

 meta/classes/fontcache.bbclass                        | 4 ++--
 meta/recipes-graphics/fontconfig/fontconfig_2.11.1.bb | 4 +++-
 scripts/postinst-intercepts/update_font_cache         | 4 +---
 3 files changed, 6 insertions(+), 6 deletions(-)
meta/classes/fontcache.bbclass +2 -2
index dfbdfa1..d122387 100644
@@ -8,11 +8,11 @@ inherit qemu
 
 FONT_PACKAGES ??= "${PN}"
 FONT_EXTRA_RDEPENDS ?= "fontconfig-utils"
-
+FONTCONFIG_CACHE_DIR ?= "${localstatedir}/cache/fontconfig"
 fontcache_common() {
 if [ "x$D" != "x" ] ; then
 	$INTERCEPT_DIR/postinst_intercept update_font_cache ${PKG} mlprefix=${MLPREFIX} bindir=${bindir} \
-		libdir=${libdir} base_libdir=${base_libdir} localstatedir=${localstatedir}
+		libdir=${libdir} base_libdir=${base_libdir} fontconfigcachedir=${FONTCONFIG_CACHE_DIR}
 else
 	fc-cache
 fi
meta/recipes-graphics/fontconfig/fontconfig_2.11.1.bb +3 -1
index 797b321..7c5b4b4 100644
@@ -37,6 +37,8 @@ DEBIAN_NOAUTONAME_fontconfig-utils = "1"
 
 inherit autotools pkgconfig
 
-EXTRA_OECONF = " --disable-docs --with-default-fonts=${datadir}/fonts"
+FONTCONFIG_CACHE_DIR ?= "${localstatedir}/cache/fontconfig"
+
+EXTRA_OECONF = " --disable-docs --with-default-fonts=${datadir}/fonts --with-cache-dir=${FONTCONFIG_CACHE_DIR}"
 
 BBCLASSEXTEND = "native"
scripts/postinst-intercepts/update_font_cache +0 -0
index 3907f25..c8c6018 100644

scripts/postinst-intercepts/update_font_cache line 5

Quoted 7 lines
scripts/postinst-intercepts/update_font_cache +1 -3
@@ -2,6 +2,4 @@
 
 PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D/${libdir}:$D/${base_libdir}\
 					$D${bindir}/fc-cache --sysroot=$D
-chown -R root:root $D${localstatedir}/cache/fontconfig
-
-
+chown -R root:root $D${fontconfigcachedir}

This looks better but what sets fontconfigcachedir ?

Cheers,

Richard

#16 lore raw

Re: [PATCHv2] fontcache: allow to pass different fontconfig cache dir

Quoted 17 lines · Richard Purdie
Quoted 16 lines · Martin Jansa

---
v2: added --with-cache-dir to fontconfig EXTRA_OECONF in case that was
what Ross wanted

 meta/classes/fontcache.bbclass                        | 4 ++--
 meta/recipes-graphics/fontconfig/fontconfig_2.11.1.bb | 4 +++-
 scripts/postinst-intercepts/update_font_cache         | 4 +---
 3 files changed, 6 insertions(+), 6 deletions(-)
meta/classes/fontcache.bbclass +0 -0
index dfbdfa1..d122387 100644
@@ -8,11 +8,11 @@ inherit qemu
 
Quoted 4 lines

meta/classes/fontcache.bbclass inherit qemu · line 11

Quoted 4 lines
meta/classes/fontcache.bbclass +1 -1
 FONT_PACKAGES ??= "${PN}"
 FONT_EXTRA_RDEPENDS ?= "fontconfig-utils"
-
+FONTCONFIG_CACHE_DIR ?= "${localstatedir}/cache/fontconfig"

]> > fontcache_common() {

Quoted 27 lines
Quoted 27 lines
meta/classes/fontcache.bbclass +1 -1
 if [ "x$D" != "x" ] ; then
 	$INTERCEPT_DIR/postinst_intercept update_font_cache ${PKG} mlprefix=${MLPREFIX} bindir=${bindir} \
-		libdir=${libdir} base_libdir=${base_libdir} localstatedir=${localstatedir}
+		libdir=${libdir} base_libdir=${base_libdir} fontconfigcachedir=${FONTCONFIG_CACHE_DIR}
 else
 	fc-cache
 fi
meta/recipes-graphics/fontconfig/fontconfig_2.11.1.bb +3 -1
index 797b321..7c5b4b4 100644
@@ -37,6 +37,8 @@ DEBIAN_NOAUTONAME_fontconfig-utils = "1"
 
 inherit autotools pkgconfig
 
-EXTRA_OECONF = " --disable-docs --with-default-fonts=${datadir}/fonts"
+FONTCONFIG_CACHE_DIR ?= "${localstatedir}/cache/fontconfig"
+
+EXTRA_OECONF = " --disable-docs --with-default-fonts=${datadir}/fonts --with-cache-dir=${FONTCONFIG_CACHE_DIR}"
 
 BBCLASSEXTEND = "native"
scripts/postinst-intercepts/update_font_cache +0 -0
index 3907f25..c8c6018 100644
@@ -2,6 +2,4 @@
 
Quoted 8 lines

scripts/postinst-intercepts/update_font_cache line 5

Quoted 6 lines
scripts/postinst-intercepts/update_font_cache +1 -3
 PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D/${libdir}:$D/${base_libdir}\
 					$D${bindir}/fc-cache --sysroot=$D
-chown -R root:root $D${localstatedir}/cache/fontconfig
-
-
+chown -R root:root $D${fontconfigcachedir}

This looks better but what sets fontconfigcachedir ?

It's passed in intercept call in fontcache.bbclass like other variables used here.

People who want to change the value should do so from global scope, so that the same value is used in fontconfig_2.11.1.bb and fontcache.bbclass.

Once this is merged in master, I would like to see it in dizzy (and fido) branches together with other fontconfig related fixes.

Thanks

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#17 lore raw

Re: [PATCHv2] fontcache: allow to pass different fontconfig cache dir

Quoted 62 lines · Martin Jansa
Quoted 17 lines · Richard Purdie
Quoted 16 lines · Martin Jansa

---
v2: added --with-cache-dir to fontconfig EXTRA_OECONF in case that was
what Ross wanted

 meta/classes/fontcache.bbclass                        | 4 ++--
 meta/recipes-graphics/fontconfig/fontconfig_2.11.1.bb | 4 +++-
 scripts/postinst-intercepts/update_font_cache         | 4 +---
 3 files changed, 6 insertions(+), 6 deletions(-)
meta/classes/fontcache.bbclass +0 -0
index dfbdfa1..d122387 100644
@@ -8,11 +8,11 @@ inherit qemu
 
Quoted 4 lines

meta/classes/fontcache.bbclass inherit qemu · line 11

Quoted 4 lines
meta/classes/fontcache.bbclass +1 -1
 FONT_PACKAGES ??= "${PN}"
 FONT_EXTRA_RDEPENDS ?= "fontconfig-utils"
-
+FONTCONFIG_CACHE_DIR ?= "${localstatedir}/cache/fontconfig"

]> > fontcache_common() {

Quoted 27 lines
Quoted 27 lines
meta/classes/fontcache.bbclass +1 -1
 if [ "x$D" != "x" ] ; then
 	$INTERCEPT_DIR/postinst_intercept update_font_cache ${PKG} mlprefix=${MLPREFIX} bindir=${bindir} \
-		libdir=${libdir} base_libdir=${base_libdir} localstatedir=${localstatedir}
+		libdir=${libdir} base_libdir=${base_libdir} fontconfigcachedir=${FONTCONFIG_CACHE_DIR}
 else
 	fc-cache
 fi
meta/recipes-graphics/fontconfig/fontconfig_2.11.1.bb +3 -1
index 797b321..7c5b4b4 100644
@@ -37,6 +37,8 @@ DEBIAN_NOAUTONAME_fontconfig-utils = "1"
 
 inherit autotools pkgconfig
 
-EXTRA_OECONF = " --disable-docs --with-default-fonts=${datadir}/fonts"
+FONTCONFIG_CACHE_DIR ?= "${localstatedir}/cache/fontconfig"
+
+EXTRA_OECONF = " --disable-docs --with-default-fonts=${datadir}/fonts --with-cache-dir=${FONTCONFIG_CACHE_DIR}"
 
 BBCLASSEXTEND = "native"
scripts/postinst-intercepts/update_font_cache +0 -0
index 3907f25..c8c6018 100644
@@ -2,6 +2,4 @@
 
Quoted 8 lines

scripts/postinst-intercepts/update_font_cache line 5

Quoted 6 lines
scripts/postinst-intercepts/update_font_cache +1 -3
 PSEUDO_UNLOAD=1 qemuwrapper -L $D -E LD_LIBRARY_PATH=$D/${libdir}:$D/${base_libdir}\
 					$D${bindir}/fc-cache --sysroot=$D
-chown -R root:root $D${localstatedir}/cache/fontconfig
-
-
+chown -R root:root $D${fontconfigcachedir}

This looks better but what sets fontconfigcachedir ?

It's passed in intercept call in fontcache.bbclass like other variables used here.

Quoted 6 lines

People who want to change the value should do so from global scope, so that the same value is used in fontconfig_2.11.1.bb and fontcache.bbclass.

Once this is merged in master, I would like to see it in dizzy (and fido) branches together with other fontconfig related fixes.

The other fontconfig related fix:
fontcache.bbclass: prepend to PACKAGEFUNCS instead of appending was merged to dizzy recently, so now dizzy is broken for us, because this one (and the one fixing permissions) are missing :/.

Do you expect more changes for this patch or was my explanation enough to get it accepted?

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#18 lore raw
In reply to Martin Jansa
Quoted 2 lines · Martin Jansa

WEBOS_FONTCONFIG_CACHE = "${datadir}/fontconfig/cache"

I'm sure there's a good reason why fontconfig caches are going in datadir but I'm not sure I want to know it :)

Ross

#19 lore raw
Quoted 9 lines · Ross

On 29 March 2015 at 00:28, Martin Jansa <[email protected] <mailto:[email protected]>> wrote:
WEBOS_FONTCONFIG_CACHE = "${datadir}/fontconfig/cache"

I'm sure there's a good reason why fontconfig caches are going in datadir but I'm not sure I want to know it :)

aren’t they variable data files ? where else should it go otherwise

Quoted 6 lines

Ross

Signature · 4 lines
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
#20 lore raw
Quoted 2 lines · Khem Raj

aren’t they variable data files ? where else should it go otherwise

They're directory-wide caches, and caches tend to go into /var/cache.

Ross

#21 lore raw
Quoted 9 lines · Ross

On 30 March 2015 at 17:41, Khem Raj <[email protected] <mailto:[email protected]>> wrote:
aren’t they variable data files ? where else should it go otherwise

They're directory-wide caches, and caches tend to go into /var/cache.

yes /var/cache is what I was expecting too

Quoted 1 line

Ross

#22 lore raw
In reply to Khem Raj
Quoted 11 lines · Khem Raj
Quoted 9 lines · Ross

On 29 March 2015 at 00:28, Martin Jansa <[email protected] <mailto:[email protected]>> wrote:
WEBOS_FONTCONFIG_CACHE = "${datadir}/fontconfig/cache"

I'm sure there's a good reason why fontconfig caches are going in datadir but I'm not sure I want to know it :)

aren’t they variable data files ? where else should it go otherwise

I've replied to Ross off-list because I'm not sure how much details I should share, but basically we have read-only rootfs which has all the font packages installed, so cache from do_rootfs should remain valid forever. And we delete everything in /var during reset to factory settings (that's why we had to move everything which we want to persist during factory resets like this cache).

We also have additional fontconfig patch which ignores timestamp modifications in font directories, so that the cache is considered valid even after some manual modification in rootfs (e.g. in devel images which can be switched to read-write mode).

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#23 lore raw
Quoted 23 lines · Martin Jansa
Quoted 11 lines · Khem Raj
Quoted 9 lines · Ross

On 29 March 2015 at 00:28, Martin Jansa <[email protected] <mailto:[email protected]>> wrote:
WEBOS_FONTCONFIG_CACHE = "${datadir}/fontconfig/cache"

I'm sure there's a good reason why fontconfig caches are going in datadir but I'm not sure I want to know it :)

aren’t they variable data files ? where else should it go otherwise

I've replied to Ross off-list because I'm not sure how much details I should share, but basically we have read-only rootfs which has all the font packages installed, so cache from do_rootfs should remain valid forever. And we delete everything in /var during reset to factory settings (that's why we had to move everything which we want to persist during factory resets like this cache).

Quoted 4 lines

We also have additional fontconfig patch which ignores timestamp modifications in font directories, so that the cache is considered valid even after some manual modification in rootfs (e.g. in devel images which can be switched to read-write mode).

may be copy-binds could be deployed ?

Quoted 3 lines
Signature · 2 lines
-- 
Martin 'JaMa' Jansa     jabber: [email protected]
#24 lore raw
Quoted 23 lines · Khem Raj
Quoted 23 lines · Martin Jansa
Quoted 11 lines · Khem Raj
Quoted 9 lines · Ross

On 29 March 2015 at 00:28, Martin Jansa <[email protected] <mailto:[email protected]>> wrote:
WEBOS_FONTCONFIG_CACHE = "${datadir}/fontconfig/cache"

I'm sure there's a good reason why fontconfig caches are going in datadir but I'm not sure I want to know it :)

aren’t they variable data files ? where else should it go otherwise

I've replied to Ross off-list because I'm not sure how much details I should share, but basically we have read-only rootfs which has all the font packages installed, so cache from do_rootfs should remain valid forever. And we delete everything in /var during reset to factory settings (that's why we had to move everything which we want to persist during factory resets like this cache).

Quoted 6 lines
Quoted 4 lines

We also have additional fontconfig patch which ignores timestamp modifications in font directories, so that the cache is considered valid even after some manual modification in rootfs (e.g. in devel images which can be switched to read-write mode).

may be copy-binds could be deployed ?

We have that but IIRC copy-binds are mounted after or at the same time
the UI is starting in our upstart scripts (to show UI as soon as possible) and we don't want to wait for copy-binds to be finished before loading fontconfig cache.

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]