Skip to content

girepository: Skip GIRepository versions not matching GIRepository-3.0

Simon McVittie requested to merge wip/smcv/girepository-must-be-3.0 into main
  • girepository: Skip GIRepository versions not matching GIRepository-3.0

    A few applications such as gnome-music load the GIRepository typelib and use it to adjust their search paths.

    GLib 2.79.x now provides libgirepository-2.0.so.0 (GIRepository-3.0), but each OS distribution is likely to have a transitional period during which GLib's libgirepository-2.0.so.0 has become available, but bindings like PyGI and gjs are still linked to gobject-introspection's libgirepository-1.0.so.1 (GIRepository-2.0).

    During this transitional period, interpreted languages that load the GIRepository namespace could get the "wrong" version, which will result in adjusting a search path that will not actually affect the language binding's typelib lookup, and could also lead to symbol and type-system conflicts.

    We can avoid this collision by making GLib's GIRepository library refuse to load versions of the GIRepository typelib that are not 3.0, and similarly making gobject-introspection's GIRepository library refuse to load typelib versions that are not 2.0. A relatively neat way to achieve that is to make each version behave as if the other one doesn't exist.

Edited by Simon McVittie

Merge request reports