This question is the distilled solution of what others have helped me solved. The discussion can be found on this issue and this r/xmonad post.
I'm using Artix mainly with Pacman as a package manager. Today, after about a week, I've upgraded many packages and it ended up breaking XMonad.
This is the message I get from xmonad --recompile -v
:
XMonad is recompiling and replacing itself another XMonad process because the current process is called "xmonad" but the compiled configuration should be called "xmonad-x86_64-linux"
XMonad will use ghc to recompile, because "/home/philippe/.xmonad/build" does not exist.
XMonad skipping recompile because it is not forced (e.g. via --recompile), and neither xmonad.hs nor any *.hs / *.lhs / *.hsc files in lib/ have been changed.
/home/philippe/.xmonad/xmonad-x86_64-linux: error while loading shared libraries: libHSxmonad-contrib-0.16-KKfUmtIonstICqbgIKQKYh-ghc8.10.4.so: cannot open shared object file: No such file or directory
I've tried a ton of solutions people mentioned on the internet — so far I've spent more than 3 hours trying to debug this —, among them, notably:
cabal install --lib xmonad-contrib
, which had solved some issues I've had with XMonad in the past.~/.local/bin/xmonad --recompile -v
instead.Does anyone have an idea of how to solve this? I've had problems with upgrades of XMonad before, but never anything close to this — I love Haskell as a language, but its package management is one of the most disgusting, overcomplicated pieces of software I've ever experienced in my 10+ years of programming life.
If I end up cleaning up my system and managing everything through Stack, how do I compile XMonad through it? Using only Stack and then xmonad --recompile
is giving me this error:
XMonad will use ghc to recompile, because "/home/philippe/.xmonad/build" does not exist.
xmonad: ghc: runProcess: runInteractiveProcess: exec: inappropriate type (Not a directory)
(I do have an ~/.xmonad/build/
folder by the way...)
I've finally made it work. The guys from the XMonad repo really helped, you can check out their help in this issue.
Roughly, what I did was:
find
s with the words haskell, stack, ghc, cabal, etc. Don't forget to use pacman -Rns
and pacman -Q
to uninstall everything that come from there first.#!/bin/sh
exec stack ghc -- \
--make xmonad.hs \
-i \
-ilib \
-fforce-recomp \
-main-is main \
-v0 \
-o "$1"jk
exec $HOME/.xmonad/xmonad-x86_64-linux
to .xinitrc
so it runs what was compiled with Stack previously.