From 141127f32a4b9527a3324a1226e59a57ed70cda1 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 15 Sep 2020 14:06:35 +0200 Subject: [PATCH 1/3] Update formatting in Cargo.toml --- Cargo.toml | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 913e775d3..e5e309a3a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,22 +23,34 @@ travis-ci = { repository = "lpc-rs/lpc8xx-hal" } [dependencies] -cortex-m = "0.6.1" -cortex-m-rt = { version = "0.6.10", optional = true } -embedded-hal = { version = "0.2.3", features = ["unproven"] } -nb = "0.1.2" -void = { version = "1.0.2", default-features = false } +cortex-m = "0.6.1" +nb = "0.1.2" + # This should be in [dev-dependencies], but those can't be optional. Issue: # https://github.com/rust-lang/cargo/issues/1596 -compiletest_rs = { version = "0.3.23", optional = true } +[dependencies.compiletest_rs] +version = "0.3.23" +optional = true + +[dependencies.cortex-m-rt] +version = "0.6.10" +optional = true + +[dependencies.embedded-hal] +version = "0.2.3" +features = ["unproven"] [dependencies.lpc82x-pac] -optional = true -version = "0.7" +optional = true +version = "0.7" [dependencies.lpc845-pac] -optional = true -version = "0.3.0" +optional = true +version = "0.3.0" + +[dependencies.void] +version = "1.0.2" +default-features = false [dev-dependencies] From 4b67cf9ebcc4cdaceb942d797102ae65f4e5b45c Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 15 Sep 2020 14:15:23 +0200 Subject: [PATCH 2/3] Update dependency versions The only real change here is to upgrade to `nb` 1.0.0. --- Cargo.toml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e5e309a3a..92403a8d6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,8 +23,8 @@ travis-ci = { repository = "lpc-rs/lpc8xx-hal" } [dependencies] -cortex-m = "0.6.1" -nb = "0.1.2" +cortex-m = "0.6.3" +nb = "1.0.0" # This should be in [dev-dependencies], but those can't be optional. Issue: # https://github.com/rust-lang/cargo/issues/1596 @@ -33,16 +33,16 @@ version = "0.3.23" optional = true [dependencies.cortex-m-rt] -version = "0.6.10" +version = "0.6.13" optional = true [dependencies.embedded-hal] -version = "0.2.3" +version = "0.2.4" features = ["unproven"] [dependencies.lpc82x-pac] optional = true -version = "0.7" +version = "0.7.0" [dependencies.lpc845-pac] optional = true @@ -54,21 +54,21 @@ default-features = false [dev-dependencies] -cortex-m-rtic = "0.5.3" +cortex-m-rtic = "0.5.5" [dev-dependencies.panic-rtt-target] -version = "0.1.0" +version = "0.1.1" features = ["cortex-m"] [dev-dependencies.rtt-target] -version = "0.2.0" +version = "0.2.2" features = ["cortex-m"] # Termion has been made optional, as it doesn't build on Windows: # https://gitlab.redox-os.org/redox-os/termion/issues/167 [build-dependencies.termion] -version = "1.5.3" +version = "1.5.5" optional = true From 6d78d87e64791c70c1c02568e2a2c7e74fc8119d Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 15 Sep 2020 14:28:23 +0200 Subject: [PATCH 3/3] Replace `termion` with `crossterm` From what I can gather, `crossterm` is like `termion`, but cross-platform and generally better. This commit restores colored build script output unconditionally. --- Cargo.toml | 7 ++----- build.rs | 16 ++-------------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 92403a8d6..e7c04bad6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -65,11 +65,8 @@ version = "0.2.2" features = ["cortex-m"] -# Termion has been made optional, as it doesn't build on Windows: -# https://gitlab.redox-os.org/redox-os/termion/issues/167 -[build-dependencies.termion] -version = "1.5.5" -optional = true +[build-dependencies] +crossterm = "0.17.7" [features] diff --git a/build.rs b/build.rs index 0fa1e72f6..5995b0437 100644 --- a/build.rs +++ b/build.rs @@ -5,8 +5,7 @@ use std::{ path::PathBuf, }; -#[cfg(feature = "termion")] -use termion::{color, style}; +use crossterm::style::{Colorize as _, Styler as _}; fn main() -> Result<(), Error> { let target = Target::read(); @@ -161,18 +160,7 @@ impl From for Error { } fn error(message: &str) -> ! { - #[cfg(not(feature = "termion"))] - panic!("\n\n\n{}\n\n\n", message); - - #[cfg(feature = "termion")] - panic!( - "\n\n\n{}{}{}{}{}\n\n\n", - style::Bold, - color::Fg(color::Red), - message, - color::Fg(color::Reset), - style::Reset, - ); + panic!("\n\n\n{}\n\n\n", message.bold().red(),); } fn warn_unspecific_selection() {