-
-
Notifications
You must be signed in to change notification settings - Fork 6.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
fix(jest-changed-files): avoid crashing if the sl
command is taken by Steam Locomotive instead of Sapling
#14061
fix(jest-changed-files): avoid crashing if the sl
command is taken by Steam Locomotive instead of Sapling
#14061
Conversation
This is just a hack unfortunately. The idea of 250ms penalty is not nice at all. Perhaps next major could ship with Removing this auto-detect behaviour would be a breaking change. Adding a TODO comment is all what I could do now (; |
I think we need a detection for what the command is. Super unfortunate steam locomotive does not have a version command. I see we can do e.g. Would be nice with some guidance from Sapling folks. |
It might make sense for us to attempt to detect if we're in a VCS repo. Walk up the disk (in |
@SimenB the man pages can be different between operating systems. My man page doesn't contain that string, see below.
|
As I said in #14046 (comment) , we could check the size of the |
Closing. It does not look right. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Fixes #14046
Summary
Just an idea. If the
sl
command is taken by Steam Locomotive, it takes some 5-6 seconds to run its CLI animation. Addingtimeout
to Execa's options kills the process earlier, hence thegetRoots()
logic ends up incatch
and returnsnull
.Unfortunately the timeout time is a penalty for those who have Steam Locomotive installed. For them
--watch
or--onlyChanged
will be pause for that amount of time. So the number cannot be too large, but should be just enough to get response from Sapling. I don’t know Sapling at all. Seemed like the response was rather instant runningsl root
in a repo with Sapling enabled.Test plan
Tested locally. All tests pass with Sapling installed; no unexpected crash with Steam Locomotive installed.