On 22/04/02 08:46, Sebastien Marie wrote: > On Sat, Apr 02, 2022 at 07:11:42AM +0200, Sebastien Marie wrote: > > On Fri, Apr 01, 2022 at 12:16:58PM -0600, Ashlen wrote: > > > > > > XMonad is recompiling and replacing itself with another XMonad process > > > because the current process is called "xmonad" but the compiled > > > configuration should be called "xmonad-x86_64-openbsd" XMonad will use > > > build > > > script at "/home/ashlen/.config/xmonad/build" to recompile. XMonad > > > recompiling because a custom build script is being used. > > > [2022-04-01|12:07:54]: /home/ashlen/.cache/xmonad/xmonad-x86_64-openbsd is > > > newer than xmonad.hs. XMonad recompilation process exited with success! > > > ld.so: xmonad-x86_64-openbsd: can't load library 'libX11.so.17.1' Killed > > > > > > > now, going back to the problem. the port doesn't need these libraries, but > > you > > have a *locally build* binary (~/.cache/xmonad/xmonad-x86_64-openbsd) which > > need them. > > > > I am unsure how xmonad itself work. if I recall well, the configuration is > > done at compile time. so I assume it needs recompilation at some point, > > specially after updating xmonad package (and potentially before removing > > unused libraries). > > > > how do you recompile it ? your mail mentions ~/.config/xmonad/build. it is a > > binary ? a script ? do you made it or it is a 'part' of xmonad ? > > > > After reading https://xmonad.org/INSTALL.html#custom-build-script , some > additional questions: > > could you show use your .xsession or .xinitrc (the part starting xmonad > specially) ? > > if you use `~/.cache/xmonad/xmonad-x86_64-openbsd` directly to start xmonad, > you > would need recompile it (with `xmonad --recompile`) after updating (base > and/or > packages) to keep your local binary in sync with installed libraries. > > if you use `xmonad`, it should recompile itself (at every startup), and you > have > nothing special to do (xmonad-x86_64-openbsd will be always up-to-date > regarding > library dependances). (I am not 100% sure about that, I didn't take time to > read > and understand xmonad source code). > > > Please note that https://xmonad.org/TUTORIAL.html explicitly mentions this > problem: > > One more word of warning: if you are on a distribution that installs > every Haskell package dynamically linked—thus essentially breaking > Haskell—(Arch Linux being a prominent example) then we would highly > recommend installing via stack or cabal as instructed in INSTALL.md. If > you still want to install xmonad via your system’s package manager, you > will need to xmonad --recompile every time a Haskell dependency is > updated—else xmonad may fail to start when you want to log in! > > Thanks. > -- > Sebastien Marie >
Hey, thanks for the response. I can see that my initial message was missing some important information, so sorry for the inconvenience there. It appears you're right about the old binary using old libs. Using a newly compiled binary, I can't reproduce the problem I was running into. It's recommended to use a build script upon installation via a package message: Information for inst:xmonad-0.17.0p0 Install notice: XMonad is now compiled using `cabal v2-build`. If you rely on a custom xmonad.hs configuration file, you should switch to using ~/.xmonad/build script. An example is included in /usr/local/share/examples/xmonad-0.17.0 See https://github.com/xmonad/xmonad-testing/ for more information. I think the problem is in the build script. ~/.config/xmonad/build is essentially the same as /usr/local/share/examples/xmonad-0.17.0/build but I'll post it inline anyway. #!/bin/ksh set -eu output_file="$1" if [ "${output_file}" -nt 'xmonad.hs' ]; then echo "[$(date '+%Y-%m-%d|%H:%M:%S')]: ${output_file} is newer than xmonad.hs." exit 0 fi cabal v2-install exe:xmonad-config --overwrite-policy=always --install-method=copy [ -f "${output_file}" ] && mv -f -- "${output_file}" "${output_file}.old" install -- "${HOME}/.cabal/bin/xmonad-config" "${output_file}" The problem seems to be with the if statement, which is also in /usr/local/share/examples/xmonad-0.17.0/build. The build script checks against xmonad.hs (the configuration file) and if the old binary is newer, it aborts the build process suddenly and successfully. I'm guessing it's to not recompile if no changes were made to the config, which is convenient in the short term but would lead to breakages like this in the long term. I'm a bit surprised I didn't run into a breakage sooner given that. I'll remove the if statement from my ~/.config/xmonad/build but /usr/local/share/examples/xmonad-0.17.0/build would still be affected. Will post ~/.xsession below as well, but I don't think anything relevant to the issue is there. #!/bin/sh # sourced files # shellcheck disable=SC1090,SC1091 . "${HOME}/.profile" xrdb "${HOME}/.Xresources" # keep Downloads clean rm -rf "${HOME}/Downloads" mkdir -m 700 "${HOME}/Downloads" # automatically check for a new version of element-web and update if a # new version is found "${XDG_BIN_HOME}/check-elemweb" # environment variables that either: # # a) don't make sense to put in ~/.profile # b) only make sense with a graphical environment # # some of these are overrides, and some are variables not specified in # ~/.profile. export \ BROWSER='firefox' \ GTK2_RC_FILES="${XDG_CONFIG_HOME}/gtk-2.0/gtkrc-2.0" \ QT_STYLE_OVERRIDE='Adwaita-dark' \ READER='zathura' \ TERMINAL='urxvt' # daemons dunst & sxhkd & unclutter -idle 3 & xcompmgr & xidle & [ -x "$(command -v -- 'dbus-launch')" ] \ && [ -z "${DBUS_SESSION_BUS_ADDRESS}" ] \ && eval "$(dbus-launch --sh-syntax --exit-with-x11)" # look and feel "${XDG_BIN_HOME}/wal" -R -a '85' sct 3500 xset b off # open FileChooser in current working directory instead of recents gsettings set org.gtk.Settings.FileChooser startup-mode cwd # laptop adjustments if [ "$(hostname -s)" = 'lain' ]; then xset m 3/2 0 # trackpad scrolling with middle button xinput set-prop '/dev/wsmouse' 'WS Pointer Wheel Emulation' 1 xinput set-prop '/dev/wsmouse' 'WS Pointer Wheel Emulation Button' 2 xinput set-prop '/dev/wsmouse' 'WS Pointer Wheel Emulation Axes' 6 7 4 5 fi # status bar. "${XDG_BIN_HOME}/sysinfo" | "${XDG_BIN_HOME}/lbar" & # random manual page for didactic purposes "${XDG_BIN_HOME}/randman" | xargs -- "${TERMINAL}" -e man & exec xmonad -- https://amissing.link/