-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
cargo commands are exiting prematurely (under Emacs M-x shell
)
#2338
Comments
Note in particular this sequence of operations:
That should definitely not be happening, right? |
actually, I think this is something wrong with the particular terminal under which I was running Still, commands like |
here is a gist of dtruss instrumenting the |
M-x shell
)
I was able to open up a fresh Emacs instance (with I used to be able to run I'll try to at least bisect over the multirust nightly distributions. |
Okay bisection over the nightly builds gives us some more data on where this may have been injected:
|
bisection results:
Apparently this was injected by dd34296 (again, it is possible that this is pointing to something wrong at a deeper level within the rust std lib itself.) |
I found the problem (or at least its indirect source): it was due to the upgrade of the I will put up a PR for my local changes that reverted the version that |
This is undoing part of commit dd34296 Fix rust-lang#2338 (Unfortunately I do not have a suggestion for how to make a unit test for this problem; doing so would require putting in a bit more effort than I have time for at the moment.)
Oh dear this does seem bad, thanks for the investigation @pnkfelix! cc @Stebalien, you may be interested in these failure? |
Before v0.4, term used to return `Ok(true)` if something succeeded, `Ok(false)` if the operation was unsupported, and `Err(io::Error)` if there was an IO error. Now, it returns `Ok(())` if the operation succeeds and `Err(term::Error)` if the operation fails. If the operation is unsupported, it returns `Err(term::Error::NotSupported)`. This means that, if `op` is unsupported, `try!(term.op())` will now return an error instead of silently failing (well, return false but that's effectively silent). Fixes rust-lang#2338
This PR re-upgrades term to 0.4.3. Cargo now detects whether or not color is supported immediately after creating the TerminfoTerminal. Backstory: Before v0.4, term used to return `Ok(true)` if something succeeded, `Ok(false)` if the operation was unsupported, and `Err(io::Error)` if there was an IO error. Now, it returns `Ok(())` if the operation succeeds and `Err(term::Error)` if the operation fails. If the operation is unsupported, it returns `Err(term::Error::NotSupported)`. This means that, if `op` is unsupported, `try!(term.op())` will now return an error instead of silently failing (well, return false but that's effectively silent). Fixes #2338.
Update: This bug is occurring on Mac OS X in a particular (perhaps broken) terminal setup. Still I would like to know why cargo is not behaving properly.
I'm not sure if this is something wrong with my particular setup, or if something has recently changed in Rust or Cargo that would cause this, but I am finding that my cargo invocations (both valid commands and erroneous ones) are exiting prematurely; it seems like the main thread finishes and exits the process, without e.g. flushing buffered I/O. This makes for a frustrating user experience if you don't suspect it is happening.
Concrete examples (where the cases that I pipe the output of
cargo
tocat
cause it to actually finish the desired command, AFAICT).The text was updated successfully, but these errors were encountered: