Skip to contentSkip to conversation

gdk-pixbuf: Avoid rebuild failures

PATCH In review Richard Purdie 3 participants 6 messages Sep 23, 2015 – Sep 25, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gdk-pixbuf: Avoid rebuild failures

If gdkpixbuf-native rebuilds and there are stale (broken) modules lying around, it can fail to run the postinst. E.g. svg links to harfbuzz and if harfbuzz is removed from the sysroot but the svg loader isn't, we get a symbol linking issue.

The reproducer is along the lines of build gdk-pixbuf-native along with harfbuzz-native and librsvg-native, then make a small change to the gdk-pixbuf recipe that would cause it to rebuild, clean harfbuzz-native and then build gdk-pixbuf.

To fix this, when we install gdk-pixbuf, we wipe out any previous loaders. The idea is that gdk would always come first and anything else installing itself will come later and rerun the postinst if needed. We can therefore just remove any other loaders.

meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.30.8.bb +9 -0
index bdf173a..35bb192 100644
@@ -94,3 +94,12 @@ do_install_append_class-native() {
 		GDK_PIXBUF_MODULEDIR=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders
 }
 BBCLASSEXTEND = "native"
+
+SSTATEPREINSTFUNCS_append_class-native = " gdkpixbuf_sstate_preinst"
+SYSROOT_PREPROCESS_FUNCS_append_class-native = " gdkpixbuf_sstate_preinst"
+
+gdkpixbuf_sstate_preinst() {
+	if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]; then
+		rm -rf ${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/*
+	fi
+}
#1 lore raw
Quoted 9 lines · Richard Purdie

If gdkpixbuf-native rebuilds and there are stale (broken) modules lying around, it can fail to run the postinst. E.g. svg links to harfbuzz and if harfbuzz is removed from the sysroot but the svg loader isn't, we get a symbol linking issue.

The reproducer is along the lines of build gdk-pixbuf-native along with harfbuzz-native and librsvg-native, then make a small change to the gdk-pixbuf recipe that would cause it to rebuild, clean harfbuzz-native and then build gdk-pixbuf.

Quoted 4 lines

To fix this, when we install gdk-pixbuf, we wipe out any previous loaders. The idea is that gdk would always come first and anything else installing itself will come later and rerun the postinst if needed. We can therefore just remove any other loaders.

Does the analogue of this problem exist for the non-native packages? I've not seen it, but it seems that it might based on your analysis.

Quoted 22 lines
meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.30.8.bb +9 -0
index bdf173a..35bb192 100644
@@ -94,3 +94,12 @@ do_install_append_class-native() {
  		GDK_PIXBUF_MODULEDIR=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders
  }
  BBCLASSEXTEND = "native"
+
+SSTATEPREINSTFUNCS_append_class-native = " gdkpixbuf_sstate_preinst"
+SYSROOT_PREPROCESS_FUNCS_append_class-native = " gdkpixbuf_sstate_preinst"
+
+gdkpixbuf_sstate_preinst() {
+	if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]; then
+		rm -rf ${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/*
+	fi
+}
Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
#2 lore raw
Quoted 10 lines · Gary Thomas
Quoted 9 lines · Richard Purdie

If gdkpixbuf-native rebuilds and there are stale (broken) modules lying around, it can fail to run the postinst. E.g. svg links to harfbuzz and if harfbuzz is removed from the sysroot but the svg loader isn't, we get a symbol linking issue.

The reproducer is along the lines of build gdk-pixbuf-native along with harfbuzz-native and librsvg-native, then make a small change to the gdk-pixbuf recipe that would cause it to rebuild, clean harfbuzz-native and then build gdk-pixbuf.

Quoted 7 lines
Quoted 4 lines

To fix this, when we install gdk-pixbuf, we wipe out any previous loaders. The idea is that gdk would always come first and anything else installing itself will come later and rerun the postinst if needed. We can therefore just remove any other loaders.

Does the analogue of this problem exist for the non-native packages? I've not seen it, but it seems that it might based on your analysis.

No, since we only have the postinst to index the loaders in the native case. In the target case we do that at rootfs time (or on target). So this is a native only issue.

Cheers,

Richard

Acked-by on v1 1/1
#3 lore raw
In reply to Richard Purdie

Hello Richard,

Thanks for hunting this bug, this was very annoying and hard to figure. It does seem to address the issue in our builder.

Quoted 9 lines · Richard Purdie

If gdkpixbuf-native rebuilds and there are stale (broken) modules lying around, it can fail to run the postinst. E.g. svg links to harfbuzz and if harfbuzz is removed from the sysroot but the svg loader isn't, we get a symbol linking issue.

The reproducer is along the lines of build gdk-pixbuf-native along with harfbuzz-native and librsvg-native, then make a small change to the gdk-pixbuf recipe that would cause it to rebuild, clean harfbuzz-native and then build gdk-pixbuf.

Quoted 6 lines

To fix this, when we install gdk-pixbuf, we wipe out any previous loaders. The idea is that gdk would always come first and anything else installing itself will come later and rerun the postinst if needed. We can therefore just remove any other loaders.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
#5 lore raw
Quoted 8 lines · Richard Purdie
Quoted 2 lines · Otavio Salvador

Thanks for hunting this bug, this was very annoying and hard to figure. It does seem to address the issue in our builder.

Sadly, whilst I merged it and it does fix that problem, I suspect this causes:

https://autobuilder.yoctoproject.org/main/builders/nightly-x32/builds/497/steps/BuildImages/logs/stdio

It does seem to be related. But why it did not include the .so files in the sysroot again when resolving the dependencies?

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750