Bug 1214008

Summary: emacs: after upgrade to 29.1 can't start
Product: [openSUSE] openSUSE Tumbleweed Reporter: David Gao <david.alpha.fox>
Component: OtherAssignee: Dr. Werner Fink <werner>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: bjoernv, gabriel.bertazi, ioannis.bonatakis, jas.61803, kukuk, mail, manhtranlinh, marararam, psychonaut, pujos.michael, uncomfy+openbuildservice, werner
Version: Current   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE Tumbleweed   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description David Gao 2023-08-05 03:42:29 UTC
After the rolling upgrade.
The emacs is upgraded to 29.1 and it can't be started.
And when I run it in the terminal 
The result is


Loading loadup.el (source)...
Dump mode: nil
Using load-path (/usr/share/emacs/29.1/site-lisp /usr/share/emacs/site-lisp /usr/share/emacs/29.1/lisp /usr/share/emacs/29.1/lisp/emacs-lisp /usr/share/emacs/29.1/lisp/progmodes /usr/share/emacs/29.1/lisp/language /usr/share/emacs/29.1/lisp/international /usr/share/emacs/29.1/lisp/textmodes /usr/share/emacs/29.1/lisp/vc)
Loading emacs-lisp/debug-early...
Symbol's function definition is void: file-name-sans-extension

and it refuse to start.
Comment 1 Michael Pujos 2023-08-05 11:45:29 UTC
Same here. That build of emacs is broken.
Comment 2 David Gao 2023-08-05 13:27:12 UTC
After checking /usr/bin/emacs
I find that the shell using exec -a $arg0 ${1+$@} "${argv[@]" to start the emacs.

And arg0 is /usr/bin/emacs and ${1+$@} will be /usr/bin/emacs-gtk. I'm not sure the 28 is the same contents.

At the same time, we can't find emacs.pdmp under /usr/libexec/emacs/29.1/x86_64-suse-linux/, so it can't start correctly.
Comment 3 Michael Pujos 2023-08-05 13:32:54 UTC
In any case, starting the binary directly (emacs-gtk, emacs-x11, emacs-nox) works, so the /usr/bin/emacs shell script must be the cause of the problem.
Comment 4 Gabriel Krisman Bertazi 2023-08-05 21:11:49 UTC
Same here after update to 29.1-1.1 and running "emacs -Q".  Adding Werner.
Comment 5 Soc Virnyl Estela 2023-08-05 23:16:00 UTC
```
Loading loadup.el (source)...
Dump mode: nil
Using load-path (/usr/share/emacs/29.1/site-lisp /usr/share/emacs/site-lisp /usr/share/emacs/29.1/lisp /usr/share/emacs/29.1/lisp/emacs-lisp /usr/share/emacs/29.1/lisp/progmodes /usr/share/emacs/29.1/lisp/language /usr/share/emacs/29.1/lisp/international /usr/share/emacs/29.1/lisp/textmodes /usr/share/emacs/29.1/lisp/vc)
Loading emacs-lisp/debug-early...
Symbol's function definition is void: file-name-sans-extension
```

I received the same thing as well. Running emacs-x11, emacs-gtk, and emacs-nox works. It's probably the emacs shells script doing wrong.
Comment 6 Linh Tran 2023-08-06 02:05:20 UTC
emacs
Loading loadup.el (source)...
Dump mode: nil
Using load-path (/usr/share/emacs/29.1/site-lisp /usr/share/emacs/site-lisp /usr/share/emacs/29.1/lisp /usr/share/emacs/29.1/lisp/emacs-lisp /usr/share/emacs/29.1/lisp/progmodes /usr/share/emacs/29.1/lisp/language /usr/share/emacs/29.1/lisp/international /usr/share/emacs/29.1/lisp/textmodes /usr/share/emacs/29.1/lisp/vc)
Loading emacs-lisp/debug-early...
Symbol's function definition is void: file-name-sans-extension
----------------------------------
Follow Soc Virnyl Estela suggestion can run emacs-x11, emacs-gtk, emacs-nox to start emacs. Thanks
Comment 7 Soc Virnyl Estela 2023-08-07 06:15:18 UTC
(In reply to Linh Tran from comment #6)
> emacs
> Loading loadup.el (source)...
> Dump mode: nil
> Using load-path (/usr/share/emacs/29.1/site-lisp /usr/share/emacs/site-lisp
> /usr/share/emacs/29.1/lisp /usr/share/emacs/29.1/lisp/emacs-lisp
> /usr/share/emacs/29.1/lisp/progmodes /usr/share/emacs/29.1/lisp/language
> /usr/share/emacs/29.1/lisp/international
> /usr/share/emacs/29.1/lisp/textmodes /usr/share/emacs/29.1/lisp/vc)
> Loading emacs-lisp/debug-early...
> Symbol's function definition is void: file-name-sans-extension
> ----------------------------------
> Follow Soc Virnyl Estela suggestion can run emacs-x11, emacs-gtk, emacs-nox
> to start emacs. Thanks

Yes but I use emacs daemon more so I hope this will be fixed. For now, I am using distrobox on archlinux for emacs-wayland
Comment 8 Dr. Werner Fink 2023-08-07 08:21:21 UTC
SR#1102651
Comment 9 OBSbugzilla Bot 2023-08-07 08:55:02 UTC
This is an autogenerated message for OBS integration:
This bug (1214008) was mentioned in
https://build.opensuse.org/request/show/1102651 Factory / emacs
Comment 10 Björn Voigt 2023-08-08 10:01:29 UTC
(In reply to OBSbugzilla Bot from comment #9)
> This is an autogenerated message for OBS integration:
> This bug (1214008) was mentioned in
> https://build.opensuse.org/request/show/1102651 Factory / emacs

I installed emacs from repository editors / emacs and still get this error:

> emacs
Loading loadup.el (source)...
Dump mode: nil
Using load-path (/usr/share/emacs/29.1/site-lisp /usr/share/emacs/site-lisp /usr/share/emacs/29.1/lisp /usr/share/emacs/29.1/lisp/emacs-lisp /usr/share/emacs/29.1/lisp/progmodes /usr/share/emacs/29.1/lisp/language /usr/share/emacs/29.1/lisp/international /usr/share/emacs/29.1/lisp/textmodes /usr/share/emacs/29.1/lisp/vc)
Loading emacs-lisp/debug-early...
Symbol's function definition is void: file-name-sans-extension
Comment 12 Björn Voigt 2023-08-09 22:03:12 UTC
(In reply to Dr. Werner Fink from comment #11)
> Does those packages really fail if installed all six
> 
> https://download.opensuse.org/repositories/editors/openSUSE_Tumbleweed/
> x86_64/emacs-29.1-421.3.x86_64.rpm
> https://download.opensuse.org/repositories/editors/openSUSE_Tumbleweed/
> x86_64/emacs-eln-29.1-421.3.x86_64.rpm
> https://download.opensuse.org/repositories/editors/openSUSE_Tumbleweed/
> x86_64/emacs-x11-29.1-421.3.x86_64.rpm
> https://download.opensuse.org/repositories/editors/openSUSE_Tumbleweed/
> x86_64/emacs-nox-29.1-421.3.x86_64.rpm
> https://download.opensuse.org/repositories/editors/openSUSE_Tumbleweed/
> noarch/emacs-el-29.1-421.3.noarch.rpm
> https://download.opensuse.org/repositories/editors/openSUSE_Tumbleweed/
> noarch/emacs-info-29.1-421.3.noarch.rpm
> 
> Here it works as now e.g. emacs-gtk finds its emacs-gtk.pdmp even if called
> as emacs from the /usr/bin/emacs wrapper script.

From this list, only the links for emacs-el-29.1-421.3.noarch.rpm and emacs-info-29.1-421.3.noarch.rpm are valid. The version numbers for the other packages differ slightly. 

I did my own build with 

osc checkout editors emacs
cd editors/emacs
osc build openSUSE_Tumbleweed --clean emacs.spec

But yes, there was a RPM installation error, sorry. Now I installed correctly.

The error is fixed. With the new Emacs packages there is a warning in the Emacs *Warnings* screen. This can be unrelated to this bug.

⛔ Warning (comp): ispell.el.gz:1457:24: Warning: Unused lexical variable `load-dict'
⛔ Warning (comp): ispell.el.gz:1479:26: Warning: Unused lexical variable `load-dict'
Comment 13 Dr. Werner Fink 2023-08-10 07:00:31 UTC
(In reply to Björn Voigt from comment #12)

> 
> From this list, only the links for emacs-el-29.1-421.3.noarch.rpm and
> emacs-info-29.1-421.3.noarch.rpm are valid. The version numbers for the
> other packages differ slightly. 

Every rebuild will change the release numbers indeed

> 
> I did my own build with 
> 
> osc checkout editors emacs
> cd editors/emacs
> osc build openSUSE_Tumbleweed --clean emacs.spec
> 
> But yes, there was a RPM installation error, sorry. Now I installed
> correctly.
> 
> The error is fixed. With the new Emacs packages there is a warning in the
> Emacs *Warnings* screen. This can be unrelated to this bug.
> 
> ⛔ Warning (comp): ispell.el.gz:1457:24: Warning: Unused lexical variable
> `load-dict'
> ⛔ Warning (comp): ispell.el.gz:1479:26: Warning: Unused lexical variable
> `load-dict'

That are warning for the eln support aka native compilation of el(.gz) files ... some of them you find below /usr/lib/emacs/29.1/native-lisp/ ... as those eln
files are created on the fly as well as cached if not exist ... e.g. below ~/.emacs.d/eln-cache/  those warning will not happen twice with the same GNU Emacs version.

Btw: GNU Emacs 29.1 has a function (native-compile-prune-cache) which removes old cache data but not of the current version