oni
oni copied to clipboard
OSX - 0.3.6 - Crash on MacOS earlier than 10.12
Oni Version: 0.3.6 Neovim Version (Linux only): 0.3.0 Operating System: OSX
Issue: Crash on start on OSX, depending on some configurations. This shows as a misleading "Unable to start Neovim error".
This issue was reported on Twitter here: https://twitter.com/appelgriebsch/status/1010942999210151937 and
However, in the dev tools, we see:
It appears that there is a crash in or around here: https://github.com/onivim/oni/blob/e46c720fc82f1466347016bc0916a8d744c94793/browser/src/neovim/NeovimInstance.ts#L681
The purpose of this _checkAndFixIfBlocked
is to handle the case where there was an error spinning up nvim
while loading the config - you'd get a blank screen and a 'Press enter to continue` prompt, which was really confusing for users if their config was incompatible - so we tried to provide a better experience by capturing the error and showing a notification.
We don't see the nvim_get_mode
call return in this case, so it seems likely that our call to nvim_get_mode
is crashing the process. cc @justinmk - maybe you have some ideas here too, if anything changed?
** Workaround: **
Until this is fixed, there are a couple of options:
- Disable the
init.vim
- ideally, we could figure out what cases are causing this. - Downgrade to an earlier version of
nvim
- you can set thedebug.neovimPath
to point to an0.2.2
version ofnvim
.
Steps to reproduce:
@CrossR was able to reproduce this on OSX with his configuration: https://github.com/CrossR/dotfiles/blob/master/neovim/.config/nvim/init.vim
In addition to fixing this issue, we should also introduce a regression test that validates against a more in-depth config like @CrossR 's
Also, in theory, this test should be catching stuff like this: https://github.com/onivim/oni/blob/master/test/ci/Neovim.InvalidInitVimHandlingTest.ts
One other detail - @CrossR mentioned his config works fine on Windows, and this issue does not repro. So it could be an OSX-only issue, although @CrossR has some pieces of his config that are non-windows specific - so those could also be a culprit.
It also crashes on my system w/o having a custom init.vim file...
Looks like the bundled NeoVim binary needs OSX 10.12 to work...
As I'm stick to 10.11 El Capitan this won't work for me... :(
Thanks for the details, @appelgriebsch !
@CrossR saw it might be related to this issue: https://github.com/neovim/neovim/issues/8524
We should have our CI build test against earlier OSX versions to help guard against this in the future - https://docs.travis-ci.com/user/reference/osx/#OS-X-Version
I am running OS X 10.11. I have a working install of neovim (from macports) at /opt/local/bin/nvim. I tried setting the environment variable ONI_NEOVIM_PATH to the macports neovim, as recommended for a Linux install, but it did not work. Is there a way to make this work for OS X ?
Same for me, OS X 10.10.5. ONI_NEOVIM_PATH env variable is ignored. I compiled new neovim by using brew install neovim
and then executed next commands to replace nvim binary with symlink to working neovim:
cd /Applications/Oni.app/Contents/Resources/app/node_modules/oni-neovim-binaries/bin/nvim-osx64/bin
rm nvim
ln -s $(which nvim) /Applications/Oni.app/Contents/Resources/app/node_modules/oni-neovim-binaries/bin/nvim-osx64/bin/nvim
The thing is that prebuilt neovim binary 0.3.0 also crashes on my machine with same error message as mentioned above.
The quickest fix for this is to download nvim 0.2.2 from neovim: https://github.com/neovim/neovim/releases/tag/v0.2.2
Then add to your config.js the following. I did this by just editing the file in vim (its stored in ~/.config/oni/config.js
, and an example one can be found here if you don't have one.)
"debug.neovimPath": "/Users/ryan/Desktop/nvim-osx64/bin/nvim",
You'll want to do it in the config.js
not config.tsx
since the .tsx
one won't be compiled until Oni runs.
That at least gets Oni to launch. I'm having issues with both the nightly release from today as well as the included binary in the release, and building from source. 0.2.2
works fine.
Downgrading to 0.2.2
sounds like the safest approach for now!
I see two next steps here:
- Set up our Mac builds so that we test against an earlier Mac version too, so we can check this in CI
- Actually respect the
ONI_NEOVIM_PATH
environment variable on all platforms, so that it is easier to tweak this
I've added the CI server settings to my CI PR, using 10.11
. We could potentially use 10.10
instead however.
And the CI build on 10.11 failed due to not being able to load neovim.
The build on 10.12 can be seen here and seems to be doing okay (though the mac CI is flaky at the moment, so it could still fail, but neovim is at least usable.)
On macOS 10.14 (Mojave) beta, it looks like the neovim binaries (0.3.0, 0.3.1) downloaded from the neovim github releases raise a segmentation fault. Cannot run from the command line, however the same process I'm using (./nvim-osx64/bin/nvim
) works for <0.2.2.
There must be some issue with the github releases, because copying and pasting the 0.3.0 release from homebrew into node_modules/oni-neovim-binaries/bin/nvim-osx64/bin
allows Oni to run fine.
I've not tried on macOS 10.14 yet, but it looks like with the latest release of NeoVim being merged, 10.11 is working: https://travis-ci.org/onivim/oni/builds/408413986.
Same issue here with OSX 10.11 and nvim 0.3.0 and 0.3.1 (tried both). Fixed (as explained above) by adding this file https://github.com/onivim/oni/blob/master/configuration/config.default.js in .config/oni/ and adding my nvim path in the "module.exports" section.
"debug.neovimPath": "/usr/local/bin/nvim",
I've been checking on random CI tests since the merge of neovim 0.3.1
, and all so far have been passing on 10.11, so I think its fixed on that now on master. (Not all the builds are passing, but that is more the fault of the flaky CI tests on mac).
When I tried on 10.14, I was still getting errors unfortunately, so we may still have an issue there.
Reproduced with version 0.3.7 on macOS 10.14 from fresh install via release DMG. No local neovim installed, using packaged version.
Same thing happening with me but I have a local neovim as well as a init.vim.
Latest mojave 10.14.2 here, same issue. Neovim runs fine from terminal, crashes when under onivim.
I'm able to reproduce this now after upgrading to mojave. Trying to track this down, a few observations:
- Running Oni from the command line (
open Oni.app
) works - Running Oni from Finder does not work and exhibits this same failure
Because it works from the command line, a locally built Oni works with yarn launch
and yarn start
. The problem is not with the Neovim binary bundled in Oni.
I see that there is a difference in the PATH
passed to the app via process.env.Path
in the command line / Finder case - perhaps that difference is impacting this.
Finally found the issue with mojave - it's related to this Neovim issue: https://github.com/neovim/neovim/commit/57acfceabeb349377ce244de9b67732b21ed1d18
It seems that the LANG
environment variable isn't provided by default when launching from Finder
in Mojave, and so that crash was getting hit. Locally, if I had that environment variable to spawn Neovim, life is good again.
However, trying to launch oni from the terminal and verifying that LANG
is indeed set still result in the crash for me. Do we have any workaround for this?
Ok, suddenly it works now. Here is what has worked for me.
- Paste
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
into ~/.profile
- Source the profile file
. ~/.profile
from ~/.bash_login
- Logout, and verify in the terminal with
locale
command thatLANG
is not empty. - Launch oni from terminal.