Skip to content

omnisharp-emacs starts OmniSharp.exe under Wine in Arch Linux due to binfmt entry #477

Closed
@Anvoker

Description

@Anvoker

Description

Arch Linux wine-staging 4.7-1 registers a binfmt entry :DOSWin:M::MZ::/usr/bin/wine: that makes all commands like ./file.exe automatically run under wine when file.exe is identified to be a doswin binary. If wine-staging 4.7-1 is installed, omnisharp-emacs will open OmniSharp.exe under wine, which breaks the whole plugin's functionality.

This feature of the build script is mentioned on the arch wiki as an opt-in thing, by enabling systemd-binfmt.service, but I don't remember ever enabling it.

Workaround

Either:

  • Uninstall wine and install it again with the binfmt registration line deleted from the build script.
  • Delete /usr/lib/binfmt.d/wine.conf.
  • Disable systemd-binfmt.service.
  • Set omnisharp-server-executable-path to a bash script. Make the bash script explicitly call mono: exec mono "[path to omnisharp]/OmniSharp.exe" "$@"

Possible Improvement

Perhaps explicitly call mono when executing omnisharp-server-executable-path to hedge against situations where a binary format entry like this can mess things up?


I mostly wanted to leave this here for anyone else running into this issue. Not much of a bug really, but it did waste me a couple of hours.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions