leftwm: LeftWM crashes because `current_exe()` is not supported in OpenBSD

Describe the bug

It is a known issue that current_exe() is not supported in Rust under OpenBSD. The function crashes.

The reason is that the OS itself does not provide any way to reliably know the current exe path of the binary. OpenBSD developers refuse to implement a function like this because they are not sure if they can implement it correct enough.

For the LeftWM use case, maybe we could user use arg[0] passed to canonicalize() or at least fall back to it if current_exe() fails or if the OS is OpenBSD.

Expected behavior (optional)

No response

Steps to reproduce (optional)

Run LeftWM under OpenBSD, redirecting the CLI log to a file. You will see a panic when calling expect after current_exe().

Relevant log output (optional)

No response

OS / Distro

OpenBSD 7.2

Additional System Information (optional)

No response

LeftWM Check

:: LeftWM version: 0.4.0
:: LeftWM git hash: de88c4a-modified
:: Built with no enabled features.
:: Loading configuration . . .
    -> Configuration loaded OK
WARN: Ignoring checks on keybinds as you compiled for an external hot key daemon.
:: Checking environment . . .
    -> Environment OK (has XDG_RUNTIME_DIR)
:: Checking theme . . .
ERROR: No theme folder or symlink `current` found.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 22 (22 by maintainers)

Most upvoted comments

@VuiMuich somehow I didn’t received a notification. Anyway, I don’t use either OpenBSD or, FreeBSD 😄

I use NetBSD only and, this problem does not exist on NetBSD.

I am sorry for putting you on the wrong BSD 😇. At least I was right that the BSDs are very different ☺️

🤦‍♂️ meant to write leftwm-config, sorry for the confusion.

Just tried to build with cargo +beta b seems it is not in 1.66 master yet. Guess I misread that PR thread then, so not sure how close stabilisation of this feature really is, as the release of 1.66 is supposed to happen this Thursday.