cargo: Build progressbar interleaved with rustc errors
[...]
error[E0308]: mismatched types
--> /Users/bjorn/.cargo/git/checkouts/miri-f9dcdd0c0ec69fb1/9143a69/src/fn_call.rs:202:83
|
202 | let ptr = self.memory.allocate(Size::from_bytes(size), align, Some(MemoryKind::C.into()))?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `rustc_mir::interpret::MemoryKind`, found enum `std::option::Option`
|
= note: expected type `rustc_mir::interpret::MemoryKind<memory::MemoryKind>`
found type `std::option::Option<_>`
error[E0308]: mismatched types===============================> ] 122/137: serde, hyper, serde_derive, miri, ring
--> /Users/bjorn/.cargo/git/checkouts/miri-f9dcdd0c0ec69fb1/9143a69/src/fn_call.rs:398:25
|
398 | Some(MemoryKind::Env.into()),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `rustc_mir::interpret::MemoryKind`, found enum `std::option::Option`
|
= note: expected type `rustc_mir::interpret::MemoryKind<memory::MemoryKind>`
found type `std::option::Option<_>`
error[E0308]: mismatched types===============================> ] 122/137: serde, hyper, serde_derive, miri, ring
--> /Users/bjorn/.cargo/git/checkouts/miri-f9dcdd0c0ec69fb1/9143a69/src/fn_call.rs:659:48
|
659 | Some(MemoryKind::Rust.into()))?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `rustc_mir::interpret::MemoryKind`, found enum `std::option::Option`
|
= note: expected type `rustc_mir::interpret::MemoryKind<memory::MemoryKind>`
found type `std::option::Option<_>`
error[E0308]: mismatched types================================> ] 123/137: serde, hyper, serde_derive, miri, ring
--> /Users/bjorn/.cargo/git/checkouts/miri-f9dcdd0c0ec69fb1/9143a69/src/fn_call.rs:673:48
|
673 | Some(MemoryKind::Rust.into()))?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `rustc_mir::interpret::MemoryKind`, found enum `std::option::Option`
|
= note: expected type `rustc_mir::interpret::MemoryKind<memory::MemoryKind>`
found type `std::option::Option<_>`
Compiling toml v0.4.6
Compiling bincode v1.0.1
error: aborting due to 9 previous errors======================> ] 124/137: hyper, serde_derive, miri, ring, toml, bincode
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 16 (14 by maintainers)
Commits related to this issue
- Disable progress bar for build in Cargo This is primarily blocked on #5695 which unfortunately doesn't have a great fix today, so disable it for now while we try to work out a better solution. Close... — committed to alexcrichton/cargo by alexcrichton 6 years ago
- Auto merge of #5698 - alexcrichton:no-progress-sad, r=kennytm Disable progress bar for build in Cargo This is primarily blocked on #5695 which unfortunately doesn't have a great fix today, so disabl... — committed to rust-lang/cargo by bors 6 years ago
- Auto merge of #5716 - kennytm:unstable-compile-progress, r=alexcrichton Reintroduce the compile progress bar as an unstable feature (-Z compile-progress) This allows us to test the feature on-demand... — committed to rust-lang/cargo by bors 6 years ago
- Auto merge of #5862 - kennytm:capture-rustc-output, r=alexcrichton Fully capture rustc and rustdoc output when -Zcompile-progress is passed Fixes #5764 and #5695. On Windows, we will parse the ANSI... — committed to rust-lang/cargo by bors 6 years ago
- job queue: remove outdated comment about reenabling compile-progress once #5695 is fixed The issue has been resolved and the compile-progress has been reenabled already. — committed to matthiaskrgr/cargo by matthiaskrgr 6 years ago
- Auto merge of #6080 - matthiaskrgr:jq_comment, r=dwijnand job queue: remove outdated comment about reenabling compile-progress once #5695 is fixed The issue has been resolved and the compile-progres... — committed to rust-lang/cargo by bors 6 years ago
@bjorn3 To address that, we can stream the output in the case that only one rustc is running. Otherwise, buffering benefits more because you don’t want the error contexts to be mixed up anyway.
Please don’t, That would drastically increase the time before the first errors are printed in some cases.
@kennytm I believe that the solution here is to buffer all rustc output until the invocation ends, and rustc should never be interactive or display a progress indicator as it’s not a compiler’s job but the build tool’s.
Though, if we ever need to RPC with rustc, we can change the implementation when we do. I’d say that there’s not much motivation for it to be done in the near future, though.
@ishitatsuyuki Cargo currently needs to know the terminal size for the progress bar. This is done by
ioctl(STDERR_FILENO, TIOCGWINSZ)on Unix andGetConsoleScreenBufferInfo(GetStdHandle(STD_ERROR_HANDLE))on Windows. While rustc currently doesn’t need to know the terminal size, I cannot deny the possibility that it might be used in the future. Do you know if it is possible to transmit these info to the child process while piping/teeing their stdout/stderr?I seem to remember a discussion about extracting rustc’s error formatting machinery into a reusable crate (though I can’t find that discussion, sorry!). If that happened, would using rustc’s JSON output be enough, as cargo could use that crate to recreate the errors?