-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Remove ProcessTaskRunner.findCommand, introduce process "started" event #3843
Conversation
Not quite ready for review, I need to investigate the failing tests (unless you want to comment on the general approach). |
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.
LGTM! But it seems like it broke the terminal tests.
a0d44a4
to
8bc7593
Compare
Still some errors on Windows:
|
Do we really want to support our version of node-pty? Is it temporary? Is there a PR against node-pty to introduce this feature? Do we need CQ for our version? |
Hopefully it is temporary. Once we confirmed that the approach works well, I would try to get the functionality merged upstream. |
08b3cf2
to
b18d327
Compare
@simark just fyi: I usually test an idea early with upstream, i.e. open an issue or a PR with proposed approach and ask whether it is a right way doing it |
Ah I just remembered: we (at Ericsson) don't have the approval to sign the Microsoft CLA, so we can't contribute to upstream node-pty... otherwise I would have opened a PR already. @marcdumais-work could give more details. |
f9d843b
to
1738cc8
Compare
1738cc8
to
3a1026c
Compare
It looks like the only errors remaining on AppVeyor are the "standard" ones, so this PR is ready to be reviewed. |
3a1026c
to
f6fdf27
Compare
Ping. |
Opening a PR does not require signing anything. You can also then say the same on the PR and ask maintainers to land it as own. |
I don't think that is how it works. Signing a CLA usually means "I confirm I wrote this code, I confirm I own the rights on it, I confirm I have the right to license it with license X". That is used to protect the project from merging code that shouldn't be merged. The Microsoft people can't just take my code and merge it themselves if I didn't sign the CLA, because that would infringe their own CLA (they don't own that code). |
+1. This is very similar how we require that the Eclipse ECA be signed before we merge a contribution. True, one does not need to sign the CLA to submit a PR, but it's needed before it can be ("legally"/"safely") merged. |
@simark @marcdumais-work Can they have a look at PR, say yes it is real issue, we cannot merge your PR, but we will fix it in our way without copying your code? The point is that patching some library without bringing an issue to original maintainers is not very sustainable. They can say as well it is not an issue, you should do in this way or it should be fixed differently. At least opening an issue and hearing opinion of maintainers would be good. |
Ok, I opened this: |
In the long term goal of handling properly shell tasks (allowing the user to specify "abc && def" as the command), we need to get rid of the findCommand method in ProcessTaskRunner. Otherwise, it will always return that the binary "abc && def" can't be found. Even for non-shell tasks, it doesn't seem ideal to implement ourselves the logic of looking through PATH. It's better to leave that to the OS. Instead, we want to rely on the underlying thing we use to run processes (either node's child_process or node-pty) to return us an appropriate error code. With node's child_process, we can do it out-of-the-box. With node-pty, we use our own fork available at [1] which adds the necessary features. On error, the Process emits an onError event. For the non-error case, we need to know when the process has been successfully started, so we can inform the client that the task has been successfully started. To do this, I added an 'onStart' event on Process. [1] https://github.com/theia-ide/node-pty/tree/theia Change-Id: Ie2db8909610129842912d312872a48aef3de23a5 Signed-off-by: Simon Marchi <[email protected]>
f6fdf27
to
b174794
Compare
We will try to push again internally to get permission to contribute to node-pty. Can we merge this in the mean time? |
Ping. |
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.
LGTM, does anyone see anything?
I do not have good confidence that we will get internal permission to contribute this patch to the upstream project. But we should still proceed I think, even if it's not ideal. It's possible that someone will fix the upstream issue Simon opened, at which point we could switch back to the official node-pty.
Technically yes but practically we already have the "NPM production dependencies" CQ that's under review for another PR / branch; we would need to wait until it unblocks before registering a new one for this PR here. If we skip, the new dependency here will be looked-at as part of the next such CQ, which should get opened right after the current one is approved. |
@akosyakov do you have anything against this change? I mean that we still cannot contribute to Microsoft, and no one wants to pick up @simark's patch to Development on |
@marechal-p I think we can proceed - we will need this for tasks to be compatible with vscode. |
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.
LGTM, works nicely!
Thanks Paul! |
Oops, I should have done a manual rebase and re-test, this causes is a build error. I'll take a look. |
In the long term goal of handling properly shell tasks (allowing the
user to specify "abc && def" as the command), we need to get rid of the
findCommand method in ProcessTaskRunner. Otherwise, it will always
return that the binary "abc && def" can't be found. Even for non-shell
tasks, it doesn't seem ideal to implement ourselves the logic of looking
through PATH. It's better to leave that to the OS.
Instead, we want to rely on the underlying thing we use to run processes
(either node's child_process or node-pty) to return us an appropriate
error code.
With node's child_process, we can do it out-of-the-box. With node-pty,
we use our own fork available at [1] which adds the necessary
features. On error, the Process emits an onError event.
For the non-error case, we need to know when the process has been
successfully started, so we can inform the client that the task has been
successfully started. To do this, I added an 'onStart' event on
Process.
[1] https://github.com/theia-ide/node-pty/tree/theia
Change-Id: Ie2db8909610129842912d312872a48aef3de23a5
Signed-off-by: Simon Marchi [email protected]