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
[RDY] Job control fixes and pseudo terminal support #2037
Conversation
} UvProcess; | ||
|
||
void pipe_process_init(Job *job, char **argv, bool enable_stdin, | ||
bool enable_stdout, bool enable_stderr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These args could be vertically aligned to help readability. I usually end up doing that if they don't all fit on one line.
4cc4737
to
c3fbf48
Compare
4606585
to
67f1d1f
Compare
f38eaba
to
be25111
Compare
Job autocommands will no longer buffer data chunks that don't end in newlines characters.
Send sigterm immediately since it can be caught by processes. If they don't respond and are still alive after a while, SIGKILL will be sent.
- process spawning was decoupled from the rest of the job control logic. The goal is reusing it for spawning processes connected to pseudo terminal file descriptors. - job_start now receives a JobOptions structure containing all the startup options.
My build is failing with this while linking
I get the error with or without |
@pyrohh strange that you would get this error now, all I did was add a custom executable target for testing the pty integration. What happens if you apply this patch: diff --git a/CMakeLists.txt b/CMakeLists.txt
index caf345d..19ed0e7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -276,7 +276,7 @@ get_compile_flags(NVIM_VERSION_CFLAGS)
add_subdirectory(test/includes)
add_subdirectory(config)
-add_subdirectory(test/functional/job) # compile pty test program
+# add_subdirectory(test/functional/job) # compile pty test program
# Setup some test-related bits. We do this after going down the tree because we |
Similar error happens in the Ubuntu PPA build:
|
This error usually happens when linking against libuv without also linking to pthread, which is normally handled by the pkgconfig(or else even the travis build would fail). I have no clue why this error was introduced in the AUR/PPA builds. cc @jszakmeister |
Hi - I'm getting the same issue when doing a build (even a fresh build) on Debian Jessie. According to the output, pthreads is found:
I can't find confirmation that it is even attempting to link aside from that.
|
The PPA build for 12.04 worked, by the way.. guess that explains why Travis doesn't complain. |
@fwalch is the build error present before this PR? I ask because I can't see what I could have changed to affect libuv linking |
I can't seem to find the revision used to build the packages in the logs :-/ The last successful build was at 2015-02-22 19:55, the one after that is the failing one (there's only one build per day). There are two different errors for x86 and x64: x86:
x64:
Let's maybe move the discussion to #2052? This PR is already closed.. |
After running
Which breaks with a different error and is fixed in the following commit. The first commit that breaks with this
Which is a refactoring commit. EDIT |
Confirmed fixed on Debian 7 |
} | ||
|
||
if (job->opts.stderr_cb) { | ||
uv_pipe_open(&ptyproc->proc_stderr, dup(master)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
coverity thinks these 3 dup()
calls are leaks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to close the original fd. It has been fixed in #2076: https://github.com/tarruda/neovim/blob/builtin-terminal-emulation/src/nvim/os/pty_process.c#L108-L122
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverity complains about not closing the (three additional) handles created by dup(master)
. Closing master
won't close these handles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are closed by libuv when the stream is closed: https://github.com/libuv/libuv/blob/v1.x/src/unix/stream.c#L1563-L1568
The end goal is to spawn bang commands connected to pseudo terminals, which will fix issues such as #1716. For windows an alternative implementation of pty_process.c will be required, probably on top of winpty