alexmurray / emacs-snap

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

Compiler errors on Ubuntu 20.04 #38

Closed hansbogert closed 2 years ago

hansbogert commented 2 years ago

This seems to be related to #35 but I'm not well-versed enough in either snap or emacs to understand where this is going wrong:

Error (use-package): volatile-highlights/:init: Native compiler error: (lambda (arg10 arg11 &optional) (let ((f #'delete-region)) (funcall f arg10 arg11))), "Compiling /home/hvdb/.emacs.d/eln-cache/28.1-6071d483/subr--trampoline-64656c6574652d726567696f6e_delete_region_0.eln...
/usr/bin/ld: cannot find libgcc_s.so.1
collect2: error: ld returned 1 exit status
libgccjit.so: error: error invoking gcc driver
Debugger entered--Lisp error: (native-ice \"failed to compile\" \"/home/hvdb/.emacs.d/eln-cache/28.1-6071d483/subr--...\" \"error invoking gcc driver\")
  comp--compile-ctxt-to-file(\"/home/hvdb/.emacs.d/eln-cache/28.1-6071d483/subr--...\")
  comp-compile-ctxt-to-file(\"/home/hvdb/.emacs.d/eln-cache/28.1-6071d483/subr--...\")
  comp-final1()
  load-with-code-conversion(\"/tmp/emacs-int-comp-subr--trampoline-64656c6574652...\" \"/tmp/emacs-int-comp-subr--trampoline-64656c6574652...\" nil t)
  command-line-1((\"-l\" \"/tmp/emacs-int-comp-subr--trampoline-64656c6574652...\"))
  command-line()
  normal-top-level()

" Disable showing Disable logging
Warning (comp): collect2: error: ld returned 1 exit status Disable showing Disable logging
Warning (comp): libgccjit.so: error: error invoking gcc driver Disable showing Disable logging
Warning (comp): /snap/emacs/current/usr/share/emacs/28.1/lisp/emacs-lisp/comp.el.gz: Error: Internal native compiler error failed to compile Disable showing Disable logging
Warning (comp): column-enforce-mode.el:63:1: Warning: custom-declare-variable `column-enforce-column' docstring wider than 80 characters Disable showing Disable logging
Warning (comp): volatile-highlights.el:200:13: Warning: Package cl is deprecated Disable showing Disable logging
Warning (comp): column-enforce-mode.el:97:8: Warning: docstring wider than 80 characters Disable showing Disable logging
Warning (comp): column-enforce-mode.el:136:11: Warning: assignment to free variable ‘column-enforce-mode-line-string’ Disable showing Disable logging
Warning (comp): column-enforce-mode.el:220:8: Warning: docstring wider than 80 characters Disable showing Disable logging
Warning (comp): volatile-highlights.el:411:10: Warning: ‘pushnew’ is an obsolete alias (as of 27.1); use ‘cl-pushnew’ instead. Disable showing Disable logging
Warning (comp): volatile-highlights.el:526:31: Warning: ‘assert’ is an obsolete alias (as of 27.1); use ‘cl-assert’ instead. Disable showing Disable logging
Warning (comp): volatile-highlights.el:541:21: Warning: ‘assert’ is an obsolete alias (as of 27.1); use ‘cl-assert’ instead. Disable showing Disable logging
Warning (comp): volatile-highlights.el:552:34: Warning: ‘assert’ is an obsolete alias (as of 27.1); use ‘cl-assert’ instead. Disable showing Disable logging
Warning (comp): volatile-highlights.el:558:70: Warning: ‘assert’ is an obsolete alias (as of 27.1); use ‘cl-assert’ instead. Disable showing Disable logging
Warning (comp): volatile-highlights.el:561:44: Warning: ‘assert’ is an obsolete alias (as of 27.1); use ‘cl-assert’ instead. Disable showing Disable logging
Warning (comp): collect2: error: ld returned 1 exit status Disable showing Disable logging
Warning (comp): libgccjit.so: error: error invoking gcc driver Disable showing Disable logging
Warning (comp): /snap/emacs/current/usr/share/emacs/28.1/lisp/calendar/cal-menu.el.gz: Error: Internal native compiler error failed to compile Disable showing Disable logging
alexmurray commented 2 years ago

Thanks for reporting this issue - can you post the output of snap info emacs? Also within emacs:

M-x describe-variable native-comp-driver-options (or similarly C-h v native-comp-driver-options).

I can't reproduce this myself locally on an up-to-date Ubuntu 20.04 install so any other details you can provide would be great.

hansbogert commented 2 years ago

M-x describe-variable native-comp-driver-options (or similarly C-h v native-comp-driver-options).


native-comp-driver-options is a variable defined in ‘comp.el’.

Its value is ("--sysroot=/snap/emacs/966/" "-B/snap/emacs/966/usr/lib/gcc/")

Options passed verbatim to the native compiler’s back-end driver. Note that not all options are meaningful; typically only the options affecting the assembler and linker are likely to be useful.

Passing these options is only available in libgccjit version 9 and above.

This variable was introduced, or its default value was changed, in version 28.1 of Emacs. You can customize this variable.


If this helps, it's a spacemacs instance.
alexmurray commented 2 years ago

Thanks - so that all looks normal - I wonder if this is specific to spacemacs... can you try and come up with a minimal recipe to reproduce the issue?

hansbogert commented 2 years ago

Can't reproduce anymore after removing ~/.spacemacs.env it held a couple of outdated environment variables. I never knew spacemacs created that on first start.

Hope this helps others.

alexmurray commented 2 years ago

Thanks, glad you were able to resolve it.