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

Can't run pgtk channel on wayland #58

Open
gjm opened this issue Jun 8, 2023 · 10 comments
Open

Can't run pgtk channel on wayland #58

gjm opened this issue Jun 8, 2023 · 10 comments

Comments

@gjm
Copy link

gjm commented Jun 8, 2023

I was trying out the pgtk/edge channel but emacs won't start on Wayland. I get this error:

GLib-GIO-ERROR **: 19:59:44.612: Settings schema 'org.gnome.settings-daemon.plugins.xsettings' does not contain a key named 'antialiasing'

On Xorg emacs starts although I get a warning saying pgtk is unsupported under X.

I'm running 23.04.

Don't know if it's useful or not but here is the backtrace:

Backtrace:
/snap/emacs/2047/usr/bin/emacs(+0x164438)[0x565547ab9438]
/snap/emacs/2047/usr/bin/emacs(+0x4e91c)[0x5655479a391c]
/snap/emacs/2047/usr/bin/emacs(+0x4ee65)[0x5655479a3e65]
/snap/emacs/2047/usr/bin/emacs(+0x16245d)[0x565547ab745d]
/snap/emacs/2047/usr/bin/emacs(+0x16254f)[0x565547ab754f]
/snap/emacs/2047/usr/bin/../../lib/x86_64-linux-gnu/libpthread.so.0(+0x14420)[0x7ff2ccce9420]
/snap/core20/current/lib/x86_64-linux-gnu/libglib-2.0.so.0(+0x58295)[0x7ff2ce1e8295]
/snap/core20/current/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_log_default_handler+0xb9)[0x7ff2ce1e9319]
/snap/core20/current/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_logv+0x21c)[0x7ff2ce1e955c]
/snap/core20/current/lib/x86_64-linux-gnu/libglib-2.0.so.0(g_log+0x93)[0x7ff2ce1e9743]
/snap/core20/current/lib/x86_64-linux-gnu/libgio-2.0.so.0(+0xf7ffe)[0x7ff2ce410ffe]
/snap/core20/current/lib/x86_64-linux-gnu/libgio-2.0.so.0(+0xf86b0)[0x7ff2ce4116b0]
/snap/core20/current/lib/x86_64-linux-gnu/libgio-2.0.so.0(g_settings_get_enum+0x71)[0x7ff2ce415961]
/snap/emacs/2047/usr/bin/../lib/x86_64-linux-gnu/libgdk-3.so.0(+0x9efe3)[0x7ff2ce847fe3]
/snap/emacs/2047/usr/bin/../lib/x86_64-linux-gnu/libgdk-3.so.0(+0xa0a90)[0x7ff2ce849a90]
/snap/emacs/2047/usr/bin/../lib/x86_64-linux-gnu/libgdk-3.so.0(+0x99db4)[0x7ff2ce842db4]
/snap/emacs/2047/usr/bin/../lib/x86_64-linux-gnu/libgdk-3.so.0(gdk_display_manager_open_display+0x118)[0x7ff2ce7e4368]
/snap/emacs/2047/usr/bin/../lib/x86_64-linux-gnu/libgtk-3.so.0(gtk_init_check+0x2b)[0x7ff2ceb05d8b]
/snap/emacs/2047/usr/bin/../lib/x86_64-linux-gnu/libgtk-3.so.0(gtk_init+0xd)[0x7ff2ceb05dbd]
/snap/emacs/2047/usr/bin/emacs(+0x2991a3)[0x565547bee1a3]
/snap/emacs/2047/usr/bin/emacs(+0x28a223)[0x565547bdf223]
/snap/emacs/2047/usr/bin/emacs(+0x21d097)[0x565547b72097]
/snap/emacs/2047/usr/bin/emacs(+0x1d3e37)[0x565547b28e37]
/snap/emacs/2047/usr/bin/emacs(+0x1d4379)[0x565547b29379]
/snap/emacs/2047/usr/bin/emacs(+0x21d097)[0x565547b72097]
/snap/emacs/2047/usr/bin/emacs(+0x1d3e37)[0x565547b28e37]
/snap/emacs/2047/usr/bin/../lib/emacs/30.0.50/native-lisp/30.0.50-e5ae348f/preloaded/startup-bbc6ea72-5ba0dc5b.eln(F636f6d6d616e642d6c696e65_command_line_0+0x12bb)[0x7ff2c5e407cb]
/snap/emacs/2047/usr/bin/emacs(+0x1d3e37)[0x565547b28e37]
/snap/emacs/2047/usr/bin/../lib/emacs/30.0.50/native-lisp/30.0.50-e5ae348f/preloaded/startup-bbc6ea72-5ba0dc5b.eln(F6e6f726d616c2d746f702d6c6576656c_normal_top_level_0+0xd80)[0x7ff2c5e3cc80]
/snap/emacs/2047/usr/bin/emacs(+0x1d8079)[0x565547b2d079]
/snap/emacs/2047/usr/bin/emacs(+0x1da684)[0x565547b2f684]
/snap/emacs/2047/usr/bin/emacs(+0x1d2457)[0x565547b27457]
/snap/emacs/2047/usr/bin/emacs(+0x1420ca)[0x565547a970ca]
/snap/emacs/2047/usr/bin/emacs(+0x1d2399)[0x565547b27399]
/snap/emacs/2047/usr/bin/emacs(+0x1415c0)[0x565547a965c0]
/snap/emacs/2047/usr/bin/emacs(+0x148c68)[0x565547a9dc68]
/snap/emacs/2047/usr/bin/emacs(+0x149010)[0x565547a9e010]
/snap/emacs/2047/usr/bin/emacs(+0x581ac)[0x5655479ad1ac]
/snap/emacs/2047/usr/bin/../../lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7ff2cad22083]
/snap/emacs/2047/usr/bin/emacs(+0x586fe)[0x5655479ad6fe]
@alexmurray
Copy link
Owner

Thanks for reporting this issue - unfortunately this is likely due to an incompatibility between the various libraries shipped in the emacs snap compared to the ones used on your host system - basically, emacs uses a version of libgdk that expects to be able to lookup a particular gsettings value, but your host system has a newer gsettings schema for this that does not include this key - which results in this error.

I am not sure there is a lot that can be done in the emacs snap itself to avoid this since we need to use libgdk from the snap to ensure the libraries are all self-consistent and compatible within the snap.

This is also not specific to the emacs snap - see say Ultimaker/Cura#12776 which is for an application packaged as an appimage which has the same issue.

@gjm
Copy link
Author

gjm commented Aug 4, 2023

I see. Wasn't the snap tested on 23.04? I'm guessing this affects everyone running the latest version right?

@alexmurray
Copy link
Owner

Yes I tested it on 23.04 but released it anyway due to popular demand. But this is why there is no stable release, it's only published to the edge channel which is not expected to be stable.

@gjm
Copy link
Author

gjm commented Aug 4, 2023

Yes of course I understand the unstable nature of the edge channel. Just find it strange it works on your system since we both have the same release. Should have encountered the same issue I have since the host libraries should be the same, right?

@alexmurray
Copy link
Owner

Apologies I wasn't clear above - I meant I tested it on 23.04 and found the same issue but released it anyway due to popular demand.

@gjm
Copy link
Author

gjm commented Aug 4, 2023

Oh OK. Now it makes sense 😄.

Guess I'll have to wait until the quirks are ironed out...

Keep up the great work.

@victoronascimento
Copy link

This issue is still ongoing (Nov/23).

@alexmurray since Ubuntu defaulted to Wayland since 21.04 and since we already have more than a year since the last LTS which is also wayland by default, shouldn't this default to the pgtk version and the x11 version be a different channel?

IMHO this will make the out-of-the-box experience using the snap better for most people. The difference in rendering is quite apparent (for example, the height of doom-modeline is dramatically different). The pgtk will also work in an x11 session though that is not recommended and a warning message (from Emacs itself) shows up.

In any case, thanks for this package :)

@alexmurray
Copy link
Owner

@victoronascimento I am a bit confused by your comment - this issue is about how the pgtk channel doesn't work as expected when run under Wayland on Ubuntu 23.04 etc - but from your comment you seem to indicate that pgtk should be the default channel and hence I assume that it is working for you. Can you please provide more details / clarification? Thanks.

@victoronascimento
Copy link

Sorry @alexmurray for not being precise!

pgtk is NOT running in my setup (Ubuntu 22.04 LTS). I am not acquainted with the whole snap setup, but I thought that if there are conflicting library versions, we should favor the one that makes pgtk work instead of keeping the x11 package working. This is mainly because of defaults of desktops being switched on to Wayland.

Maybe the update of the library is not possible and then my comment makes no sense at all! Sorry for the noise if that is the case...

alexmurray added a commit that referenced this issue Nov 24, 2023
Add gnome-settings-daemon-common which includes the antialiasing key
from the org.gnome.settings-daemon.plugins.xsettings schema and compile
this during the build and finally ensure we add this path to XDG_DATA_DIRS
so it can be found at runtime to fix crash when running pgtk on newer
Ubuntu releases under Wayland.

Signed-off-by: Alex Murray <murray.alex@gmail.com>
@alexmurray
Copy link
Owner

Hopefully this should be fixed with bb8ec99 - if someone else could please test this once new builds are available on the pgtk/edge channel soon that would be great.

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