yousseb / meld

Meld for macOS
https://yousseb.github.io/meld/
GNU General Public License v2.0
2.3k stars 120 forks source link

Failed to load shared library '/Users/yousseb/gtk/inst/lib/libglib-2.0.0.dylib' (Meld-bin) #28

Closed derimagia closed 7 years ago

derimagia commented 7 years ago

When running Meld-bin I get this error: Related to #4

I know now I need to run /Meld, but it doesn't sit right with me that this path is hardcoded somewhere so adding a bug for it.

❯ /Applications/Meld.app/Contents/MacOS/Meld-bin


** (process:32274): WARNING **: Failed to load shared library '/Users/yousseb/gtk/inst/lib/libglib-2.0.0.dylib' referenced by the typelib: dlopen(/Users/yousseb/gtk/inst/lib/libglib-2.0.0.dylib, 9): image not found

** (process:32274): WARNING **: Failed to load shared library '/Users/yousseb/gtk/inst/lib/libgobject-2.0.0.dylib' referenced by the typelib: dlopen(/Users/yousseb/gtk/inst/lib/libgobject-2.0.0.dylib, 9): image not found
Traceback (most recent call last):
  File "/Applications/Meld.app/Contents/Resources/__boot__.py", line 316, in <module>
    _run()
  File "/Applications/Meld.app/Contents/Resources/__boot__.py", line 311, in _run
    exec(compile(source, path, 'exec'), globals(), globals())
  File "/Applications/Meld.app/Contents/Resources/meld", line 263, in <module>
    check_requirements()
  File "/Applications/Meld.app/Contents/Resources/meld", line 166, in check_requirements
    from gi.repository import Gtk
  File "/Applications/Meld.app/Contents/Resources/lib/python2.7/gi/importer.py", line 159, in load_module
    dynamic_module = load_overrides(introspection_module)
  File "/Applications/Meld.app/Contents/Resources/lib/python2.7/gi/overrides/__init__.py", line 111, in load_overrides
    override_mod = importlib.import_module('gi.overrides.' + namespace)
  File "importlib/__init__.pyc", line 37, in import_module
  File "/Applications/Meld.app/Contents/Resources/lib/python2.7/gi/overrides/Gtk.py", line 26, in <module>
    from gi.repository import GObject
  File "/Applications/Meld.app/Contents/Resources/lib/python2.7/gi/importer.py", line 159, in load_module
    dynamic_module = load_overrides(introspection_module)
  File "/Applications/Meld.app/Contents/Resources/lib/python2.7/gi/overrides/__init__.py", line 111, in load_overrides
    override_mod = importlib.import_module('gi.overrides.' + namespace)
  File "importlib/__init__.pyc", line 37, in import_module
  File "/Applications/Meld.app/Contents/Resources/lib/python2.7/gi/overrides/GObject.py", line 31, in <module>
    from gi.repository import GLib
  File "/Applications/Meld.app/Contents/Resources/lib/python2.7/gi/importer.py", line 159, in load_module
    dynamic_module = load_overrides(introspection_module)
  File "/Applications/Meld.app/Contents/Resources/lib/python2.7/gi/overrides/__init__.py", line 111, in load_overrides
    override_mod = importlib.import_module('gi.overrides.' + namespace)
  File "importlib/__init__.pyc", line 37, in import_module
  File "/Applications/Meld.app/Contents/Resources/lib/python2.7/gi/overrides/GLib.py", line 36, in <module>
    from gi import _option as option
  File "/Applications/Meld.app/Contents/Resources/lib/python2.7/gi/_option.py", line 47, in <module>
    OPTION_CONTEXT_ERROR_QUARK = GLib.quark_to_string(GLib.option_error_quark())
gi._error.GError: g-invoke-error-quark: Could not locate g_option_error_quark: dlopen(/Users/yousseb/gtk/inst/lib/libgobject-2.0.0.dylib, 9): image not found (1)
2016-12-03 13:34:11.736 Meld-bin[32274:3611798] Meld Error
yousseb commented 7 years ago

You can't run Meld-bin directly. This environment variable needs to be set before the binary starts... https://github.com/yousseb/meld/blob/master/osx/Meld#L38

I've looked left and right and it cannot be changed at runtime..

derimagia commented 7 years ago

I'm more concerned that the path "/Users/yousseb/gtk/" is compiled in, this doesn't seem correct at all.

yousseb commented 7 years ago

That's what the DYLD_LIBRARY_PATH is overriding.. Unfortunately, not changeable.. I could've compiled in /tmp to make it global for everyone and then used a startup script to link /tmp/gtk to point to where you installed Meld (in /Applications or /Users/you/Applications) as gimp does, but it would still be a wrapper.

Nothing I could do here, really...