ch11ng / exwm

Emacs X Window Manager
2.85k stars 135 forks source link

`EXWM` not working with `GNU Emacs 28.0.50` with native compilation? #835

Closed techmoerror220 closed 3 years ago

techmoerror220 commented 3 years ago

Until today, I had EXWM together with GccEmacs. However, since native compilation is available from Emacs's master branch, today I decided to uninstall my GccEmacs and install Emacs from master branch's HEAD (GNU Emacs 28.0.50). Now if I log intoEXWM, I get an empty, blank screen where I can't see either the cursor, or the mode-line or the minibuffer, nothing. I can use the keybindings I know by heart to, for example, launch Firefox or to log out from EWXM altogether. If I log into Ubuntu 20.04's default desktop, which is Gnome I believe, Emacs is fully functional. So I wonder there is something wrong with the rendering of Emacs when I attempt to useEXWM, but what is it, given that those very same settings were perfectly okay withGccEmacs? At its basics, these are:

  (use-package exwm
  :init
  (require 'exwm-config)
  (require 'exwm-randr)
  :config
  (exwm-enable))

I'ved checked that I have xelb and cl-generic alright and installed from ELPA simultaneously with EXWM.... I wonder if it has to do with my 4k, high dpi monitor... But not seeing the cursor? Not being able to type anything? No response to zooming in/out? I'm puzzled

TheCatster commented 3 years ago

Do you happen to have (in some way) pgtk enabled? I had similar issues with pgtk, but afterwards have been fine. I also compiled from head with native comp, and if it makes some difference I am running Arch Linux (with Emacs version 28.0.50)

techmoerror220 commented 3 years ago

Yeah, I was aware that EXWM is incompatible with pgtk... I shouldn't have pgtk as I have not requested it on installation and I see that the window system is x11 and the toolkit is GTK3

techmoerror220 commented 3 years ago

I've checked that, for me on Ubuntu 20.04, EXWM doesn't work when building Emacs with native comp (no pgtk at alll) and deploying either of these two cloning operations (both from Emacs master branch' HEAD):

git clone -b master git://git.sv.gnu.org/emacs.git
git clone git://git.savannah.gnu.org/emacs.git

However, EXWM does work alright when cloning from the GccEmacs's branch:

git clone git://git.savannah.gnu.org/emacs.git -b feature/native-comp
TheCatster commented 3 years ago

There are quite a few commits differentiating the two. Possibly something else was merged into master and messes with EXWM. It seems there have been quite a few variables renamed (but mostly verbosity related) and a few Windows changes, which shouldn't affect you. Native comp was also renamed into native-compile feature, which might be it.

I don't actively follow the commit history of Emacs, but between April 22nd and now, clearly something has changed to affect EXWM (which is a bit obvious to say in retrospect.) Would you mind trying to compile the master branch with --native-compile feature?

techmoerror220 commented 3 years ago

Ok, I'll try in a while. By the way, are

git clone -b master git://git.sv.gnu.org/emacs.git
git clone git://git.savannah.gnu.org/emacs.git

the same?

TheCatster commented 3 years ago

Yes. It seems the sv one redirects to the latter. I just cloned both, they are the same.

techmoerror220 commented 3 years ago

Okay, i'm on my way... i'll clone git://git.sv.gnu.org/emacs.git, which is the one referenced in the official web

techmoerror220 commented 3 years ago

I'm going to do:

$ ./configure --with-dbus --with-gif ---with-jpeg --with-png --with-rsvg --with-tiff --with-xft  --with-xpm --with-gpm=no --with-json --with-mailutils --with-kerberos5 --with-modules --with-imagemagick --with-x  --with-x-toolkit=gtk3 --with-cairo --native-compile
TheCatster commented 3 years ago

Looks good to me. For reference, this is what the PKGBUILD for Arch Linux does:

build() {
  cd "$srcdir/emacs-git"

  local _conf=(
    --prefix=/usr
    --sysconfdir=/etc
    --libexecdir=/usr/lib
    --localstatedir=/var
    --mandir=/usr/share/man
    --with-gameuser=:games
    --with-sound=alsa
    --with-modules
# Beware https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25228
# dconf and gconf break font settings you set in ~/.emacs.
# If you insist you'll need to read that bug report in *full*.
# Good luck!
   --without-gconf
   --without-gsettings
   --with-native-compilation
  )

You wrote just --native-compile (which I accidentally wrote earlier)

techmoerror220 commented 3 years ago

Oh, you meant with-native-compilation! Well, that's what I've done already several times and it doesn't work

TheCatster commented 3 years ago

Yeah, sorry about that. Just for the sake of troubleshooting, can you compile just with the bare minimum + native comp? I believe that is listed as --with-wide-int on the wiki. Maybe some other option is somehow pulling in pgtk, or another thing that EXWM has issues with?

techmoerror220 commented 3 years ago

so you mean ./configure --with-wide-int --with-native-compilation?

TheCatster commented 3 years ago

Yes, and let's see if that works. I find this whole scenario quite peculiar, as I have (I believe) the same modules, same version number, and am replying to you from EXWM. So unless someone else has a better initial idea, I'd think it's one of the features your build is configured with.

techmoerror220 commented 3 years ago

yes, could be though I'm an expert at getting trapped in "peculiar" problems with Emacs... okay, so now my machine is dealing with make NATIVE_FULL_AOT=1 -j$(nproc) so time to grab a cuppa tea!

techmoerror220 commented 3 years ago

I'm getting tons of libgccjit.so: note: disable pass tree-isolate-paths for functions in the range of [0, 4294967295]..... don't recall getting these message repeated constantly in my previous builds... any idea what is it about?

techmoerror220 commented 3 years ago

Process ended with same result: blank screen with my color theme but can't see the cursor, the mode-line, the minibuffer, anything I type... nothing. Only thing I can do is type commands I know by heart to fire up external processes or to exit Emacs and EXWM altogether... so weird

TheCatster commented 3 years ago

Very weird. I honestly have no idea what the disable pass tree is about. For now, I know this is avoiding the issue, but can you find a PPA for native-comp on Ubuntu, or stick with the GCCEmacs branch? Maybe work is being done on master right now that is breaking native-comp and EXWM. I don't regularly compile Emacs on my own, so I don't think I can be of much more assistance.

techmoerror220 commented 3 years ago

Probably the message pops up because the --with-wide-int flag? (oh, yes, see here though I use the 64-bit build so another thing I don't know what's going on)...

Oh, well, yes, I'm back to GccEmacs

djeis97 commented 3 years ago

I can reproduce the issue with the latest master and a config based on doom emacs. It’s weird- seems like emacs is still responsive to some degree. I have ivy-posframe with the trickery to make it a top level window, and when I run find-file the screen does redisplay. However, while ivy is centered on my monitor, my emacs frame is the vanilla starting size instead of full-screen and is positioned in the upper left. If I exit find-file I’m back to blank windows. Exwm does seem to be running though, as my polybar is at the right place at the top of my screen and the emacs frame is shifted down to match. Launching emacs without exwm seems to work just fine as well. I’ll try a few other build configurations and if I’m unsuccessful I guess I’m returning to the native-comp branch too.

techmoerror220 commented 3 years ago

Exactly, Emacs without EXWM works alright but with EXWM it doesn't. Only polybar is in its place.

djeis97 commented 3 years ago

So, first test: rebuilding everything without native comp still produces the same error, so it seems to be a problem on emacs master more generally.

Sbozzolo commented 3 years ago

So, first test: rebuilding everything without native comp still produces the same error, so it seems to be a problem on emacs master more generally.

Since there's a clear broken state (HEAD), and a clearly working one (27.1), you can use git bisect to find the problematic commit.

djeis97 commented 3 years ago

Already in the process now :)

techmoerror220 commented 3 years ago

Wow, and there's no pgtk involved, right? That will surely make EXWM fail but it remains an option that's not by default as far as I know

djeis97 commented 3 years ago

No pgtk.

djeis97 commented 3 years ago

I think I’ve found it- double checking what I think is the last good commit, rebuilding my full config, and then once I’ve got a proper environment up I’ll copy the exact commit hash out of magit. It’s a change to expose event handling on gtk3.

djeis97 commented 3 years ago

https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=483c5e953c12a95382bef4a3b6769a680c32fe86 is first the bad commit I found.

techmoerror220 commented 3 years ago

Awesome, thank you! Could you please tell me how could I clone the last good commit before chaos breaks in for EXWM? I'm not that familiar with Git...

rdiaz02 commented 3 years ago

I think this issue is related to (or even the same as) this: https://bugs.gnu.org/48268 https://bugs.gnu.org/48413

(which I guess will be fixed soon)

As for how to get to the last good commit, I think this ought to do it:

git checkout master ## just in case
git checkout -b before_chaos 203ee33 ## that is the commit right before 483c5e9

And now do the autogen, configure, etc.

techmoerror220 commented 3 years ago

@djeis97 and @rdiaz02, thank you soooooo much! I've reproduced on my system and EXWM works like it used to, i.e., like a charm. You've saved my day and my weekend! :) Thank you!

rdiaz02 commented 3 years ago

I think you probably would want to close this issue, since it is solved by using a former commit (and, in fact, I think the commits during yesterday fixed the problem).

techmoerror220 commented 3 years ago

Yes, sorry, I forgot. So you think HEAD is no longer dangerous for EXWM?

TheCatster commented 3 years ago

I compiled HEAD yesterday (ironically I've decided to try out Guix, so I do need to do that now) and it worked perfectly. Not sure at exactly what time I did that though