GNOME Bugzilla – Bug 785898
gdbus-codegen is broken in flatpak SDK
Last modified: 2017-08-29 21:04:02 UTC
Created attachment 357066 [details] traceback gdbus-codegen is currently broken when used from the org.gnome.Sdk//master branch. (It seems to be fine in the 3.24 branch). Various GNOME newcomer projects such as gnome-calendar are currently broken from Builder using this. I see an error such as:
Hmm, could this be a flatpak or SDK bug? The code in gdbus-codegen.in hasn’t significantly changed in years. I don’t have a suitable debugging environment set up for the SDK — could you drop some print()s into gdbus-codegen and see where the path calculations are going wrong?
The only change that I can think of is that the nightly SDK builds have switched to Python 3 for the GLib tools (glib-mkenums, glib-genmarshal, gdbus-codegen). It may be a case of not setting up the search paths appropriately in Builder.
We mostly just run commands with "flatpak build" or "flatpak-builder --run" so I'm not sure what search paths we would need to setup? (In reply to Philip Withnall from comment #1) > Hmm, could this be a flatpak or SDK bug? The code in gdbus-codegen.in hasn’t > significantly changed in years. I don’t have a suitable debugging > environment set up for the SDK — could you drop some print()s into > gdbus-codegen and see where the path calculations are going wrong? It appears to me it's not using the proper site directories. I don't see PYTHONPATH or anything being set when we run our helpers at least.
The command we are running from Builder that results in this error is: flatpak build \ --env=PATH=/app/bin:/bin:/usr/bin \ --env=V=0 \ --env=CCACHE_DIR=/home/christian/Projects/gnome-calendar/.flatpak-builder/ccache \ --share=network \ --nofilesystem=host \ --filesystem=/home/christian/Projects/gnome-calendar \ --filesystem=/home/christian/.var/app/org.gnome.Builder/cache/gnome-builder/builds/GNOME-Calendar/org.gnome.Calendar.json-eb93b20f94c42fa5b4b060b9bcb5ce7b72da7af5-local-flatpak-org.gnome.Platform-x86_64-master \ --build-dir=/home/christian/.var/app/org.gnome.Builder/cache/gnome-builder/builds/GNOME-Calendar/org.gnome.Calendar.json-eb93b20f94c42fa5b4b060b9bcb5ce7b72da7af5-local-flatpak-org.gnome.Platform-x86_64-master \ '--env=CFLAGS=-O2 -g' \ '--env=CXXFLAGS=-O2 -g' \ --env=V=1 \ --env=NOCONFIGURE=1 \ /home/christian/.var/app/org.gnome.Builder/cache/gnome-builder/flatpak/staging/GNOME-Calendar/flatpak:org.gnome.Platform-x86_64-master \ make \ V=0 \ -j20 \ all
I did some changes to make the master gnome-sdk build again, and with this updated I seem to be able to build gnome-calendary git master with: flatpak-builder app org.gnome.Calendar.json Is this fixed now, or is the issue somehow specific to how gnome-builder calls out to build id?
It looks like this was caused by our flatpak-subprocess-launcher-helper setting $PATH to "/app/bin:/bin:/usr/bin". It was executing /bin/gdbus-codegen which then could not load relative things correctly. This is fixed in Builder commit 6376d739c00a79d1a7a0dec6e15b9012a021cfe5 by removing "/bin" from PATH. (Which is more close to "flatpak run org.gnome.Sdk" anyway).