Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Anvoker opened this issue May 3, 2019 · 2 comments

Comments

@Anvoker
Copy link
Contributor

Anvoker commented May 3, 2019

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.

@razzmatazz
Copy link
Contributor

@Anvoker Thanks for debugging the issue! Would you be willing to add a section to README.md in a PR?

Anvoker added a commit to Anvoker/omnisharp-emacs that referenced this issue May 4, 2019
Troubleshooting for binary format rules stopping the plugin from correctly starting the OmniSharp server.
@Anvoker
Copy link
Contributor Author

Anvoker commented May 4, 2019

@razzmatazz Done: PR #479. Hopefully not too verbose.

razzmatazz added a commit that referenced this issue May 4, 2019
update readme.md troubleshooting with issue #477
@Anvoker Anvoker closed this as completed May 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants