Skip to content

Commit a819308

Browse files
committed
scope/build: add hints for cargo errors
Regression: cargo errors/warnings are not propagated as expected. This is a quick fix to let the user know how to see them until #50 is fixed.
1 parent 610c25c commit a819308

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed
+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
[package]
2+
name = "rtic-parse-test"
3+
version = "0.0.0"
4+
authors = ["Viktor Sonesten <[email protected]>"]
5+
edition = "2018"
6+
7+
[package.metadata.rtic-scope]
8+
pac_name = "stm32f4"
9+
pac_features = ["stm32f401"]
10+
pac_version = "0.13"
11+
interrupt_path = "stm32f4::stm32f401::Interrupt"
12+
tpiu_freq = 16000000
13+
tpiu_baud = 115200
14+
15+
[workspace]
16+
17+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
18+
19+
[dependencies]
20+
embedded-hal = "0.2"
21+
nb = "1"
22+
cortex-m = "0.7"
23+
cortex-m-rt = "0.6"
24+
panic-halt = "0.2"
25+
cortex-m-rtic = "=0.6.0-rc.2"
26+
cortex-m-rtic-trace = { path = "invalid-path" }
27+
cortex-m-semihosting = "0.3.3"
28+
29+
[dependencies.panic-semihosting]
30+
features = ["exit"]
31+
version = "0.5.2"
32+
33+
[dependencies.stm32f4]
34+
version = "0.13"
35+
features = ["stm32f401", "rt"]
36+
37+
[dependencies.stm32f4xx-hal]
38+
version = "0.9"
39+
features = ["rt", "stm32f401"]
40+
41+
[patch.crates-io]
42+
cortex-m = { git = "https://github.com/rtic-scope/cortex-m", branch = "feat/tracing" }

.ci/expected/out/cargo-error.run

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Error `cargo build --bin general` failed with exit status: 101
2+
Hint Cargo errors/warnings are not properly propagated at the moment (see <https://github.com/rtic-scope/cargo-rtic-scope/issues/50>).
3+
Hint Manually build your target application with `cargo build` to see eventual errors/warnings.

cargo-rtic-scope/src/build.rs

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ impl diag::DiagnosableError for CargoError {
5151
"Modify your call so that only one {}-crate is built. Try --bin or --example.",
5252
kind
5353
)],
54+
CargoError::CargoBuildExecFailed(_, _) => vec!["Cargo errors/warnings are not properly propagated at the moment (see <https://github.com/rtic-scope/cargo-rtic-scope/issues/50>).".to_string(),
55+
"Manually build your target application with `cargo build` to see eventual errors/warnings.".to_string()],
5456
_ => vec![],
5557
}
5658
}

0 commit comments

Comments
 (0)