Skip to contentSkip to conversation

gdk-pixbuf: remove ptest support

PATCH In review Alexander Kanavin 2 participants 8 messages Jan 26, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 gdk-pixbuf: remove ptest support

Moving to x86-64-v3 instructions revealed that the recipe was doing an entirely incorrect thing: running native gdk-pixbuf-query-loaders executable against the target set of loader .so binaries. This worked, but only by coincidence, and no longer works on build hosts that do not support v3 instructions.

Re-enabling installed tests in a cross compile scenario requires a complete re-think (against the need to run gdk-pixbuf executables to produce the tests), and is best done upstream, so sadly the cross-testing has to be dropped for now.

---
 .../distro/include/ptest-packagelists.inc     |   1 -
 .../0001-Add-use_prebuilt_tools-option.patch  | 173 ------------------
 .../gdk-pixbuf/gdk-pixbuf_2.42.10.bb          |  30 +--
 3 files changed, 3 insertions(+), 201 deletions(-)
 delete mode 100644 meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/0001-Add-use_prebuilt_tools-option.patch
meta/conf/distro/include/ptest-packagelists.inc +0 -1
index 48dec07577..32c341a9bc 100644
@@ -20,7 +20,6 @@ PTESTS_FAST = "\
     flex-ptest \
     gawk-ptest \
     gdbm-ptest \
-    gdk-pixbuf-ptest \
     glib-networking-ptest \
     gzip-ptest \
     json-c-ptest \
meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/0001-Add-use_prebuilt_tools-option.patch deleted +0 -173

173 lines not on this page · raw message

meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.42.10.bb +3 -27
index aa44515fbb..9f1114c7d0 100644
@@ -12,20 +12,18 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
 
 SECTION = "libs"
 
-DEPENDS = "glib-2.0 gdk-pixbuf-native shared-mime-info"
+DEPENDS = "glib-2.0 shared-mime-info"
 DEPENDS:remove:class-native = "gdk-pixbuf-native"
 
 MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
 
 SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \
-           file://run-ptest \
            file://fatal-loader.patch \
-           file://0001-Add-use_prebuilt_tools-option.patch \
            "
 
 SRC_URI[sha256sum] = "ee9b6c75d13ba096907a2e3c6b27b61bcd17f5c7ebeab5a5b439d2f2e39fe44b"
 
-inherit meson pkgconfig gettext pixbufcache ptest-gnome upstream-version-is-even gobject-introspection gi-docgen lib_package
+inherit meson pkgconfig gettext pixbufcache upstream-version-is-even gobject-introspection gi-docgen lib_package
 
 GIR_MESON_OPTION = 'introspection'
 GIR_MESON_ENABLE_FLAG = "enabled"
@@ -36,7 +34,7 @@ LIBV = "2.10.0"
 GDK_PIXBUF_LOADERS ?= "png jpeg"
 
 PACKAGECONFIG = "${GDK_PIXBUF_LOADERS} \
-                 ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}"
+                "
 PACKAGECONFIG:class-native = "${GDK_PIXBUF_LOADERS}"
 
 PACKAGECONFIG[png] = "-Dpng=enabled,-Dpng=disabled,libpng"
@@ -46,14 +44,6 @@ PACKAGECONFIG[tests] = "-Dinstalled_tests=true,-Dinstalled_tests=false"
 
 EXTRA_OEMESON = "-Dman=false"
 
-EXTRA_OEMESON:append:class-target = " \
-    -Duse_prebuilt_tools=true \
-"
-
-EXTRA_OEMESON:append:class-nativesdk = " \
-    -Duse_prebuilt_tools=true \
-"
-
 PACKAGES =+ "${PN}-xlib"
 
 # For GIO image type sniffing
@@ -85,9 +75,6 @@ python populate_packages:prepend () {
     packages = ' '.join(do_split_packages(d, loaders_root, r'^libpixbufloader-(.*)\.so$', 'gdk-pixbuf-loader-%s', 'GDK pixbuf loader for %s'))
     d.setVar('PIXBUF_PACKAGES', packages)
 
-    # The test suite exercises all the loaders, so ensure they are all
-    # dependencies of the ptest package.
-    d.appendVar("RDEPENDS:%s-ptest" % d.getVar('PN'), " " + packages)
 }
 
 do_install:append() {
@@ -97,13 +84,6 @@ do_install:append() {
 
 }
 
-do_install_ptest() {
-        # Remove a bad fuzzing attempt that sporadically fails without a way to reproduce
-	rm ${D}/${datadir}/installed-tests/gdk-pixbuf/pixbuf-randomly-modified.test
-        # https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/issues/215
-	rm ${D}/${datadir}/installed-tests/gdk-pixbuf/pixbuf-jpeg.test
-}
-
 do_install:append:class-native() {
 	find ${D}${libdir} -name "libpixbufloader-*.la" -exec rm \{\} \;
 
@@ -115,10 +95,6 @@ do_install:append:class-native() {
 		XDG_DATA_DIRS=${STAGING_DATADIR} \
 		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
 
-	create_wrapper ${D}/${bindir}/gdk-pixbuf-print-mime-types \
-		XDG_DATA_DIRS=${STAGING_DATADIR} \
-		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
-
 	create_wrapper ${D}/${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders \
 		XDG_DATA_DIRS=${STAGING_DATADIR} \
 		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache \
Signature · 1 line
2.30.2
#1 lore raw

PATCH 2/2 vulkan-samples: branch rename master -> main

---
 meta/recipes-graphics/vulkan/vulkan-samples_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-graphics/vulkan/vulkan-samples_git.bb +1 -1
index c0ce393201..0a936a78e2 100644
@@ -5,7 +5,7 @@ LICENSE = "Apache-2.0"
 
 LIC_FILES_CHKSUM = "file://LICENSE;md5=48aa35cefb768436223a6e7f18dc2a2a"
 
-SRC_URI = "gitsm://github.com/KhronosGroup/Vulkan-Samples.git;branch=master;protocol=https;lfs=0 \
+SRC_URI = "gitsm://github.com/KhronosGroup/Vulkan-Samples.git;branch=main;protocol=https;lfs=0 \
            file://debugfix.patch \
            file://0001-Do-not-use-LFS64-functions-on-linux-musl.patch;patchdir=third_party/spdlog \
            file://0001-Deprecate-u8string_view.patch;patchdir=third_party/spdlog \
Signature · 1 line
2.30.2
#2 lore raw
In reply to Alexander Kanavin
Quoted 10 lines · Alexander Kanavin

Moving to x86-64-v3 instructions revealed that the recipe was doing an entirely incorrect thing: running native gdk-pixbuf-query-loaders executable against the target set of loader .so binaries. This worked, but only by coincidence, and no longer works on build hosts that do not support v3 instructions.

Re-enabling installed tests in a cross compile scenario requires a complete re-think (against the need to run gdk-pixbuf executables to produce the tests), and is best done upstream, so sadly the cross-testing has to be dropped for now.

Quoted 7 lines
---
 .../distro/include/ptest-packagelists.inc     |   1 -
 .../0001-Add-use_prebuilt_tools-option.patch  | 173 ------------------
 .../gdk-pixbuf/gdk-pixbuf_2.42.10.bb          |  30 +--
 3 files changed, 3 insertions(+), 201 deletions(-)
 delete mode 100644 meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/0001-Add-use_prebuilt_tools-option.patch

I don't quite understand this. Does does mean the ptest was working on x86 but not on arm and was silently failing?

Cheers,

Richard

#3 lore raw
Quoted 2 lines · Richard Purdie

I don't quite understand this. Does does mean the ptest was working on x86 but not on arm and was silently failing?

Generating data files needed for ptest was working as long as build host could execute target binaries (build host executable from gdk-pixbuf-native was run with target .so plugins from gdk-pixbuf to do that) and was silently failing when that was not the case (each of the plugins caused a load error due to architecture mismatch -> empty output file). Since we run x86 ptest on x86 host and arm ptest on arm host, it produced the needed file in both cases, but only by coincidence.

Alex

#4 lore raw
Quoted 5 lines · Alexander Kanavin
Quoted 2 lines · Richard Purdie

I don't quite understand this. Does does mean the ptest was working on x86 but not on arm and was silently failing?

Quoted 8 lines

Generating data files needed for ptest was working as long as build host could execute target binaries (build host executable from gdk-pixbuf-native was run with target .so plugins from gdk-pixbuf to do that) and was silently failing when that was not the case (each of the plugins caused a load error due to architecture mismatch -> empty output file). Since we run x86 ptest on x86 host and arm ptest on arm host, it produced the needed file in both cases, but only by coincidence.

Ok, that helps explain it, thanks. Could generate these files using gdk-pixbuf-native?

Cheers,

Richard

#5 lore raw
Quoted 2 lines · Richard Purdie

Ok, that helps explain it, thanks. Could generate these files using gdk-pixbuf-native?

gsk-pixbuf's meson files are written such that the files cannot be supplied from elsewhere. We could patch it in, but upstream will likely reject that:

https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/blob/master/gdk-pixbuf/meson.build#L352

The real fix would be to teach meson to run custom_target() items such as the one above through exe_wrapper (qemu); there is an upstream bug for that (from me) that had no attention so far:
https://github.com/mesonbuild/meson/issues/11029

Alex

#6 lore raw
Quoted 9 lines · Alexander Kanavin
Quoted 2 lines · Richard Purdie

Ok, that helps explain it, thanks. Could generate these files using gdk-pixbuf-native?

gsk-pixbuf's meson files are written such that the files cannot be supplied from elsewhere. We could patch it in, but upstream will likely reject that:

Quoted 6 lines

https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/blob/master/gdk-pixbuf/meson.build#L352

The real fix would be to teach meson to run custom_target() items such as the one above through exe_wrapper (qemu); there is an upstream bug for that (from me) that had no attention so far:
https://github.com/mesonbuild/meson/issues/11029

Lets just patch it. I'd rather keep tests, the patch isn't going to be complicated or that difficult to maintain.

We might even just be able to force a file into the right place at the end of do_install?

Cheers,

Richard

#7 lore raw
Quoted 5 lines · Richard Purdie

Lets just patch it. I'd rather keep tests, the patch isn't going to be complicated or that difficult to maintain.

We might even just be able to force a file into the right place at the end of do_install?

I checked. Out of 23 tests only three require data generated at build time by running target executables - I wrote a patch instead that omits those three tests in cross builds, which should be acceptable upstream.

Generating those data files in a native build and injecting them into the target build tree can be done, but runs a risk of native vs. target mismatch in the content, and most likely won't be liked by upstream.

Alex