alexmurray / emacs-snap

GNU Emacs in a snap
https://snapcraft.io/emacs
71 stars 13 forks source link

Linker error on vanilla Emacs 28.1 (Ubuntu 21.10) #35

Closed FilConscious closed 2 years ago

FilConscious commented 2 years ago

After updating Emacs to version 28.1 in Ubuntu 21.10, I get the same error as in https://github.com/alexmurray/emacs-snap/issues/22. However, in my case, that happens with a vanilla Emacs installation (no doom-emacs).

--- Emacs outputs ---

Warning (comp): libgccjit.so: error: error invoking gcc driver Disable showing Disable logging Warning (comp): /snap/emacs/current/usr/share/emacs/28.1/lisp/url/url-vars.el.gz: Error: Internal native compiler error failed to compile Disable showing Disable logging

Compiling /snap/emacs/current/usr/share/emacs/28.1/lisp/url/url-vars.el.gz... uncompressing url-vars.el.gz... uncompressing url-vars.el.gz...done ld: cannot find crtbeginS.o: No such file or directory ld: cannot find -lgcc ld: cannot find -lgcc_s libgccjit.so: error: error invoking gcc driver /snap/emacs/current/usr/share/emacs/28.1/lisp/url/url-vars.el.gz: Error: Internal native compiler error failed to compile Compilation finished.

--- End of Emacs outputs ---

A couple of additional notes:

ddovod commented 2 years ago

Hello. I'm facing the same issue, ubuntu 20.04. Btw is there a way to temporarily rollback the version to the previous one?

alexmurray commented 2 years ago

Thanks for reporting this issue, clearly supporting native-comp across multiple distros as a classic snap is more difficult than I expected. I'll roll the snap back to 27.2 for the stable channel until I can get this sorted out.

ldav1s commented 2 years ago

Back in business with the 27.2 snap. Thanks for the quick response!

FilConscious commented 2 years ago

Thanks indeed for the quick/temporary fix!

@ddovod, to roll back you can now simply execute snap refresh emacs into the terminal and everything should be working as before.

alexmurray commented 2 years ago

So I just tried reproducing this in a fresh Ubuntu 21.10 VM and it all appears to work fine - I installed emacs from the beta channel to get 28.1 and then ran it and there are no errors - then I did M-x package-refresh-contents and then M-x package-install ace-window and I don't see any errors in the *Async-native-compile-log* buffer (see async-native-compile-log.txt).

How are you invoking emacs?

alexmurray commented 2 years ago

Since I am unable to reproduce this (I tried on both Ubuntu 21.10 and 20.04 - on fresh VMs) I am tempted to set 28.1 back to stable - so any help you could give in trying to help me reproduce this would be great @FilConscious @ddovod @ldav1s

mousetrappling commented 2 years ago

I had exactly the same error as the original report, tho I didn't know to check the async-native-compile-log. Ubuntu 20.04. I run emacs using the icon shortcut on my Gnome Applications Menu (I think that's the official name for the bar down the side). Is it possible the problem happens on systems that have upgraded emacs rather than a fresh install?

(Don't think I can be much help tracking this down I'm afraid, I've used linux a long time but I'm not really a power user (and I'm a relatively new emacs user).)

alexmurray commented 2 years ago

Ah thanks - ok so I can reproduce this by first:

  1. Install emacs from the stable channel
  2. Install a package (say ace-window) via M-x package-install then selecting ace-window
  3. Shutdown emacs
  4. Refresh emacs from the beta channel to install emacs 28.1
  5. Restart emacs
  6. Notice the error occurs and then looking in *Async-native-compile-log*:
    Compiling /snap/emacs/current/usr/share/emacs/28.1/lisp/url/url-vars.el.gz...
    uncompressing url-vars.el.gz...
    uncompressing url-vars.el.gz...done
    ld: cannot find crti.o: No such file or directory
    ld: cannot find crtbeginS.o: No such file or directory
    ld: cannot find -lgcc
    ld: cannot find -lgcc_s
    ld: cannot find -lc
    ld: cannot find -lgcc
    ld: cannot find -lgcc_s
    ld: cannot find crtendS.o: No such file or directory
    ld: cannot find crtn.o: No such file or directory
    libgccjit.so: error: error invoking gcc driver
    /snap/emacs/current/usr/share/emacs/28.1/lisp/url/url-vars.el.gz: Error: Intern\
    al native compiler error failed to compile
    Compilation finished.

Will see what I can do.

root42 commented 2 years ago

The gccjit problem can be fixed by installing libgccjit-9 with apt. That's how I got Emacs 28 working at least.

alexmurray commented 2 years ago

No you shouldn't need to install anything to get it working - the emacs snap should ship everything it requires and make sure it configures itself to use those pieces and not have to rely on users installing other packages - I have a potential fix in progress, will let you know when it is available.

root42 commented 2 years ago

Well, it's simply what I needed to do to get yesterday's version working. :)

alexmurray commented 2 years ago

With any luck should be fixed by 6308794 - this should be in the beta channel in the next few hours.

alexmurray commented 2 years ago

Nope turns out that is not sufficient... am trying another approach.

alexmurray commented 2 years ago

Ok from my own testing this looks to be fixed now and snaps with the fix are available in the beta channel.

Can someone else please try using the snap from the beta channel and see if it works for them?

snap refresh emacs --beta

Thanks.

root42 commented 2 years ago

I tried it, having removed the libgccjit libs beforehand, which I installed manually. Seems to work fine! Ubuntu 20.04.4 LTS.

alexmurray commented 2 years ago

Thanks, I've just promoted it to stable.

ldav1s commented 2 years ago

Can confirm that the new stable 28.1 doesn't give the libgccjit.so error that I encountered yesterday. Thanks, again!