2

I'm working on a python library / app that uses Gtk.

Part of my build process uses glib-compile-schemas to create gschemas.compiled.

If I include gschemas.compiled in my library, will this break things, if somebody tries to use my library on something like ARM or 32 bit intel ?

(I would compile this as a post-install thing, but that seems to unsupported in setuptools which I am using).

Stuart Axon
  • 1,844
  • 1
  • 26
  • 44

2 Answers2

4

You should not ship a compiled gschemas.compiled cache as part of your app — instead, you should just ship your *.gschema.xml file. gschemas.compiled is intended as a system-wide cache of all the *.gschema.xml files in (by default) /usr/share/glib-2.0/schemas, and should be regenerated by the package manager after an app installs a new schema.

Debian has a lintian check to prevent packages shipping gschemas.compiled, for example.

There seem to be answers here on askubuntu about how to call glib-compile-schemas in a post-install step using setuptools.

To answer your specific question: yes, you should treat it as potentially architecture-specific.

Philip Withnall
  • 5,293
  • 14
  • 28
  • OK, it's a bit annoying - I want to ship my app as a python WHL, but they are phasing out the option of running any user scripts post-install. My app is a gedit/xed/pluma plugin - one option I'm considering is compiling this on first run. – Stuart Axon May 29 '19 at 00:52
  • If you do that, your plugin will only be installable in the user’s home directory. In order to run `glib-compile-schemas` system wide, you need to be root. – Philip Withnall May 29 '19 at 10:15
0

This isn't a definitive answer, but I verified the file is the same for two different architectures build for a package and they are the same.

(The debian i386 and arm64 packages for enchant).

These were chosen because of the different bit width (32 vs 64), and differing architectures.

If somebody writes a more definitive answer, I'll still accept that.

Stuart Axon
  • 1,844
  • 1
  • 26
  • 44