fix: use diagnostic instead of compilermessage giving rendered ansi logs during hotpatch (#4123)
* fix: use diagnostic instead of compilermessage giving rendered ansi logs during hotpatch * no need for builder
This commit is contained in:
1 parent
0a18c12c32
commit
b610ab372c
6 files changed
+24
-14
No files matched your search
@@ -320,6 +320,7 @@ use crate::{
|
||||
TargetArgs, TraceSrc, WasmBindgen, WasmOptConfig, Workspace, DX_RUSTC_WRAPPER_ENV_VAR,
|
||||
};
|
||||
use anyhow::Context;
|
||||
use cargo_metadata::diagnostic::Diagnostic;
|
||||
use dioxus_cli_config::format_base_path_meta_element;
|
||||
use dioxus_cli_config::{APP_TITLE_ENV, ASSET_ROOT_ENV};
|
||||
use dioxus_cli_opt::{process_file_to, AssetManifest};
|
||||
@@ -807,7 +808,7 @@ impl BuildRequest {
|
||||
|
||||
match message {
|
||||
Message::BuildScriptExecuted(_) => units_compiled += 1,
|
||||
Message::CompilerMessage(msg) => ctx.status_build_diagnostic(msg),
|
||||
Message::CompilerMessage(msg) => ctx.status_build_diagnostic(msg.message),
|
||||
Message::TextLine(line) => {
|
||||
// Handle the case where we're getting lines directly from rustc.
|
||||
// These are in a different format than the normal cargo output, though I imagine
|
||||
@@ -829,6 +830,11 @@ impl BuildRequest {
|
||||
}
|
||||
}
|
||||
|
||||
// Handle direct rustc diagnostics
|
||||
if let Ok(diag) = serde_json::from_str::<Diagnostic>(&line) {
|
||||
ctx.status_build_diagnostic(diag);
|
||||
}
|
||||
|
||||
// For whatever reason, if there's an error while building, we still receive the TextLine
|
||||
// instead of an "error" message. However, the following messages *also* tend to
|
||||
// be the error message, and don't start with "error:". So we'll check if we've already
|
||||
|
||||
Reference in new issue
Block a user