Skip to content

Add back the missing plugins schema compilation steps

Arun Mani J requested to merge arun-mani-j/phosh:compile-schemas into main

I'm not sure if I'm doing this right, so I will narrate what happened.

I wanted to run and test !1621 (merged).

So I did: meson compile -C build and ran the run_tool for plugin-prefs. But got this error:

$ build/tools/run_tool build/tools/plugin-prefs
+ exec build/tools/plugin-prefs
(plugin-prefs:35092): phosh-plugin-loader-DEBUG: 18:38:49.818: Will load plugins from '/home/arun-mani-j/Projects/Phosh/phosh/build/plugins/calendar/prefs' for 'phosh-lockscreen-widget-prefs'
(plugin-prefs:35092): phosh-plugin-loader-DEBUG: 18:38:49.818: Will load plugins from '/home/arun-mani-j/Projects/Phosh/phosh/build/plugins/emergency-info/prefs' for 'phosh-lockscreen-widget-prefs'
(plugin-prefs:35092): phosh-plugin-loader-DEBUG: 18:38:49.819: Will load plugins from '/home/arun-mani-j/Projects/Phosh/phosh/build/plugins/launcher-box/prefs' for 'phosh-lockscreen-widget-prefs'
(plugin-prefs:35092): phosh-plugin-loader-DEBUG: 18:38:49.819: Will load plugins from '/home/arun-mani-j/Projects/Phosh/phosh/build/plugins/ticket-box/prefs' for 'phosh-lockscreen-widget-prefs'
(plugin-prefs:35092): phosh-plugin-loader-DEBUG: 18:38:49.820: Will load plugins from '/home/arun-mani-j/Projects/Phosh/phosh/build/plugins/upcoming-events/prefs' for 'phosh-lockscreen-widget-prefs'
(plugin-prefs:35092): phosh-plugin-loader-DEBUG: 18:38:49.820: Loading plugin emergency-info-prefs
(plugin-prefs:35092): phosh-plugin-loader-DEBUG: 18:38:49.843: Loading plugin ticket-box-prefs

(plugin-prefs:35092): GLib-GIO-ERROR **: 18:38:49.849: Settings schema 'sm.puri.phosh.plugins.ticket-box' is not installed
fish: Job 1, 'build/tools/run_tool build/tool…' terminated by signal SIGTRAP (Trace or breakpoint trap)

So I looked at the available plugin schemas:

$ build/tools/run_tool gsettings list-schemas | grep "plugins"
+ exec gsettings list-schemas
org.gnome.eog.plugins
org.gnome.settings-daemon.plugins
org.gnome.settings-daemon.plugins.color
org.gnome.settings-daemon.plugins.housekeeping
org.gnome.settings-daemon.plugins.media-keys
org.gnome.settings-daemon.plugins.power
org.gnome.settings-daemon.plugins.wwan
org.gnome.settings-daemon.plugins.xsettings
sm.puri.phosh.plugins
sm.puri.phosh.plugins.launcher-box

Then I saw what the build directory of ticket-box has:

$ ls build/plugins/ticket-box/
libphosh-plugin-ticket-box.so*       prefs/
libphosh-plugin-ticket-box.so.p/     ticket-box.desktop.in
phosh-plugin-ticket-box-resources.c  ticket-box.plugin
phosh-plugin-ticket-box-resources.h

No schemas 🤔? Okay then what does launcher-box have special?

$ s build/plugins/launcher-box/
gschemas.compiled                 libphosh-plugin-launcher-box.so.p/
launcher-box.desktop.in           phosh-plugin-launcher-box-resources.c
launcher-box.plugin               phosh-plugin-launcher-box-resources.h
libphosh-plugin-launcher-box.so*

Okay it has gschemas.compiled...

Then I opened meson.build of ticket-box and launcher-box and found that:

compiled = gnome.compile_schemas(
  build_by_default: true
)

is missing in ticket-box.

It seems to have been "missed" during 71aa6e2b.

Assuming, pomodoro-quick-setting to be the golden truth (as it was recently added, so has new code), I saw that it has the gnome.compile_schemas step too.

Then I found out the plugins with schemas:

$ fdfind schema plugins/
plugins/launcher-box/sm.puri.phosh.plugins.launcher-box.gschema.xml
plugins/pomodoro-quick-setting/mobi.phosh.plugins.pomodoro.gschema.xml
plugins/ticket-box/sm.puri.phosh.plugins.ticket-box.gschema.xml
plugins/upcoming-events/sm.puri.phosh.plugins.upcoming-events.gschema.xml

And checked their meson.build. ticket-box and upcoming-events miss this gnome.compile_schemas step.

After adding it back and adding missing plugins to run_tool's schemas directory, the schemas are found:

$ build/tools/run_tool gsettings list-schemas | grep "plugins"
+ exec gsettings list-schemas
mobi.phosh.plugins.pomodoro
org.gnome.eog.plugins
org.gnome.settings-daemon.plugins
org.gnome.settings-daemon.plugins.color
org.gnome.settings-daemon.plugins.housekeeping
org.gnome.settings-daemon.plugins.media-keys
org.gnome.settings-daemon.plugins.power
org.gnome.settings-daemon.plugins.wwan
org.gnome.settings-daemon.plugins.xsettings
sm.puri.phosh.plugins
sm.puri.phosh.plugins.launcher-box
sm.puri.phosh.plugins.ticket-box
sm.puri.phosh.plugins.upcoming-events

And we are able to launch the plugin-prefs:

image

I'm again not sure if I missed a step while running the tool. And if that's the case, I'm happy to close the merge request 🙈.

CC: @gautham_x as I found it while checking your MR 😛.

Merge request reports

Loading