Xpra-org / gtk-osx-build

Build setup to help building the Mac OS X port of GTK+
http://gtk-osx.sourceforge.net/
0 stars 2 forks source link

assert g_type != TYPE_NONE #21

Closed totaam closed 1 year ago

totaam commented 3 years ago

Just like https://github.com/Xpra-org/gtk-osx-build/issues/20#issue-943258833 and https://github.com/Xpra-org/gtk-osx-build/issues/7#issuecomment-765525544.

py2app step:
./setup.py py2app  --without-server --without-shadow --without-proxy
 (see /Users/macos/xpra/py2app.log for details - this may take a minute or two)
ERROR: py2app failed

  File "/Users/macos/gtk/inst/lib/python3.9/site-packages/gi/importer.py", line 144, in load_module
    importlib.import_module('gi.repository.' + dep.split("-")[0])
  File "/Users/macos/gtk/inst/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
  File "/Users/macos/gtk/inst/lib/python3.9/site-packages/gi/importer.py", line 145, in load_module
    dynamic_module = load_overrides(introspection_module)
  File "/Users/macos/gtk/inst/lib/python3.9/site-packages/gi/overrides/__init__.py", line 118, in load_overrides
    override_mod = importlib.import_module(override_package_name)
  File "/Users/macos/gtk/inst/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/Users/macos/gtk/inst/lib/python3.9/site-packages/gi/overrides/Pango.py", line 41, in <module>
    FontDescription = override(FontDescription)
  File "/Users/macos/gtk/inst/lib/python3.9/site-packages/gi/overrides/__init__.py", line 195, in override
    assert g_type != TYPE_NONE
AssertionError

Really not sure what causes this or how to fix it. IIRC, last time I saw this was caused by a DLL path issue, perhaps caused by #19?

totaam commented 3 years ago

Only a problem for CLIENT_ONLY=1 builds.

totaam commented 1 year ago

I am no longer seeing this problem when packaging, only when trying to run code from a jhbuild shell.

For some strange reason, we now have to set LD_LIBRARY_PATH to run test commands, ie:

LD_LIBRARY_PATH=$JHBUILD_PREFIX/lib python3 xpra/platform/path.py
totaam commented 11 months ago

Re-appeared when building the v5.x branch, and not for master! Ran the offending import from a shell:

$ python3 -c "from gi.repository import GLib, GdkPixbuf, Pango, GObject, Gtk, Gdk"
** (process:13827): WARNING **: 12:32:48.766: Failed to load shared library 'libgdk_pixbuf-2.0.0.dylib' \
    referenced by the typelib: dlopen(libgdk_pixbuf-2.0.0.dylib, 0x0009): tried: \
    'libgdk_pixbuf-2.0.0.dylib' (no such file), \
    '/System/Volumes/Preboot/Cryptexes/OSlibgdk_pixbuf-2.0.0.dylib' (no such file), \
    '/usr/lib/libgdk_pixbuf-2.0.0.dylib' (no such file, not in dyld cache), \
    'libgdk_pixbuf-2.0.0.dylib' (no such file), \
    '/usr/local/lib/libgdk_pixbuf-2.0.0.dylib' (no such file), \
    '/usr/lib/libgdk_pixbuf-2.0.0.dylib' (no such file, not in dyld cache)
(..)
    assert g_type != TYPE_NONE

Workaround in https://github.com/Xpra-org/xpra/commit/262cffc6b3745c68db8b528405652ed1ca709bc8

Why doesn't setting DYLD_LIBRARY_PATH help? Why is it failing for gdk pixbuf? Could this be jpeg related? (#19)