Best way to sandbox GTK to run a git bisect

I’ve found an obscure situation where something works correctly in GTK3 but fails silently in GTK4. I’d like to try a git bisect, but it’s likely to break my desktop unless I can set up some sort of sandbox. I also need to be able to run gjs against the test version of GTK.

Can it be done as simply as installing in a non-standard location and using LD_LIBRARY_PATH, GI_TYPELIB_PATH etc to run the test? If not, what’s the next best way? I think I’ve read that GTK has good support for building in a Flatpak environment, so maybe that? I’ve never used it before, though. If it’s complicated, maybe I should just resort to overwriting the system GTK and running the test in KDE Plasma.

I have been able to debug GTK issues by simply building it in a folder with meson/ninja and then doing:

LD_LIBRARY_PATH=<path to meson build root>/gtk myprogram

(edge case: if you make any breaking changes to the ABI and you’re testing other language bindings that use girepository, you may also have to set GI_TYPELIB_PATH)

Edit: Actually I see you already have those for the gwebgl library in in your, so you may just want to add the gtk path there for testing.

Ah, being able to use the build root will be handy if I want to try debugging again. I just installed it into a non-standard location. And I did already know about GI_TYPELIB_PATH.

The bisect turned out to be a flop though. I ran into commits where GtkGLArea (or something critical) was even more badly broken. It looks like it got kind of ripped up then rebuilt somewhere along the line, so it’s probably going to be too hard to work out exactly what difference is responsible for this far more subtle issue. There’s a small chance that I could skip the bad parts by doing git reset --hard to the next tag, but I think it’s more likely that the change I’m looking for is buried in the mess.

You cannot possibly bisect between GTK3 and GTK4: you’d be bisecting through 4.5 years of non-linear development. In the meantime, the entirety of the rendering pipeline changed.

You’re right. It was “fun” to try though. Luckily someone has worked out what went wrong in the thread referenced above. It was my fault of course, and it only appeared to work in GTK3 by some sort of coincidence.

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