GNOME Bugzilla – Bug 753564
Gst.init isn't called when checking for dependencies.
Last modified: 2015-10-20 13:34:21 UTC
Created attachment 309164 [details] [review] Workaround for the Gst.init error on latest git enviroment. Whenever i try building from source I get an error saying: "Please call Gst.init(argv) before using GStreamer". Traceback (most recent call last):
+ Trace 235334
_check_requirements()
if not check_requirements():
dependency.check()
formatted_version = self._format_version(self.component)
return list(module.version())
raise NotInitialized("Please call Gst.init(argv) before using GStreamer") gi.overrides.Gst.NotInitialized: Please call Gst.init(argv) before using GStreamer
I tracked the error to the last commit made to the git repository(commit 59f9eb0e7981a167bf2e26472769336ed0aafb14), where the _check_requirements() and _initialize_modules() orders are swapped. Changing to initialize the modules first result in pitivi working as intended. Attaching a diff with the workaround I'm using, not sure if it's the best option.
The https://git.gnome.org/browse/pitivi/commit/?id=59f9eb0e7981a167bf2e26472769336ed0aafb14 commit should not have been made, it should be reverted (at least the switching of _initialize_modules and _check_requirements). Currently if _initialize_modules fails it prints the error and raises it. We could store the exception it raises and raise it after we call _check_requirements (in case _check_requirements did not raise anything). I imagine the goal is to always run _check_requirements, to get a detailed message if some dependency is not up to date.
That commit makes sense we were trying to initialize module and then were checking if those were present on the system... I do not understand why we do check and initialization in 2 passes actually?
Because if the modules are not initialized in a specific order some bugs appear. It might not be the case anymore, ask Mathieu.
Just reverted the commit for now until we find the proper fix. commit 5d2278e25c157d4e5e1982a0a2b3d70e7c4cef1b Author: Thibault Saunier <tsaunier@gnome.org> Date: Mon Aug 17 00:05:04 2015 +0200 Revert "bin: Check dependencies before initializing them" This reverts commit 59f9eb0e7981a167bf2e26472769336ed0aafb14. This commit leaded to: raise NotInitialized("Please call Gst.init(argv) before using GStreamer") https://bugzilla.gnome.org/show_bug.cgi?id=753564
Fixed