Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GSettings schema for org.gtimelog is missing #172

Open
nick87720z opened this issue Feb 12, 2020 · 5 comments
Open

GSettings schema for org.gtimelog is missing #172

nick87720z opened this issue Feb 12, 2020 · 5 comments

Comments

@nick87720z
Copy link

nick87720z commented Feb 12, 2020

I under gentoo, packaged in personal overlay. Versions before 0.11 were ok. But since 0.11 (including current git head) it makes this:
WARNING: GSettings schema for org.gtimelog is missing! If you're running from a source checkout, be sure to run 'make'.

I also tried right in source tree, still with same error:

python3 ./setup.py build
make
./gtimelog
@nick87720z nick87720z changed the title gsettings missing GSettings schema for org.gtimelog is missing Feb 12, 2020
@nick87720z nick87720z reopened this Feb 12, 2020
@mgedmin
Copy link
Member

mgedmin commented Feb 12, 2020

The current git master should work right after a clone, with no build steps required, if you have all the necessary dependencies. ./gtimelog is supposed to build the schema automatically. (make is still an option if you want to build stuff in advance, and not at runtime.)

Does ./gtimelog print anything, like Compiling GSettings schema and Failed: (reason why)?

Do you have GSETTINGS_SCHEMA_DIR set in your environment? That's one way to suppress the automatic build (but then make should build it, or at least fail).

Does make print anything? What if you try from a clean checkout, with git clean -dfx && make?

Do you have a glib-compile-schemas in your $PATH?

Let's figure this out.

@nick87720z
Copy link
Author

nick87720z commented Feb 12, 2020

When doing make (I tried make clean instead of git command), I get only this:

$ make
rst2man.py gtimelog.rst > gtimelog.1
msgfmt -o src/gtimelog/locale/lt/LC_MESSAGES/gtimelog.mo src/gtimelog/po/lt.po
msgfmt -o src/gtimelog/locale/en/LC_MESSAGES/gtimelog.mo src/gtimelog/po/en.po

glib-compile-schemas presents.
GSETTINGS_SCHEMA_DIR... mm, by some reason it points to ~/data (still have to inspect about it).

Finally, I could run it with this variable set to nothing:
(despite traceback, gui appears and app doesn't crash)

$ GSETTINGS_SCHEMA_DIR= ./gtimelog
Traceback (most recent call last):
  File "/home/nick87720z/dist/gtimelog/src/gtimelog/main.py", line 997, in gained_focus
    self.check_reload()
  File "/home/nick87720z/dist/gtimelog/src/gtimelog/main.py", line 1345, in check_reload
    if self.timelog.check_reload():
AttributeError: 'NoneType' object has no attribute 'check_reload'

Still nothing changes, because repeating $ ./gtimelog gives above error.
And there are no other lines besides mentioned gsettings warning.

Edit: One more note, when running in-source, it is live git version. But when I try from ebuild, it is 0.11 release.

Edit2: Runs without errors/tracebacks with GSETTINGS_SCHEMA_DIR='' if I try it from system install, installed just by setup.py. Original ebuild did following after setup.py install:

    # Don't install icons in /usr/lib/python*
    find "${ED}/$(python_get_sitedir)" -regex '.*\(png\|ui\)$' -exec rm -f {} + || die

That's from previous versions, but they where ok. Not related though, I simply faced this problem after trying GSETTINGS_SCHEMA_DIR trick for system install.

@nick87720z
Copy link
Author

nick87720z commented Feb 12, 2020

On my system all (most) schemas are at /usr/share/glib-2.0/schemas.
While for gtimelog all resources (including ui and png) are in python package.

Edit: It finally began to work from desktop command launcher (xfrun4 or xfce4-appfinder) after installing schema into mentioned path. For terminal I still had to start new terminal instance (just used st aka simpleterm) for same effect (it had original problem when started from already working xfce4-terminal).

About schema compilation, such option is known to present in original cmake-based (now meson) projects from/for elementary-os, such nas NaSC, go-for-it, etc.

@mgedmin
Copy link
Member

mgedmin commented Feb 13, 2020

The idea is that a distro packager will build a package that installs the schema into /usr/share/blahblah, but I also tried to make things work out of the box for people running from source. Making things work requires two things:

  • magical schema compilations (originally I wasn't sure the precompiled binary schema is sufficiently architecture independent that I could just git commit it, but I eventually learned it was actually arch-independent and I did git commit it! this is why make didn't build it!)
  • setting GSETTINGS_SCHEMA_DIR so it can be found

Why do you have GSETTINGS_SCHEMA_DIR set in your environment? Is this a distribution default, or something you've customized for your own reasons?

I've opted not to override this variable if it's already set in fear of breaking something else (like GTK itself), since I don't think it supports multiple directories separated by a colon? But maybe it does? Augh software is hard.

(This is why I want to get the Flatpak done, which is also hard. But hopefully it would be hard once.)

@mathause
Copy link

I wanted to install gtimelog into a conda environment which has glib installed. glib (as installed by conda) sets the GSETTINGS_SCHEMA_DIR here:

https://github.com/conda-forge/glib-feedstock/blob/f72ebb3763fc52b928a2d15bb26a6db8a4d7b166/recipe/scripts/activate.sh#L2

So what I did is copy the gtimelog schema over and compile them:

conda activate environment
cp $CONDA_PREFIX/lib/python3.9/site-packages/gtimelog/data/org.gtimelog.gschema.xml $CONDA_PREFIX/share/glib-2.0/schemas/
glib-compile-schemas $CONDA_PREFIX/share/glib-2.0/schemas/

(What I don't entirely understand - on my personal computer it works just fine and GSETTINGS_SCHEMA_DIR is not set while for my work computer I need this hack...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants