Skip to content
This repository has been archived by the owner on Aug 8, 2018. It is now read-only.

Update LibUV to 1.7.2. #58

Closed
wants to merge 1 commit into from
Closed

Conversation

fwalch
Copy link
Member

@fwalch fwalch commented May 8, 2015

@fwalch fwalch changed the title Update LibUV to version 1.5. Update LibUV to version 1.5.0. May 8, 2015
@ghost
Copy link

ghost commented May 8, 2015

LGTM

@fwalch
Copy link
Member Author

fwalch commented May 8, 2015

Ouch...

Assertion failed: (handle->type == UV_TCP || handle->type == UV_TTY || handle->type == UV_NAMED_PIPE), function uv___stream_fd, file /tmp/neovim20150508-1014-157w97p/.deps/build/src/libuv/src/unix/stream.c, line 1528.

@fwalch
Copy link
Member Author

fwalch commented May 11, 2015

I guess the crucial part of the error is "Vim: Warning: Output is not to a terminal"; how to reproduce such a situation?

@justinmk
Copy link
Member

"Vim: Warning: Output is not to a terminal"; how to reproduce such a situation?

That warning appears when Vim is on the left side of a pipe:

echo foo | vim - | cat

I'm building the latest now on OS X to see if I can reproduce the error.

@justinmk
Copy link
Member

Is there anybody on OS X that can compile latest master from source and try executing nvim -u NONE +s/Vim/Neovim/g +wq test.txt (with Vim as contents of test.txt)? There might be a problem with LibUV 1.5 (which is used in master, but not yet in Homebrew).

I tried this, and no problems on OS X 10.10.3

@jszakmeister
Copy link
Contributor

I tried this too and had no issues. I also tried redirecting the output and didn't see the error either.

@fwalch
Copy link
Member Author

fwalch commented May 13, 2015

That's good news, I suppose. But how to fix the build? 😬

@xu-cheng
Copy link
Contributor

This is caused by the lack of tty.

To reproduce it you can either run brew test neovim:

$ brew test neovim
Testing neovim
==> /usr/local/Cellar/neovim/HEAD/bin/nvim -u NONE +s/Vim/Neovim/g +wq test.txt
+wq
test.txt

Vim: Warning: Output is not to a terminal
Assertion failed: (handle->type == UV_TCP || handle->type == UV_TTY || handle->type == UV_NAMED_PIPE), function uv___stream_fd, file /tmp/neovim20150516-37778-1oyjbqk/.deps/build/src/libuv/src/unix/stream.c, line 1528.
Error: neovim: failed
Failed executing: /usr/local/Cellar/neovim/HEAD/bin/nvim -u NONE +s/Vim/Neovim/g +wq test.txt
/usr/local/Library/Homebrew/formula.rb:843:in `block in system'
/usr/local/Library/Homebrew/formula.rb:800:in `open'
/usr/local/Library/Homebrew/formula.rb:800:in `system'
/usr/local/Library/Taps/neovim/homebrew-neovim/Formula/neovim.rb:79:in `block in <class:Neovim>'
/usr/local/Library/Homebrew/formula.rb:743:in `block in run_test'
/usr/local/Library/Homebrew/extend/fileutils.rb:17:in `mktemp'
/usr/local/Library/Homebrew/formula.rb:739:in `run_test'
/usr/local/Library/Homebrew/test.rb:28:in `block in <main>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/timeout.rb:66:in `timeout'
/usr/local/Library/Homebrew/test.rb:27:in `<main>'

Or below bash command:

$ /bin/bash -c "nvim -u NONE +s/Vim/Neovim/g +wq test.txt" </dev/null  >output.txt 2>&1
[1]    69562 abort      /bin/bash -c "nvim -u NONE +s/Vim/Neovim/g +wq test.txt" < /dev/null >  2>&1

$ cat output.txt
Vim: Warning: Output is not to a terminal
Vim: Warning: Input is not from a terminal
Assertion failed: (handle->type == UV_TCP || handle->type == UV_TTY || handle->type == UV_NAMED_PIPE), function uv___stream_fd, file /tmp/neovim20150516-37778-1oyjbqk/.deps/build/src/libuv/src/unix/stream.c, line 1528.

To work around this, you can use this patch.

diff --git a/Formula/neovim.rb b/Formula/neovim.rb
index 665378a..f3da1f5 100644
--- a/Formula/neovim.rb
+++ b/Formula/neovim.rb
@@ -76,7 +75,7 @@ class Neovim < Formula

   test do
     (testpath/"test.txt").write("Hello World from Vim!!")
-    system bin/"nvim", "-u", "NONE", "+s/Vim/Neovim/g", "+wq", "test.txt"
+    system "script", "-q" ,"/dev/null", bin/"nvim", "-u", "NONE", "+s/Vim/Neovim/g", "+wq", "test.txt"
     assert_equal "Hello World from Neovim!!", File.read("test.txt").strip
   end
 end

FWIW, it would be better that neovim could support environment without tty rather than using the workaround.

@xu-cheng
Copy link
Contributor

Sorry I think I overcomplicate the problem. In fact, it can be reproduced by redirecting stdoutand stderr into the same pipe.

$ nvim -u NONE +s/Vim/Neovim/g +wq test.txt >output.txt 2>&1
[1]    76906 abort      nvim -u NONE +s/Vim/Neovim/g +wq test.txt > output.txt 2>&1

$ cat output.txt
Vim: Warning: Output is not to a terminal
Assertion failed: (handle->type == UV_TCP || handle->type == UV_TTY || handle->type == UV_NAMED_PIPE), function uv___stream_fd, file /tmp/neovim20150516-37778-1oyjbqk/.deps/build/src/libuv/src/unix/stream.c, line 1528.

So it should be considered as a bug.

@fwalch
Copy link
Member Author

fwalch commented May 16, 2015

Created neovim/neovim#2671, thanks for figuring this out @xu-cheng!

@fwalch fwalch changed the title Update LibUV to version 1.5.0. Update LibUV to 1.5.0. May 17, 2015
@fwalch fwalch changed the title Update LibUV to 1.5.0. Update LibUV to 1.5.0 May 17, 2015
@fwalch fwalch changed the title Update LibUV to 1.5.0 Update LibUV to 1.7.2. Aug 27, 2015
@fwalch
Copy link
Member Author

fwalch commented Aug 27, 2015

Okay, finally found a way to avoid the problem by stumbling upon neovim/neovim#3202. Updated to the latest LibUV 1.7.2.

@justinmk
Copy link
Member

LGTM

fwalch added a commit that referenced this pull request Aug 27, 2015
@fwalch fwalch closed this Aug 27, 2015
@fwalch fwalch deleted the update-libuv branch August 27, 2015 12:38
@ghost
Copy link

ghost commented Aug 27, 2015

Make sure to send a PR to the main repo too, when you get the chance.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants