stumpwm quits immediately after login because binary is stripped
Description:
When the latest version of stumpwm
(23.11-1
) is used as a window manager, the program immediately quits after log in. Some users on the forum also seem to have run into this issue.
The reason for this is because the stumpwm
binary ($pkgdir/usr/bin/stumpwm
) gets stripped during the packaging process. stumpwm
is written in Common Lisp and is built with Steel Bank Common Lisp (SBCL), which, according to my understanding (though I am not a Lisp programmer), creates executables by simply appending a core image to the interpreter binary (/usr/bin/sbcl
). (stumpwm
is built with (save-lisp-and-die … :executable t …)
). When stripping the stumpwm
binary, the core image is removed and all that remains is the SBCL interpreter (i.e., the resulting binary is bit-for-bit identical to the /usr/bin/sbcl
with which stumpwm
was built). The size difference is also immediately apparent: a non-stripped stumpwm
is 58MB in size, the SBCL interpreter is only 468KB.
Building stumpwm
with an older version of pacman
(e.g., 6.0.2-9
) does not have this problem and successfuly creates a non-stripped binary, even for stumpwm 23.11
. The problematic change (which I suspect is commit fcb1d4f8
) was introduced with the release of pacman
6.1.0-1
. I verified this by building both stumpwm
22.11-8
and 23.11-1
with each of pacman
6.0.2-9
and 6.1.0-1
. Each time building with pacman
6.0.2-9
results in a non-stripped binary, and building with pacman
6.1.0-1
results in a stripped binary. The problem persists with pacman
6.1.0-3
. To be more specific: this is purely a packaging issue, since the binary is actually built correctly, as can be verified by inspecting $srcdir/stumpwm/stumpwm
, which has the correct size of 58MB.
pacman
will eventually call debugedit … $pkgdir/usr/bin/stumpwm …
during the packaging process, which strips the stumpwm
binary. I do not know why debugedit
does this, as I am unfamiliar with this tool. The reason why pacman
takes this code path is because, by default, the debug
flag is activated in /etc/makepkg.cfg
and the strip
flag is deactivated in stumpwm
's PKGBUILD
.
An at least temporary workaround is to deactivate the debug
flag in PKGBUILD
, although I cannot say if this is the correct way to go about, as I am not familiar with the internals of pacman
. I have applied this fix locally on my machine and have been sucessfuly building and runnning stumpwm
23.11
without any problems the last few days.
diff --git a/PKGBUILD b/PKGBUILD
index eac21e9..7a877ba 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -32,7 +32,7 @@ optdepends=(
'emacs: edit and eval stumpwm code with M-x stumpwm-mode'
'stumpwm-contrib: extension modules for StumpWM'
)
-options=('!strip' '!makeflags')
+options=('!strip' '!makeflags' '!debug')
_commit='b3a0e2d067da839453ca3a4581e7d5957677cac3'
source=(
"$pkgname::git+https://github.com/stumpwm/stumpwm#commit=$_commit"
Additional info:
- package version(s):
stumpwm
23.11-1
, - config and/or log files: no config necessary
- link to upstream bug report, if any: none, this is a packaging issue
Steps to reproduce:
- Configure
stumpwm
as your window manager (e.g., in~/.xsession
) - Log in via your login manager
-
stumpwm
immediately quits