lv2-turtle-helper: handle inifite qemu runs as error

distrho-ports ttl generation with qemu has alway been pain: For unknown reasons
some plugins caues qemu to run infinite. Up to now we could ignore particular
plugins by adding them to LV2_PLUGIN_BLACKLIST_QEMU} but since the affected
plugins change from time to time maintaining this turned into pain. So handle
infinit qemu runs as error. To achive we:

* add qemu-with-timeout-native which injects coreutils' 'timeout' into command
  line by creatin wrappers for all qemu-* available
* rework qemu-ext-musicians.bbclass (was renamed to avoid conflicts with
  meta-qt5-extra's qemu-ext)
* rework lv2-turtle-helper.bbclass and adjust logs

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
This commit is contained in:
Andreas Müller
2020-03-11 23:59:18 +01:00
parent 1812c9d863
commit c04392ec85
11 changed files with 47 additions and 31 deletions

View File

@@ -29,10 +29,7 @@ LV2_POSTINST_MANIFEST = "${datadir}/${BPN}/lv2-postinst-manifest"
# (added by git-submodule) we can set a default matchin > 80%+
LV2_TTL_GENERATOR ?= "${S}/dpf/utils/lv2_ttl_generator"
# For some plugins qemu never finishes so we need a blacklist
LV2_PLUGIN_BLACKLIST_QEMU ?= ""
inherit qemu-ext audio-plugin-common
inherit qemu-ext-musicians audio-plugin-common
# override this function and execute sed (or other magic) to adjust Makefiles
# so that lv2-ttl-generator is not executed but plugin information. Same here:
@@ -54,30 +51,33 @@ do_compile_prepend() {
rm -f ${LV2_PLUGIN_POSTINST_INFO_FILE}
}
do_compile[vardeps] += "LV2_PLUGIN_BLACKLIST_QEMU LV2_TTL_GENERATOR"
do_compile[vardeps] += "LV2_TTL_GENERATOR"
do_compile_append() {
rm -f ${LV2_PLUGIN_INFO_FILE_CLEANED}
if [ -e ${LV2_PLUGIN_INFO_FILE} ]; then
echo "lv2-plugins found - try ttl-generation with '${LV2_TTL_GENERATOR}"
echo
echo "---------- start of lv2 ttl generation ----------"
echo "lv2-plugins found - try ttl-generation with LV2_TTL_GENERATOR: '${LV2_TTL_GENERATOR}'"
# try build ttl-files with quemu
for sofile in `sort ${LV2_PLUGIN_INFO_FILE} | uniq`; do
echo $sofile >> ${LV2_PLUGIN_INFO_FILE_CLEANED}
sobase=`basename $sofile`
ttl_failed=""
if echo "${LV2_PLUGIN_BLACKLIST_QEMU}" | grep -q "$sobase"; then
echo "$sobase found in blacklist - postpone ttl-genaration to ontarget postinst"
ttl_failed="true"
fi
if [ "x${ttl_failed}" = "x" ]; then
cd `dirname ${sofile}`
echo "QEMU lv2-ttl-generator for ${sofile}..."
${@qemu_run_binary_local(d, '${STAGING_DIR_TARGET}', '${LV2_TTL_GENERATOR}')} ${sofile} || ttl_failed="true"
${@qemu_run_binary_local(d, '${STAGING_DIR_TARGET}', '${LV2_TTL_GENERATOR}')} ${sofile} || ttl_failed="$?"
if [ "x${ttl_failed}" = "x" ]; then
echo "Generation succeeded."
else
# If qemu fails: remove generated core files & prepare for postinst fallback
echo "ERROR: for QEMU ${LV2_TTL_GENERATOR} for ${sofile} failed!"
rm -f *.core
if [ "x${ttl_failed}" = "x124" ]; then
echo "ERROR: ttl-generation for `basename ${sofile}` timed out!"
else
echo "ERROR: ttl-generation for `basename ${sofile}` failed!"
echo "LV2_TTL_GENERATOR set correctly - check few lines above?"
# qemu failed: remove generated core files
rm -f *.core
fi
fi
fi
if [ "x${ttl_failed}" != "x" ]; then

View File

@@ -1,6 +1,6 @@
inherit qemu
DEPENDS += "qemu-native"
DEPENDS_append = " qemu-native qemu-with-timeout-native coreutils-native"
# This is an extended/modified qemu.bbclass tailored four our needs:
#
@@ -11,12 +11,16 @@ DEPENDS += "qemu-native"
# not yet installed.
# * A recipe can set an extra library path in 'QEMU_EXTRA_LIBDIR'. This path is
# an absolute path.
# * To catch infine qemu runs we make use of qemu-with-timeout-native which
# hand timeouts as errors
def qemu_run_binary_local(data, rootfs_path, binary):
libdir = rootfs_path + data.getVar("libdir")
base_libdir = rootfs_path + data.getVar("base_libdir")
extra_libdir = data.getVar("QEMU_EXTRA_LIBDIR")
if extra_libdir:
return qemu_wrapper_cmdline(data, rootfs_path, [libdir, base_libdir, extra_libdir]) + binary
cmdline = qemu_wrapper_cmdline(data, rootfs_path, [libdir, base_libdir, extra_libdir]) + binary
else:
return qemu_wrapper_cmdline(data, rootfs_path, [libdir, base_libdir]) + binary
cmdline = qemu_wrapper_cmdline(data, rootfs_path, [libdir, base_libdir]) + binary
return cmdline.replace(qemu_target_binary(data), qemu_target_binary(data) + '-timeout')

View File

@@ -17,7 +17,7 @@ SRCREV = "e5c08dc2483c444d18d24a37c395274002320f5c"
S = "${WORKDIR}/git"
PV = "0.90.1"
inherit autotools-brokensep pkgconfig gtk-icon-cache bash-completion qemu-ext
inherit autotools-brokensep pkgconfig gtk-icon-cache bash-completion qemu-ext-musicians
DEPENDS += " \
gtk+ \

View File

@@ -17,7 +17,7 @@ PV = "2.0.0+git${SRCPV}"
REQUIRED_DISTRO_FEATURES = "x11"
inherit qmake5_base pkgconfig qemu-ext features_check mime mime-xdg gtk-icon-cache
inherit qmake5_base pkgconfig qemu-ext-musicians features_check mime mime-xdg gtk-icon-cache
B = "${S}"

View File

@@ -47,13 +47,6 @@ DEPENDS += " \
LV2_TTL_GENERATOR = "${B}/libs/lv2_ttl_generator"
LV2_PLUGIN_BLACKLIST_QEMU = " \
drowaudio-tremolo.so \
drumsynth.so \
eqinox.so \
HiReSam.so \
"
do_ttl_sed() {
# keep unmodified scripts for distrho-ports-extra
cp -r ${S}/scripts ${WORKDIR}

View File

@@ -1,6 +1,6 @@
require ${BPN}.inc
inherit autotools-brokensep pkgconfig features_check gtk-icon-cache qemu-ext
inherit autotools-brokensep pkgconfig features_check gtk-icon-cache qemu-ext-musicians
REQUIRED_DISTRO_FEATURE = "x11"

View File

@@ -3,7 +3,7 @@ HOMEPAGE = "http://tytel.org/helm/"
LICENSE = "GPLv3"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
inherit dos2unix qemu-ext features_check gtk-icon-cache pack_audio_plugins mime-xdg
inherit dos2unix qemu-ext-musicians features_check gtk-icon-cache pack_audio_plugins mime-xdg
REQUIRED_DISTRO_FEATURES = "x11"

View File

@@ -86,7 +86,7 @@ SRC_URI = " \
https://freewavesamples.com/files/YamahaRX15Kit.h2drumkit;downloadfilename=YamahaRX15Kit.tar.gz;name=YamahaRX15Kit;subdir=drumkits \
https://freewavesamples.com/files/YamahaTG-55Kit.h2drumkit;downloadfilename=YamahaTG-55Kit.tar.gz;name=YamahaTG-55Kit;subdir=drumkits \
"
SRCREV = "e317548515bfc64b973f873b47fa6c1f8df73297"
SRCREV = "9dfab9acc576e6bbe99e6f519d948d16094a6509"
PV ="1.0.0~beta1+git${SRCPV}"
S = "${WORKDIR}/git"

View File

@@ -1,6 +1,6 @@
require ${BPN}.inc
inherit features_check pack_audio_plugins qemu-ext
inherit features_check pack_audio_plugins qemu-ext-musicians
REQUIRED_DISTRO_FEATURES = "x11"

View File

@@ -2,7 +2,7 @@ HOMEPAGE = "http://zynaddsubfx.sourceforge.net"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=21fa88a5e50a1c608d22612c1fbe1971"
inherit cmake qemu-ext pkgconfig gtk-icon-cache features_check pack_audio_plugins
inherit cmake qemu-ext-musicians pkgconfig gtk-icon-cache features_check pack_audio_plugins
REQUIRED_DISTRO_FEATURES = "x11"

View File

@@ -0,0 +1,19 @@
SUMMARY = "qemu wrapper: add timout to qemu for infinite loop situations"
LICENSE = "MIT"
IC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
inherit native
DEPENDS += "qemu-native"
DEFAULT_TIMEOUT ?= "30"
do_install() {
install -d ${D}${bindir}
for qemu in `find ${STAGING_BINDIR_NATIVE} -name qemu-*`; do
orig_name=`basename $qemu`
wrapper_name="$orig_name-timeout"
echo "timeout ${DEFAULT_TIMEOUT} $orig_name \$@" > ${D}${bindir}/$wrapper_name
chmod +x ${D}${bindir}/$wrapper_name
done
}