Building Gstreamer Editing Services fails - gstreamer

I run ./autogen.sh inside the cloned repo and it fails saying the following:
configure: No package 'gstreamer-plugins-base-1.0' found
configure: error: no gstreamer-plugins-base-1.0 >= 1.14.1 (GStreamer Base Plugins) found
configure failed
I have gstreamer (base, good, bad and ugly) installed on my Ubuntu. The package name that the build script looks for is gstreamer-plugins-base-1.0 where as the system package is by the name gstreamer1.0-plugins-base.
Digging into the autoconf setup I found the following:
if test -z $GSTPB_PLUGINS_DIR; then
GSTPB_PLUGINS_DIR=`$PKG_CONFIG --variable=pluginsdir gstreamer-plugins-base-[$1]`
if test -z $GSTPB_PLUGINS_DIR; then
AC_MSG_ERROR(
[no pluginsdir set in GStreamer Base Plugins pkg-config file])
fi
fi
Shouldn't it be gstreamer[$1]-plugins-base? Am I missing something here?
Update:
Fixed the above by installing libgstreamer1.0-dev and libgstreamer-plugins-base1.0-dev dev packages
sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
In case GIntrospection isn't installed by default, run the following
sudo apt-get build-dep gstreamer1.0
./autogen.sh would complete and make && sudo make install will run fine too.
Current status: Examples don't build stable binaries. Running c examples segfault and python example, simple.py, complains of missing GES in the namespace.
Traceback (most recent call last):
File "simple.py", line 26, in <module>
gi.require_version('GES', '1.0')
File "/usr/lib/python2.7/dist-packages/gi/__init__.py", line 130, in require_version
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace GES not available
Just for reference: Simple.py looks like this
import gi
gi.require_version('Gst', '1.0')
gi.require_version('GES', '1.0')
from gi.repository import Gst, GES, GLib # noqa
class Simple:
def __init__(self, uri):
timeline = GES.Timeline.new_audio_video()
self.project = timeline.get_asset()
self.project.connect("asset-added", self._asset_added_cb)
self.project.connect("error-loading-asset", self._error_loading_asset_cb)
self.project.create_asset(uri, GES.UriClip)
self.layer = timeline.append_layer()
self._create_pipeline(timeline)
self.loop = GLib.MainLoop()
def _create_pipeline(self, timeline):
self.pipeline = GES.Pipeline()
self.pipeline.set_timeline(timeline)
bus = self.pipeline.get_bus()
bus.add_signal_watch()
bus.connect("message", self.bus_message_cb)
def bus_message_cb(self, unused_bus, message):
if message.type == Gst.MessageType.EOS:
print("eos")
self.loop.quit()
elif message.type == Gst.MessageType.ERROR:
error = message.parse_error()
print("error %s" % error[1])
self.loop.quit()
def start(self):
self.loop.run()
def _asset_added_cb(self, project, asset):
self.layer.add_asset(asset, 0, 0, Gst.SECOND * 5, GES.TrackType.UNKNOWN)
self.pipeline.set_state(Gst.State.PLAYING)
def _error_loading_asset_cb(self, project, error, asset_id, type):
print("Could not load asset %s: %s" % (asset_id, error))
self.loop.quit()
if __name__ == "__main__":
if len(os.sys.argv) != 2:
print("You must specify a file URI")
exit(-1)
Gst.init(None)
GES.init()
simple = Simple(os.sys.argv[1])
simple.start()
Running the C example, simple1.c, fails with the following:
(simple1:15606): GLib-GObject-WARNING **: 12:42:28.910: invalid (NULL) pointer instance
(simple1:15606): GLib-GObject-CRITICAL **: 12:42:28.910: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
(simple1:15606): GLib-GObject-WARNING **: 12:42:28.910: invalid (NULL) pointer instance
(simple1:15606): GLib-GObject-CRITICAL **: 12:42:28.910: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
(simple1:15606): GLib-GObject-CRITICAL **: 12:42:28.910: g_object_set: assertion 'G_IS_OBJECT (object)' failed
[1] 15606 segmentation fault (core dumped) ./simple1 ~/Downloads/out.mp4
Running gdb,
gst-editing-services/examples/c/simple1": not in executable format: File format not recognized
Update
Rebuilt the examples using Meson build system. This enabled running the bins in gdb. Got the following
Program received signal SIGSEGV, Segmentation fault.
ges_track_constructed (object=<optimized out>) at ../ges/ges-track.c:506
506 componame =
Indicating that it failed at ges-track.c. Relevant code below:
if (self->type == GES_TRACK_TYPE_VIDEO) {
componame =
g_strdup_printf ("video_%s", GST_OBJECT_NAME (self->priv->composition));
} else if (self->type == GES_TRACK_TYPE_AUDIO) {
componame = // This is where it errirs
g_strdup_printf ("audio_%s", GST_OBJECT_NAME (self->priv->composition));
}
Stepping into it line by line. The following was revealed.
0x00007ffff701c2cd in __GI__dl_catch_exception (exception=exception#entry=0x7fffffffc980,
operate=0x7ffff54530d0 <dlsym_doit>, args=0x7fffffffc9f0) at dl-error-skeleton.c:194
194 dl-error-skeleton.c: No such file or directory.

It looks like it has to do with GES internals. Internally, glib objects are not created right and are all NULL. Why is why you have the invalid (NULL) pointer instance.
I was able to run the examples on my mac. Package mismatches seems to be the issue here.

Related

`nix-build` fails because Python wants something that's unavailable, without saying what it wants

(At least I think that's the problem.)
The error
When I run nix-build -A serialosc from the root of nixpkgs, nix prints the following:
[jeff#jbb-dell:~/nix/nixpkgs-fork]$ nix-build -A serialosc
these derivations will be built:
/nix/store/p40wvn28grb8nrcd6scbxhhjqw4495kk-serialosc.drv
building '/nix/store/p40wvn28grb8nrcd6scbxhhjqw4495kk-serialosc.drv'...
unpacking sources
unpacking source archive /nix/store/5zj802wfjd0ima92lpzzsqdjqvrnrwf9-serialosc
source root is serialosc
patching sources
configuring
configure flags: --prefix=/nix/store/b6qzvzmwjdi29nnzc769904wc0mj1cds-serialosc configure
Setting top to : /build/serialosc
Setting out to : /build/serialosc/build
Checking for 'gcc' (C compiler) : gcc
Checking for working poll() : yes
Checking for libudev : yes
Checking for libmonome : yes
Checking for liblo : yes
Checking for function strdup : yes
Checking for function _strdup : not found
Checking for function strndup : yes
Checking for function strcasecmp : yes
Checking for header unistd.h : yes
Checking for header dns_sd.h : yes
Checking for library dl : yes
Traceback (most recent call last):
File "/build/serialosc/.waf-1.8.5-3fc7b0f5070c04bfd3f2489448471a84/waflib/Scripting.py", line 103, in waf_entry_point
run_commands()
File "/build/serialosc/.waf-1.8.5-3fc7b0f5070c04bfd3f2489448471a84/waflib/Scripting.py", line 164, in run_commands
ctx=run_command(cmd_name)
File "/build/serialosc/.waf-1.8.5-3fc7b0f5070c04bfd3f2489448471a84/waflib/Scripting.py", line 155, in run_command
ctx.execute()
File "/build/serialosc/.waf-1.8.5-3fc7b0f5070c04bfd3f2489448471a84/waflib/Configure.py", line 92, in execute
super(ConfigurationContext,self).execute()
File "/build/serialosc/.waf-1.8.5-3fc7b0f5070c04bfd3f2489448471a84/waflib/Context.py", line 92, in execute
self.recurse([os.path.dirname(g_module.root_path)])
File "/build/serialosc/.waf-1.8.5-3fc7b0f5070c04bfd3f2489448471a84/waflib/Context.py", line 133, in recurse
user_function(self)
File "/build/serialosc/wscript", line 259, in configure
stderr=devnull).decode().strip()
File "/nix/store/lbrpma3528hq7gwn8ffbnwaxvsqah0bb-python-2.7.17/lib/python2.7/subprocess.py", line 216, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "/nix/store/lbrpma3528hq7gwn8ffbnwaxvsqah0bb-python-2.7.17/lib/python2.7/subprocess.py", line 394, in __init__
errread, errwrite)
File "/nix/store/lbrpma3528hq7gwn8ffbnwaxvsqah0bb-python-2.7.17/lib/python2.7/subprocess.py", line 1047, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
builder for '/nix/store/p40wvn28grb8nrcd6scbxhhjqw4495kk-serialosc.drv' failed with exit code 2
error: build of '/nix/store/p40wvn28grb8nrcd6scbxhhjqw4495kk-serialosc.drv' failed
[jeff#jbb-dell:~/nix/nixpkgs-fork]$
My suspicion
The problem appears to arise in lib/python2.7/subprocess.py. I found a version of that file online, and the definition of _execute_child seems to make reference to some absolute paths -- for instance, in this passage:
if shell:
args = ["/bin/sh", "-c"] + args
if executable:
args[0] = executable
Therefore my guess is that Nix is building in a sandbox that doesn't offer whatever Python expects. But the error doesn't tell me what Python was hoping to find.
The context
(You might not need this information.)
I'm trying to build serialosc on NixOS 19.09. Here's my fork of nixpkgs, including my broken recipe for serialosc. The fork also includes my libmonome package, which works, and which serialosc depends on, and which is not yet part of the official nixpkgs repo. I've given hard links to the specific commit; they shouldn't change when I update the fork.
Cross-posting from
https://discourse.nixos.org/t/nix-build-fails-because-python-wants-something-thats-unavailable-without-saying-what-it-wants/5675/2
so that it could help people who only find this, answer might continue on NixOS discourse. I tried to keep it helpful for general NixOS writing a derivation debugging, with some Python bits
fetchgit
First, let's help with the fetchgit part in your recipe
src = fetchgit {
# Once, it seemed to finish, and I don't know how! Then it crashed with:
# Switched to a new branch 'fetchgit'
# removing `.git'...
# hash mismatch in fixed-output derivation '/nix/store/5zj802wfjd0ima92lpzzsqdjqvrnrwf9-serialosc':
# wanted: sha256:1vqcxi32wc4pklbddllflkaigkfvd4ykwrjqccayvrk10dx1sna3
# got: sha256:1zmzjasv21ix7i7s58a31k0025ji32hv2jm2ww6s0xhjmr5ax34j
# This way it [[gets pretty far]].
# The fetchSubmodules value I set again seems to have no effect.
url = https://github.com/monome/serialosc.git;
rev = "v1.4.1";
sha256 = "1zmzjasv21ix7i7s58a31k0025ji32hv2jm2ww6s0xhjmr5ax34j";
Perhaps there was a force push? Not sure why it would stop working with the hash
I found that the fetchSubmodules has no effect if you have the hash of the one without the submodules, use nix-prefetch-git --fetch-submodules https://github.com/monome/serialosc which gives
{
"url": "https://github.com/monome/serialosc",
"rev": "cec0ea76b2d5f69afa74d3ffc14a0950e32a7914",
"date": "2019-06-09T21:46:13+02:00",
"sha256": "03qkzslhih72idwafgfxmkwp5v3x048njh0c682phw2ks11plmbp",
"fetchSubmodules": true
}
so use
fetchgit {
url = https://github.com/monome/serialosc;
rev = "cec0ea76b2d5f69afa74d3ffc14a0950e32a7914";
# or rev = version; but that might break with force pushes
sha256 = "03qkzslhih72idwafgfxmkwp5v3x048njh0c682phw2ks11plmbp";
fetchSubmodules = true;
}
wafHook
There is a (slight) wafHook documentation in https://nixos.org/nixpkgs/manual/
Debugging error
It seems to want to do git stuff, here is how I debugged it:
$ nix-shell https://github.com/JeffreyBenjaminBrown/nixpkgs/archive/2bbd131811991bec9ae6b296b5cd1441640c306c.tar.gz -A serialosc --pure
nix-shell $ mkdir /tmp/delme-serialosc
nix-shell $ cd !$
# To find out what a build would do
nix-shell $ type genericBuild
...
# Doing the `if [ -z "${phases:-}" ]; then ...` bit gives us `echo $phases`
# unpackPhase patchPhase configurePhase buildPhase checkPhase installPhase fixupPhase installCheckPhase distPhase
nix-shell $ ${unpackPhase:-unpackPhase}
nix-shell $ cd $sourceRoot
nix-shell $ ${patchPhase:-patchPhase}
nix-shell $ ${configurePhase:-configurePhase}
# Error happens here
nix-shell $ type ${configurePhase:-configurePhase}
# Do the steps until you find it stops in `python ...`
# Python debug info: https://docs.python.org/3/library/pdb.html
nix-shell $ python -m pdb "$wafPath" "${flagsArray[#]}";
(Pdb) continue # or cont, or just c
...
(Pdb) break /nix/store/lbrpma3528hq7gwn8ffbnwaxvsqah0bb-python-2.7.17/lib/python2.7/subprocess.py:1047
(Pdb) continue
> /nix/store/lbrpma3528hq7gwn8ffbnwaxvsqah0bb-python-2.7.17/lib/python2.7/subprocess.py(1047)_execute_child()
-> raise child_exception
(Pdb) up
> /nix/store/lbrpma3528hq7gwn8ffbnwaxvsqah0bb-python-2.7.17/lib/python2.7/subprocess.py(394)__init__()
-> errread, errwrite)
(Pdb) # empty is equivalent to do last command, i.e. up in this case
> /nix/store/lbrpma3528hq7gwn8ffbnwaxvsqah0bb-python-2.7.17/lib/python2.7/subprocess.py(216)check_output()
-> process = Popen(stdout=PIPE, *popenargs, **kwargs)
(Pdb) print(popenargs)
(['git', 'rev-parse', '--verify', '--short', 'HEAD'],)
But you will find you might need to figure a way to avoid waf using git as it cannot access the network unless it's a fixed-output derivation (e.g. those fetching sources). Hopefully the bit about fetchSubmodules will fix it!
Edit: I didn’t read past that it tries to use git, it tries to figure out what version it is, you should somehow make it avoid using git to do that, e.g. grep -r 'rev-parse' suggests editing the wscript file
Edit 2: E.g. something like
--- wscript-old 2020-01-29 15:55:54.100976818 +0000
+++ wscript 2020-01-29 15:55:58.128977024 +0000
## -257,7 +257,7 ##
conf.env.GIT_COMMIT = subprocess.check_output(
["git", "rev-parse", "--verify", "--short", "HEAD"],
stderr=devnull).decode().strip()
- except subprocess.CalledProcessError:
+ except (subprocess.CalledProcessError, OSError):
conf.env.GIT_COMMIT = ''
conf.define("VERSION", VERSION)
perhaps it could be upstreamed too (this leaves the git commit ID as empty in this case)? Or just use substituteInPlace or something to put in the actual commit ID to be
--- wscript-old 2020-01-29 15:55:54.100976818 +0000
+++ wscript 2020-01-29 15:57:56.177983054 +0000
## -249,16 +249,7 ##
conf.env.VERSION = VERSION
- try:
- import os
-
- devnull = open(os.devnull, 'w')
-
- conf.env.GIT_COMMIT = subprocess.check_output(
- ["git", "rev-parse", "--verify", "--short", "HEAD"],
- stderr=devnull).decode().strip()
- except subprocess.CalledProcessError:
- conf.env.GIT_COMMIT = ''
+ conf.env.GIT_COMMIT = 'cec0ea76b2d5f69afa74d3ffc14a0950e32a7914'
conf.define("VERSION", VERSION)
conf.define("_GNU_SOURCE", 1)

Bitbake the latest Gstreamer in Yocto Morty

I would like to bitbake the latest Gstreamer in Yocto Morty, but the error has occured and could not implement the Gstreamer.
I found the gstreamer 1.12.2 recipe at https://github.com/dv1/meta-gstreamer1.0.
So I put meta-gstreamer1.0 directory in sources directory and add BBLAYERS += " ${BSPDIR}/sources/meta-gstreamer1.0 " to build_fb/bblayers.conf.
Then I bitbaked fsl-image-gui and following errors are occured.
ERROR: /home/***/var-fslc-yocto/sources/meta-gstreamer1.0/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.12.2.bb: Error executing a python function in <code>:
The stack trace of python calls that resulted in this exception/failure was:
File: '<code>', lineno: 13, function: <module>
0009:__anon_35__home_***_var_fslc_yocto_sources_poky_meta_classes_devshell_bbclass(d)
0010:__anon_108__home_***_var_fslc_yocto_sources_poky_meta_classes_sstate_bbclass(d)
0011:__anon_45__home_***_var_fslc_yocto_sources_poky_meta_classes_blacklist_bbclass(d)
0012:__anon_158__home_***_var_fslc_yocto_sources_poky_meta_classes_siteinfo_bbclass(d)
*** 0013:__anon_30__home_***_var_fslc_yocto_sources_meta_gstreamer1_0_recipes_multimedia_gstreamer_gstreamer1_0_omx_inc(d)
File: '/home/***/var-fslc-yocto/sources/meta-gstreamer1.0/recipes-multimedia/gstreamer/gstreamer1.0-omx.inc', lineno: 22, function: __anon_30__home_***_var_fslc_yocto_sources_meta_gstreamer1_0_recipes_multimedia_gstreamer_gstreamer1_0_omx_inc
0018:EXTRA_OECONF += "--disable-valgrind --with-omx-target=${GSTREAMER_1_0_OMX_TARGET}"
0019:
0020:python __anonymous () {
0021: omx_target = d.getVar("GSTREAMER_1_0_OMX_TARGET")
*** 0022: if omx_target in ['generic', 'bellagio']:
0023: # Bellagio headers are incomplete (they are missing the OMX_VERSION_MAJOR,#
0024: # OMX_VERSION_MINOR, OMX_VERSION_REVISION, and OMX_VERSION_STEP macros);
0025: # appending a directory path to gst-omx' internal OpenMAX IL headers fixes this
0026: d.appendVar("CFLAGS", " -I${S}/omx/openmax")
Exception: TypeError: getVar() missing 1 required positional argument: 'expand'
ERROR: ExpansionError during parsing /home/***/var-fslc-yocto/sources/meta-gstreamer1.0/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.12.2.bb
Traceback (most recent call last):
File "/home/***/var-fslc-yocto/sources/poky/meta/classes/base.bbclass", line 375, in __anon_656__home_***_var_fslc_yocto_sources_poky_meta_classes_base_bbclass(d=<bb.data_smart.DataSmart object at 0x7fb7a8dcff98>):
pkgconfig = (d.getVar('PACKAGECONFIG', True) or "").split()
> pn = d.getVar("PN", True)
File "/home/***/var-fslc-yocto/sources/poky/bitbake/lib/bb/data_smart.py", line 569, in DataSmart.getVar(var='PACKAGECONFIG', expand=True, noweakdefault=False, parsing=False):
def getVar(self, var, expand, noweakdefault=False, parsing=False):
> return self.getVarFlag(var, "_content", expand, noweakdefault, parsing)
File "/home/***/var-fslc-yocto/sources/poky/bitbake/lib/bb/data_smart.py", line 737, in DataSmart.getVarFlag(var='PACKAGECONFIG', flag='_content', expand=True, noweakdefault=False, parsing=False):
cachename = var + "[" + flag + "]"
> value = self.expand(value, cachename)
File "/home/***/var-fslc-yocto/sources/poky/bitbake/lib/bb/data_smart.py", line 410, in DataSmart.expand(s=" ${GSTREAMER_ORC} ${PACKAGECONFIG_GL} ${#bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} ${#bb.utils.filter('DISTRO_FEATURES', 'directfb vulkan', d)} ${#bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland egl', '', d)} bz2 curl dash dtls hls neon rsvg sbc smoothstreaming sndfile uvch264 webp ", varname='PACKAGECONFIG'):
def expand(self, s, varname = None):
> return self.expandWithRefs(s, varname).value
File "/home/***/var-fslc-yocto/sources/poky/bitbake/lib/bb/data_smart.py", line 400, in DataSmart.expandWithRefs(s=" orc gles2 egl ${#bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} ${#bb.utils.filter('DISTRO_FEATURES', 'directfb vulkan', d)} ${#bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland egl', '', d)} bz2 curl dash dtls hls neon rsvg sbc smoothstreaming sndfile uvch264 webp ", varname='PACKAGECONFIG'):
except Exception as exc:
> raise ExpansionError(varname, s, exc) from exc
bb.data_smart.ExpansionError: Failure expanding variable PACKAGECONFIG, expression was orc gles2 egl ${#bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} ${#bb.utils.filter('DISTRO_FEATURES', 'directfb vulkan', d)} ${#bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland egl', '', d)} bz2 curl dash dtls hls neon rsvg sbc smoothstreaming sndfile uvch264 webp which triggered exception AttributeError: module 'bb.utils' has no attribute 'filter'
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
I found the error "Exception: TypeError: getVar() missing 1 required positional argument: 'expand'" is fixed in Yocto 2.3(Pyro) at https://bugzilla.yoctoproject.org/show_bug.cgi?id=3314.
Furthermore, YP core says gstreamer version for Yocto Morty is 1.8.3 (see https://www.yoctoproject.org/downloads/core/morty22 updates tab).
Do these things mean that we cannot implement gstreamer 1.12.2 or later version in Yocto Morty? Are there any way to do it? Do we have to use Yocto Pyro or later version if we want to implement gstreamer 1.12?
Environment
Yocto Morty (2.2.1) https://github.com/varigit/variscite-bsp-platform/tree/morty#variscite-release-notes
PS:
I rewrite getVar and bitbake proceeded.However I got following error.Would someone help me?
ERROR: gstreamer1.0-plugins-base-1.12.2-r0 do_populate_sysroot: The recipe gstreamer1.0-plugins-base is trying to install files into a shared area when those files already exist. Those files and their manifest location are:
/home/***/var-fslc-yocto/build_fb/tmp/sysroots/imx6ul-var-dart/usr/lib/gstreamer-1.0/libgstrawparse.la
Matched in b'manifest-imx6ul-var-dart-gstreamer1.0-plugins-bad.populate_sysroot'
/home/***/var-fslc-yocto/build_fb/tmp/sysroots/imx6ul-var-dart/usr/lib/gstreamer-1.0/libgstrawparse.so
Matched in b'manifest-imx6ul-var-dart-gstreamer1.0-plugins-bad.populate_sysroot'
Please verify which recipe should provide the above files.
The build has stopped as continuing in this scenario WILL break things, if not now, possibly in the future (we've seen builds fail several months later). If the system knew how to recover from this automatically it would however there are several different scenarios which can result in this and we don't know which one this is. It may be you have switched providers of something like virtual/kernel (e.g. from linux-yocto to linux-yocto-dev), in that case you need to execute the clean task for both recipes and it will resolve this error. It may be you changed DISTRO_FEATURES from systemd to udev or vice versa. Cleaning those recipes should again resolve this error however switching DISTRO_FEATURES on an existing build directory is not supported, you should really clean out tmp and rebuild (reusing sstate should be safe). It could be the overlapping files detected are harmless in which case adding them to SSTATE_DUPWHITELIST may be the correct solution. It could also be your build is including two different conflicting versions of things (e.g. bluez 4 and bluez 5 and the correct solution for that would be to resolve the conflict. If in doubt, please ask on the mailing list, sharing the error and filelist above.
ERROR: gstreamer1.0-plugins-base-1.12.2-r0 do_populate_sysroot: If the above message is too much, the simpler version is you're advised to wipe out tmp and rebuild (reusing sstate is fine). That will likely fix things in most (but not all) cases.
ERROR: gstreamer1.0-plugins-base-1.12.2-r0 do_populate_sysroot: Function failed: sstate_task_postfunc
ERROR: Logfile of failure stored in: /home/***/var-fslc-yocto/build_fb/tmp/work/armv7at2hf-neon-fslc-linux-gnueabi/gstreamer1.0-plugins-base/1.12.2-r0/temp/log.do_populate_sysroot.99466
ERROR: Task (/home/***/var-fslc-yocto/sources/meta-gstreamer1.0/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.12.2.bb:do_populate_sysroot) failed with exit code '1'
ERROR: gstreamer1.0-plugins-base-1.12.2-r0 do_package: Error executing a python function in exec_python_func() autogenerated:
The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
0001:
*** 0002:split_gstreamer10_packages(d)
0003:
File: '/home/***/var-fslc-yocto/sources/meta-gstreamer1.0/recipes-multimedia/gstreamer/gst-plugins-package.inc', lineno: 6, function: split_gstreamer10_packages
0002:PACKAGESPLITFUNCS_append = " set_metapkg_rdepends "
0003:
0004:python split_gstreamer10_packages () {
0005: gst_libdir = d.expand('${libdir}/gstreamer-${LIBV}')
*** 0006: postinst = d.getVar('plugin_postinst')
0007: glibdir = d.getVar('libdir')
0008:
0009: do_split_packages(d, glibdir, '^lib(.*)\.so\.*', 'lib%s', 'gstreamer %s library', extra_depends='', allow_links=True)
0010: do_split_packages(d, gst_libdir, 'libgst(.*)\.so$', d.expand('${PN}-%s'), 'GStreamer plugin for %s', postinst=postinst, extra_depends='')
Exception: TypeError: getVar() missing 1 required positional argument: 'expand'
ERROR: gstreamer1.0-plugins-base-1.12.2-r0 do_package: Function failed: split_gstreamer10_packages
ERROR: Logfile of failure stored in: /home/***/var-fslc-yocto/build_fb/tmp/work/armv7at2hf-neon-fslc-linux-gnueabi/gstreamer1.0-plugins-base/1.12.2-r0/temp/log.do_package.99465
ERROR: Task (/home/***/var-fslc-yocto/sources/meta-gstreamer1.0/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.12.2.bb:do_package) failed with exit code '1'
Since you are migrating recipe for older version of Yocto into a newer, you must be facing consequences of this change in Yocto: expand parameter (the second one) to getVar() and getVarFlag() has become mandatory (from bitbake user manual for morty), previously it was defaulted to False. So, you should correct all occurrences of these operations and add at least False as a second argument.

AttributeError: TestSwitch instance has no attribute 'assertTrue'

I have a following pyunit test case code where I am collecting the result of the function (True or False) and using it to drive my assertion. However, I am getting the "no attribute" error for assertTrue. What is missing here?
I am using python 2.7.8 and pyunit version of PyUnit-1.4.1-py2.7.
The same code when run from the Eclipse (pydev plugin) from my Mac, it works fine. Only when I take this to my Linux box, it does throw below error. So to me it looks like some package incompatibility problem.
import json
import unittest
class TestSwitch(unittest.TestCase):
def testFunction(self):
self.assertTrue(True, "test case failed")
Below is the test suite class.
import unittest
from mysample import TestSwitch
# Create an instance of each test case.
testCase = TestSwitch('testFunction')
# Add test cases to the test suite.
testSuite = unittest.TestSuite()
testSuite.addTest(testCase)
# Execute the test suite.
testRunner = unittest.TextTestRunner(verbosity=2)
testRunner.run(testSuite)
It throws below error.
bash-3.2$ python mysuite.py
testFunction (mysample.TestSwitch) ... ERROR
======================================================================
ERROR: testFunction (mysample.TestSwitch)
----------------------------------------------------------------------
Traceback (most recent call last):
File "workspace/pyunit/mysample.py", line 7, in testFunction
self.assertTrue(True, "test case failed")
AttributeError: TestSwitch instance has no attribute 'assertTrue'
----------------------------------------------------------------------
Ran 1 tests in 0.000s
FAILED (errors=1)
bash-3.2$
For now I've figured a workaround for this problem by using 'assertEqual' comparing with a boolean value and it works. I am not sure why 'assertTrue' and for that matter 'assertFalse' is having problem. I did not change any package version or anything.
The workaround code is as below.
17 def testFunction(self):
18 res = True
19 self.assertEqual(res, True, 'test case failed')

Error deploying on Heroku (ReportLab)

I want to deploy a python / django application on Heroku. In the local environment everything works fine. I use pip to install packages. My requirements.txt is the following:
Django==1.6.2
Pillow==2.4.0
dj-database-url==0.3.0
dj-static==0.0.5
django-ckeditor-updated==4.2.8
django-toolbelt==0.0.1
gunicorn==18.0
html5lib==1.0b3
mongoengine==0.8.7
psycopg2==2.5.2
pyPdf==1.13
pymongo==2.7
pystache==0.5.3
reportlab==3.1.8
six==1.6.1
static==1.0.2
wsgiref==0.1.2
xhtml2pdf==0.0.5
But when deploying on Heroku with the command "git push heroku master" I get the error on "ReportLab" installation:
gcc -pthread -shared build/temp.linux-x86_64-2.7/tmp/pip_build_u4591/reportlab/src/rl_addons/renderPM/_renderPM.o build/temp.linux-x86_64-2.7/tmp/pip_build_u4591/reportlab/src/rl_addons/renderPM/gt1/gt1-parset1.o build/temp.linux-x86_64-2.7/tmp/pip_build_u4591/reportlab/src/rl_addons/renderPM/gt1/gt1-dict.o build/temp.linux-x86_64-2.7/tmp/pip_build_u4591/reportlab/src/rl_addons/renderPM/gt1/gt1-namecontext.o build/temp.linux-x86_64-2.7/tmp/pip_build_u4591/reportlab/src/rl_addons/renderPM/gt1/gt1-region.o build/temp.linux-x86_64-2.7/tmp/pip_build_u4591/reportlab/src/rl_addons/renderPM/libart_lgpl/art_vpath_bpath.o build/temp.linux-x86_64-2.7/tmp/pip_build_u4591/reportlab/src/rl_addons/renderPM/libart_lgpl/art_rgb_pixbuf_affine.o build/temp.linux-x86_64-2.7/tmp/pip_build_u4591/reportlab/src/rl_addons/renderPM/libart_lgpl/art_rgb_svp.o build/temp.linux-x86_64-2.7/tmp/pip_build_u4591/reportlab/src/rl_addons/renderPM/libart_lgpl/art_svp.o build/temp.linux-x86_64-2.7/tmp/pip_build_u4591/reportlab/src/rl_addons/renderPM/libart_lgpl/art_svp_vpath.o build/temp.linux-x86_64-2.7/tmp/pip_build_u4591/reportlab/src/rl_addons/renderPM/libart_lgpl/art_svp_vpath_stroke.o build/temp.linux-x86_64-2.7/tmp/pip_build_u4591/reportlab/src/rl_addons/renderPM/libart_lgpl/art_svp_ops.o build/temp.linux-x86_64-2.7/tmp/pip_build_u4591/reportlab/src/rl_addons/renderPM/libart_lgpl/art_vpath.o build/temp.linux-x86_64-2.7/tmp/pip_build_u4591/reportlab/src/rl_addons/renderPM/libart_lgpl/art_vpath_dash.o build/temp.linux-x86_64-2.7/tmp/pip_build_u4591/reportlab/src/rl_addons/renderPM/libart_lgpl/art_affine.o build/temp.linux-x86_64-2.7/tmp/pip_build_u4591/reportlab/src/rl_addons/renderPM/libart_lgpl/art_rect.o build/temp.linux-x86_64-2.7/tmp/pip_build_u4591/reportlab/src/rl_addons/renderPM/libart_lgpl/art_rgb_affine.o build/temp.linux-x86_64-2.7/tmp/pip_build_u4591/reportlab/src/rl_addons/renderPM/libart_lgpl/art_rgb_affine_private.o build/temp.linux-x86_64-2.7/tmp/pip_build_u4591/reportlab/src/rl_addons/renderPM/libart_lgpl/art_rgb.o build/temp.linux-x86_64-2.7/tmp/pip_build_u4591/reportlab/src/rl_addons/renderPM/libart_lgpl/art_rgb_rgba_affine.o build/temp.linux-x86_64-2.7/tmp/pip_build_u4591/reportlab/src/rl_addons/renderPM/libart_lgpl/art_svp_intersect.o build/temp.linux-x86_64-2.7/tmp/pip_build_u4591/reportlab/src/rl_addons/renderPM/libart_lgpl/art_svp_render_aa.o build/temp.linux-x86_64-2.7/tmp/pip_build_u4591/reportlab/src/rl_addons/renderPM/libart_lgpl/art_misc.o -L/usr/local/lib -L/usr/lib -L/app/.heroku/python/lib -L/app/.heroku/python/lib -lfreetype -lpython2.7 -o build/lib.linux-x86_64-2.7/reportlab/graphics/_renderPM.so
/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libpython2.7.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /app/.heroku/python/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_u4591/reportlab/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-F4RTRK-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_u4591/reportlab
Traceback (most recent call last):
File "/app/.heroku/python/bin/pip", line 9, in <module>
load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/__init__.py", line 185, in main
return command.main(cmd_args)
File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 161, in main
text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 38: ordinal not in range(128)
! Push rejected, failed to compile Python app
To git#heroku.com:mysterious-oasis-7382.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:mysterious-oasis-7382.git'
Jeromes-MacBook-Pro:diagnosystem_proj Jerome$
Your help is appreciated to resolve this issue.
The problem seems to be caused by the presence of a static Python 2.7 library in /usr/local/lib/libpython2.7.a ; to install Reportlab on Heroku correctly using the python-2.7.7 runtime, I changed the order of the directories enumerated by the __call__ function in the inc_lib_dirs class of Reportlab's setup.py file as follows:
Original:
class inc_lib_dirs:
L = None
I = None
def __call__(self):
if self.L is None:
L = []
I = []
if platform == "cygwin":
aDir(L, os.path.join("/usr/lib", "python%s" % sys.version[:3], "config"))
elif platform == "darwin":
# attempt to make sure we pick freetype2 over other versions
aDir(I, "/sw/include/freetype2")
aDir(I, "/sw/lib/freetype2/include")
# fink installation directories
aDir(L, "/sw/lib")
aDir(I, "/sw/include")
# darwin ports installation directories
aDir(L, "/opt/local/lib")
aDir(I, "/opt/local/include")
aDir(I, "/usr/local/include")
aDir(L, "/usr/local/lib")
aDir(I, "/usr/include")
aDir(L, "/usr/lib")
aDir(I, "/usr/include/freetype2")
prefix = sysconfig.get_config_var("prefix")
if prefix:
aDir(L, pjoin(prefix, "lib"))
aDir(I, pjoin(prefix, "include"))
self.L=L
self.I=I
return self.I,self.L
inc_lib_dirs=inc_lib_dirs()
Edited:
class inc_lib_dirs:
L = None
I = None
def __call__(self):
if self.L is None:
L = []
I = []
if platform == "cygwin":
aDir(L, os.path.join("/usr/lib", "python%s" % sys.version[:3], "config"))
elif platform == "darwin":
# attempt to make sure we pick freetype2 over other versions
aDir(I, "/sw/include/freetype2")
aDir(I, "/sw/lib/freetype2/include")
# fink installation directories
aDir(L, "/sw/lib")
aDir(I, "/sw/include")
# darwin ports installation directories
aDir(L, "/opt/local/lib")
aDir(I, "/opt/local/include")
prefix = sysconfig.get_config_var("prefix")
if prefix:
aDir(L, pjoin(prefix, "lib"))
aDir(I, pjoin(prefix, "include"))
aDir(I, "/usr/local/include")
aDir(L, "/usr/local/lib")
aDir(I, "/usr/include")
aDir(L, "/usr/lib")
aDir(I, "/usr/include/freetype2")
self.L=L
self.I=I
return self.I,self.L
inc_lib_dirs=inc_lib_dirs()
I'd love to find a cleaner solution to avoid keeping a modified version in my egg repository.

Crash on Nite initialisation in python program written using primesense2.2.0.30-5

I am using Ubunut 14.04 and have installed OpenNI 2.2, NITE 2.2 and primesense2.2.0.30-5 (https://pypi.python.org/pypi/primesense/2.2.0.30-5)
The sample program mentioned at the above site works quite well however when I am trying to use initialize nite2 the program crashes.
Here is the code:
from primesense import openni2, nite2
openni2.initialize() # can also accept the path of the OpenNI redistribution
nite2.initialize()
if (nite2.is_initialized()):
print "nite2 initialized"
else:
print "nite2 not initialized"
dev = openni2.Device.open_any()
print dev.get_sensor_info(openni2.SENSOR_DEPTH)
depth_stream = dev.create_depth_stream()
depth_stream.start()
frame = depth_stream.read_frame()
frame_data = frame.get_buffer_as_uint16()
depth_stream.stop()
openni2.unload()
Error Report :
Traceback (most recent call last):
File "test.py", line 4, in <module>
nite2.initialize()
File "/usr/local/lib/python2.7/dist-packages/primesense/nite2.py", line 81, in initialize
("\n ".join("%s: %s" % (dir, ex) for dir, ex in exceptions)),)
primesense.utils.InitializationError: NiTE2 could not be loaded:
/home/user/project/kinect/NiTE-Linux-x64-2.2/Samples/Bin/libNiTE2.so: /home/user/project/kinect/NiTE-Linux-x64-2.2/Samples/Bin/libNiTE2.so: undefined symbol: niteDumpUserTrackerCalibrationDataToFile
OpenNI2-FreenectDriver: Closing device freenect://0
I want nite python bindings for user tracking and hand tracking . Did anyone done it before successfully
A workaround is to comment the following lines in file _openni2.py from the primesense python bindings:
global _niteDumpUserTrackerCalibrationDataToFile
_niteDumpUserTrackerCalibrationDataToFile = dll.niteDumpUserTrackerCalibrationDataToFile
_niteDumpUserTrackerCalibrationDataToFile.restype = NiteStatus
_niteDumpUserTrackerCalibrationDataToFile.argtypes = [NiteUserTrackerHandle, NiteUserId, ctypes.c_char_p]
Also, make sure you have a copy/symlink of both the NiTE2 library and folder (Redist/NiTE2 in the archive) in the same directory as your python script.