Can't build GLib et al with `jhbuild` - error "glib-compile-resources: undefined symbol: g_string_free_and_steal"

Hi, I’ve not done any of this in a while, so please excuse me if I’m missing something obvious… but I’m getting the below error when trying to build GLib or related libraries using latest JHBuild.

It seems the built version of glib-compile-resources is wrongly trying to use my system (Debian unstable) version of GLib, not the same version it just built… and my attempts to ‘force’ this by e.g. running LD_LIBRARY_PATH=/path/to/built/version jhbuild ... have not gotten me anywhere.

Please can someone advise? Thanks in advance.

*** Building glib *** [9/28]
[1/382] Generating gio/tests/digit_test_resources.h with a custom command
FAILED: gio/tests/digit_test_resources.h 
/home/dboles/.cache/jhbuild/build/glib/gio/glib-compile-resources --compiler=gcc --target=gio/tests/digit_test_resources.h --sourcedir=/home/dboles/jhbuild/checkout/gnome/glib/gio/tests --internal --generate --manual-register ../../../../jhbuild/checkout/gnome/glib/gio/tests/111_digit_test.gresource.xml
/home/dboles/.cache/jhbuild/build/glib/gio/glib-compile-resources: symbol lookup error: /home/dboles/.cache/jhbuild/build/glib/gio/glib-compile-resources: undefined symbol: g_string_free_and_steal
[2/382] Generating gio/tests/digit_test_resources.c with a custom command
FAILED: gio/tests/digit_test_resources.c 
/home/dboles/.cache/jhbuild/build/glib/gio/glib-compile-resources --compiler=gcc --target=gio/tests/digit_test_resources.c --sourcedir=/home/dboles/jhbuild/checkout/gnome/glib/gio/tests --sourcedir=/home/dboles/.cache/jhbuild/build/glib/gio/tests --internal --generate-source --manual-register ../../../../jhbuild/checkout/gnome/glib/gio/tests/111_digit_test.gresource.xml
/home/dboles/.cache/jhbuild/build/glib/gio/glib-compile-resources: symbol lookup error: /home/dboles/.cache/jhbuild/build/glib/gio/glib-compile-resources: undefined symbol: g_string_free_and_steal
[10/382] Linking target gio/tests/gdbus-testserver
ninja: build stopped: subcommand failed.
*** Error during phase build of glib: ########## Error running ninja   *** [9/28]

This looks like a Meson bug, or a problem with how GLib is using Meson.

As you say, it looks like it’s correctly running the version of glib-compile-resources from the build tree, but that process is loading the system installed version of rather than the version from the build tree.

Does the same thing happen if you build GLib outside of jhbuild? What’s the environment variables which jhbuild is setting?

1 Like

Thanks for the reply! When I built with just Meson, it is fine. And your point about environment variables led me to ~/.jhbuildrc and from there my ancient prefix from 2 years ago, which contained an old built version of glib. Removing *libglib-2*.so* from there seems to have done the trick, at least after forcing Debian to use the newer system GLib from repo rc-buggy (formerly experimental).

So, on to the next modules and probably next problems, but I’ll know to nuke the old copies in the JHbuild prefix as a first try next time :smiley:

Thanks again, appreciate it!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.