eonpatapon / gnome-shell-extension-caffeine

Disable screensaver and auto suspend

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gschemas.compiled is deleted by `make clean` but not recompiled by `make build`

smcv opened this issue · comments

While updating the Debian packaging of this extension, I noticed that commit 1c0cab6 removed compilation of gschemas.compiled, but that file is still required, and make clean still deletes it. The result is that when we build the package with dpkg in the most obvious way (which does a make clean as its first step, to make the build repeatable), we get a zip file with no compiled schemas and the extension fails to load.

@stuarthayhurst, would you mind expanding on what you meant by "required for upload" in that commit's message?

Since GNOME 44, the gschemas.compiled should be generated by the shell, at install time. (https://gjs.guide/extensions/upgrading/gnome-shell-44.html#gsettings-schema)

The port guide says the extensions must include the gsettings source, and must not include the gschemas.compiled file in the bundle, if targeting only GNOME 44+. As we now only support GNOME 45, I dropped the compiled gsettings file, and clean it with make clean, to prevent it from accidentally being included.

Strange that the extension fails to load, how's it being installed? If it's being simply extracted, perhaps the gsettings aren't being compiled by the shell, and something like the gnome-extensions tool could be used instead?

It's being installed system-wide from a .deb package, so perhaps the requirements are different for that scenario.

Hm, in that case the deb will either have to provide the compiled schema, or compile it on the user system as a post-install script.

If you want the deb to provide the compiled schema, I guess either it could be done as a build step for Debian, or we could add another target here, so the Debian build process would be make clean; make schema; make build.

But I feel like other distros / extensions are going to run into this issue, perhaps something upstream could be added, like gnome-extensions compile [UUID], so distros and users have a simple way to compile the schemas for extensions that are extracted into place, rather than gnome-extensions install'd.

Actually, gnome-extensions should compile and include the gsettings anyway, until I think around GNOME 46? Is the extension being built with an older version of gnome-extensions, or is this explicitly disabled somehow?

Ah, I think perhaps I see the problem - the Debian packaging is running make build, but then installing ./caffeine@patapon.info (which was always enough in the past), rather than unpacking the generated zip file into the target directory.

Probably what we really need is to run XDG_DATA_HOME=${DESTDIR}/usr/share gnome-extensions install, or ask upstream for a new gnome-extensions install --system option.

@smcv With https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3042 merged, if you have any packaging concerns still they might need to be raised this cycle, not sure as I haven't been following it too closely, only what needs to be done for developing the extensions.