From cf0e995595742694076faee307d4b02112430f20 Mon Sep 17 00:00:00 2001 From: Jonathan Pallant Date: Tue, 3 Dec 2024 17:03:09 +0000 Subject: [PATCH 1/7] Adds a defmt 0.3 proxy, and bumps most crates to 1.0.0-alpha. --- Cargo.toml | 2 +- decoder/Cargo.toml | 4 +- defmt-03/Cargo.toml | 50 ++++ defmt-03/src/lib.rs | 336 ++++++++++++++++++++++++++ defmt/Cargo.toml | 4 +- defmt/src/lib.rs | 19 +- firmware/defmt-itm/Cargo.toml | 4 +- firmware/defmt-rtt/Cargo.toml | 4 +- firmware/defmt-semihosting/Cargo.toml | 4 +- firmware/defmt-test/Cargo.toml | 4 +- firmware/panic-probe/Cargo.toml | 4 +- macros/Cargo.toml | 4 +- parser/Cargo.toml | 2 +- print/Cargo.toml | 4 +- qemu-run/Cargo.toml | 2 +- xtask/src/main.rs | 13 +- 16 files changed, 431 insertions(+), 29 deletions(-) create mode 100644 defmt-03/Cargo.toml create mode 100644 defmt-03/src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index e43030e1..94a7a184 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -exclude = ["firmware/*"] +exclude = ["firmware/*", "defmt-03"] members = [ "decoder", "decoder/defmt-json-schema", diff --git a/decoder/Cargo.toml b/decoder/Cargo.toml index 7368d836..44e2b213 100644 --- a/decoder/Cargo.toml +++ b/decoder/Cargo.toml @@ -7,12 +7,12 @@ license = "MIT OR Apache-2.0" name = "defmt-decoder" readme = "README.md" repository = "https://github.com/knurling-rs/defmt" -version = "0.4.0" +version = "1.0.0-alpha" [dependencies] byteorder = "1" colored = "2" -defmt-parser = { version = "=0.4.1", path = "../parser" } +defmt-parser = { version = "=1.0.0-alpha", path = "../parser" } ryu = "1" nom = "7" diff --git a/defmt-03/Cargo.toml b/defmt-03/Cargo.toml new file mode 100644 index 00000000..e52f2d9c --- /dev/null +++ b/defmt-03/Cargo.toml @@ -0,0 +1,50 @@ +[package] +authors = [ "The Knurling-rs developers" ] +categories = [ + "embedded", + "no-std", + "development-tools::debugging", + "value-formatting", +] +description = "A highly efficient logging framework that targets resource-constrained devices, like microcontrollers" +edition = "2021" +keywords = [ "knurling", "logging", "logger", "formatting", "formatter" ] +license = "MIT OR Apache-2.0" +name = "defmt" +readme = "README.md" +repository = "https://github.com/knurling-rs/defmt" +homepage = "https://knurling.ferrous-systems.com/" +version = "0.3.100" + +[dependencies] +defmt10 = { package = "defmt", version = "1.0.0-alpha", path = "../defmt" } + +[features] +alloc = ["defmt10/alloc"] +avoid-default-panic = ["defmt10/avoid-default-panic"] +ip_in_core = ["defmt10/ip_in_core"] + +# Encoding feature flags. These should only be set by end-user crates, not by library crates. +# +# If no encoding is selected, `defmt` will assume the encoding is "don't care" and +# will pick a default one. The current default is `encoding-rzcobs`. The default may change +# in minor releases, changing it is not considered a breaking change since all encodings +# are guaranteed to be supported by the corresponding `defmt-decoder` version. + +# Raw encoding: All log frames are concatenated and sent over the wire with no framing or compression. +# This is the fastest CPU-wise, but may end up being slower if the limiting factor is wire speed. +encoding-raw = ["defmt10/encoding-raw"] + +# rzCOBS encoding: Performs framing on the log frames using reverse-COBS, additionally applying a +# light compression for data known to contain many zero bytes, like defmt streams. +# The framing allows the decoder to recover from missing or corrupted data, and start decoding +# in the middle of a stream, for example when attaching to an already-running device. +encoding-rzcobs = ["defmt10/encoding-rzcobs"] + +# WARNING: for internal use only, not covered by semver guarantees +unstable-test = [ "defmt10/unstable-test" ] + +[package.metadata.docs.rs] +features = [ "alloc" ] +rustdoc-args = [ "--cfg=docsrs" ] +targets = [ "thumbv6m-none-eabi", "thumbv7em-none-eabihf" ] diff --git a/defmt-03/src/lib.rs b/defmt-03/src/lib.rs new file mode 100644 index 00000000..fbf04147 --- /dev/null +++ b/defmt-03/src/lib.rs @@ -0,0 +1,336 @@ +//! A highly efficient logging framework that targets resource-constrained +//! devices, like microcontrollers. +//! +//! Check out the defmt book at for more +//! information about how to use it. +//! +//! # Compatibility +//! +//! This is a defmt-0.3 compatbility crate. It depends upon `defmt-1.0` and +//! re-exports the items that were available in `defmt-0.3`. This allows you to +//! mix defmt-0.3 and defmt-1.0 within the same compilation. +//! +//! The `defmt` wire format might change between minor versions. Attempting to +//! read a defmt stream with an incompatible version will result in an error, +//! and any tool used to process that stream should first check for a symbol +//! named like `_defmt_version_ = X`, where X indicates the wire format version +//! in use. +//! +//! Updating your version of defmt might mean you also have to update your +//! version of `defmt-print` or `defmt-decoder`. + +#![no_std] + +/// Just like the [`core::assert!`] macro but `defmt` is used to log the panic message +/// +/// [`core::assert!`]: https://doc.rust-lang.org/core/macro.assert.html +/// +/// If used, the format string must follow the defmt syntax (documented in [the manual]) +/// +/// [the manual]: https://defmt.ferrous-systems.com/macros.html +pub use defmt10::assert; + +/// Just like the [`core::assert_eq!`] macro but `defmt` is used to log the panic message +/// +/// [`core::assert_eq!`]: https://doc.rust-lang.org/core/macro.assert_eq.html +/// +/// If used, the format string must follow the defmt syntax (documented in [the manual]) +/// +/// [the manual]: https://defmt.ferrous-systems.com/macros.html +pub use defmt10::assert_eq; + +/// Just like the [`core::assert_ne!`] macro but `defmt` is used to log the panic message +/// +/// [`core::assert_ne!`]: https://doc.rust-lang.org/core/macro.assert_ne.html +/// +/// If used, the format string must follow the defmt syntax (documented in [the manual]) +/// +/// [the manual]: https://defmt.ferrous-systems.com/macros.html +pub use defmt10::assert_ne; + +/// Just like the [`core::debug_assert!`] macro but `defmt` is used to log the panic message +/// +/// [`core::debug_assert!`]: https://doc.rust-lang.org/core/macro.debug_assert.html +/// +/// If used, the format string must follow the defmt syntax (documented in [the manual]) +/// +/// [the manual]: https://defmt.ferrous-systems.com/macros.html +pub use defmt10::debug_assert; + +/// Just like the [`core::debug_assert_eq!`] macro but `defmt` is used to log the panic message +/// +/// [`core::debug_assert_eq!`]: https://doc.rust-lang.org/core/macro.debug_assert_eq.html +/// +/// If used, the format string must follow the defmt syntax (documented in [the manual]) +/// +/// [the manual]: https://defmt.ferrous-systems.com/macros.html +pub use defmt10::debug_assert_eq; + +/// Just like the [`core::debug_assert_ne!`] macro but `defmt` is used to log the panic message +/// +/// [`core::debug_assert_ne!`]: https://doc.rust-lang.org/core/macro.debug_assert_ne.html +/// +/// If used, the format string must follow the defmt syntax (documented in [the manual]) +/// +/// [the manual]: https://defmt.ferrous-systems.com/macros.html +pub use defmt10::debug_assert_ne; + +/// Just like the [`core::unreachable!`] macro but `defmt` is used to log the panic message +/// +/// [`core::unreachable!`]: https://doc.rust-lang.org/core/macro.unreachable.html +/// +/// If used, the format string must follow the defmt syntax (documented in [the manual]) +/// +/// [the manual]: https://defmt.ferrous-systems.com/macros.html +pub use defmt10::unreachable; + +/// Just like the [`core::todo!`] macro but `defmt` is used to log the panic message +/// +/// [`core::todo!`]: https://doc.rust-lang.org/core/macro.todo.html +/// +/// If used, the format string must follow the defmt syntax (documented in [the manual]) +/// +/// [the manual]: https://defmt.ferrous-systems.com/macros.html +pub use defmt10::todo; + +/// Just like the [`core::unimplemented!`] macro but `defmt` is used to log the panic message +/// +/// [`core::unimplemented!`]: https://doc.rust-lang.org/core/macro.unimplemented.html +/// +/// If used, the format string must follow the defmt syntax (documented in [the manual]) +/// +/// [the manual]: https://defmt.ferrous-systems.com/macros.html +pub use defmt10::todo as unimplemented; + +/// Just like the [`core::panic!`] macro but `defmt` is used to log the panic message +/// +/// [`core::panic!`]: https://doc.rust-lang.org/core/macro.panic.html +/// +/// If used, the format string must follow the defmt syntax (documented in [the manual]) +/// +/// [the manual]: https://defmt.ferrous-systems.com/macros.html +pub use defmt10::panic; + +/// Unwraps an `Option` or `Result`, panicking if it is `None` or `Err`. +/// +/// This macro is roughly equivalent to `{Option,Result}::{expect,unwrap}` but invocation looks +/// a bit different because this is a macro and not a method. The other difference is that +/// `unwrap!`-ing a `Result` value requires that the error type `E` implements the `Format` +/// trait +/// +/// The following snippet shows the differences between core's unwrap method and defmt's unwrap +/// macro: +/// +/// ``` +/// use defmt::unwrap; +/// +/// # let option = Some(()); +/// let x = option.unwrap(); +/// let x = unwrap!(option); +/// +/// # let result = Ok::<(), ()>(()); +/// let x = result.unwrap(); +/// let x = unwrap!(result); +/// +/// let x = result.expect("text"); +/// let x = unwrap!(result, "text"); +/// +/// # let arg = (); +/// let x = result.expect(&format!("text {:?}", arg)); +/// let x = unwrap!(result, "text {:?}", arg); // arg must be implement `Format` +/// ``` +/// +/// If used, the format string must follow the defmt syntax (documented in [the manual]) +/// +/// [the manual]: https://defmt.ferrous-systems.com/macros.html +pub use defmt10::unwrap; + +/// This is an alias for defmt's [`unwrap`] macro which supports messages like std's except. +/// ``` +/// use defmt::expect; +/// +/// # let result = Ok::<(), ()>(()); +/// # let arg = (); +/// let x = result.expect(&format!("text {:?}", arg)); +/// let x = expect!(result, "text {:?}", arg); // arg must be implement `Format` +/// ``` +/// +/// For the complete documentation see that of defmt's *unwrap* macro. +// note: Linking to unwrap is broken as of 2024-10-09, it links back to expect +pub use defmt10::unwrap as expect; + +/// Overrides the panicking behavior of `defmt::panic!` +/// +/// By default, `defmt::panic!` calls `core::panic!` after logging the panic message using `defmt`. +/// This can result in the panic message being printed twice in some cases. To avoid that issue use +/// this macro. See [the manual] for details. +/// +/// [the manual]: https://defmt.ferrous-systems.com/panic.html +/// +/// # Inter-operation with built-in attributes +/// +/// This attribute cannot be used together with the `export_name` or `no_mangle` attributes +pub use defmt10::panic_handler; + +/// Creates an interned string ([`Str`]) from a string literal. +/// +/// This must be called on a string literal, and will allocate the literal in the object file. At +/// runtime, only a small string index is required to refer to the string, represented as the +/// [`Str`] type. +/// +/// # Example +/// +/// ``` +/// let interned = defmt::intern!("long string literal taking up little space"); +/// ``` +/// +/// [`Str`]: struct.Str.html +pub use defmt10::intern; + +/// Always logs data irrespective of log level. +/// +/// Please refer to [the manual] for documentation on the syntax. +/// +/// [the manual]: https://defmt.ferrous-systems.com/macros.html +pub use defmt10::println; + +/// Logs data at *debug* level. +/// +/// Please refer to [the manual] for documentation on the syntax. +/// +/// [the manual]: https://defmt.ferrous-systems.com/macros.html +pub use defmt10::debug; +/// Logs data at *error* level. +/// +/// Please refer to [the manual] for documentation on the syntax. +/// +/// [the manual]: https://defmt.ferrous-systems.com/macros.html +pub use defmt10::error; +/// Logs data at *info* level. +/// +/// Please refer to [the manual] for documentation on the syntax. +/// +/// [the manual]: https://defmt.ferrous-systems.com/macros.html +pub use defmt10::info; +/// Logs data at *trace* level. +/// +/// Please refer to [the manual] for documentation on the syntax. +/// +/// [the manual]: https://defmt.ferrous-systems.com/macros.html +pub use defmt10::trace; +/// Logs data at *warn* level. +/// +/// Please refer to [the manual] for documentation on the syntax. +/// +/// [the manual]: https://defmt.ferrous-systems.com/macros.html +pub use defmt10::warn; + +/// Just like the [`std::dbg!`] macro but `defmt` is used to log the message at `TRACE` level. +/// +/// [`std::dbg!`]: https://doc.rust-lang.org/std/macro.dbg.html +pub use defmt10::dbg; + +/// Writes formatted data to a [`Formatter`]. +/// +/// [`Formatter`]: struct.Formatter.html +pub use defmt10::write; + +/// Defines the global defmt logger. +/// +/// `#[global_logger]` needs to be put on a unit struct type declaration. This struct has to +/// implement the [`Logger`] trait. +/// +/// # Example +/// +/// ``` +/// use defmt::{Logger, global_logger}; +/// +/// #[global_logger] +/// struct MyLogger; +/// +/// unsafe impl Logger for MyLogger { +/// fn acquire() { +/// # todo!() +/// // ... +/// } +/// unsafe fn flush() { +/// # todo!() +/// // ... +/// } +/// unsafe fn release() { +/// # todo!() +/// // ... +/// } +/// unsafe fn write(bytes: &[u8]) { +/// # todo!() +/// // ... +/// } +/// } +/// ``` +/// +/// [`Logger`]: trait.Logger.html +pub use defmt10::global_logger; + +/// Defines the global timestamp provider for defmt. +/// +/// This macro can be used to attach a timestamp or other data to every defmt message. Its syntax +/// works exactly like the logging macros, except that no local variables can be accessed and the +/// macro should be placed in a module instead of a function. +/// +/// `timestamp!` must only be used once across the crate graph. +/// +/// If no crate defines a timestamp, no timestamp will be included in the logged messages. +/// +/// # Examples +/// +/// ``` +/// # use core::sync::atomic::{AtomicU32, Ordering}; +/// +/// static COUNT: AtomicU32 = AtomicU32::new(0); +/// defmt::timestamp!("{=u32:us}", COUNT.fetch_add(1, Ordering::Relaxed)); +/// ``` +pub use defmt10::timestamp; + +/// Generates a bitflags structure that can be formatted with defmt. +/// +/// This macro is a wrapper around the [`bitflags!`] crate, and provides an (almost) identical +/// interface. Refer to [its documentation] for an explanation of the syntax. +/// +/// [its documentation]: https://docs.rs/bitflags/1/bitflags/ +/// +/// # Limitations +/// +/// This macro only supports bitflags structs represented as one of Rust's built-in unsigned integer +/// types (`u8`, `u16`, `u32`, `u64`, or `u128`). Custom types are not supported. This restriction +/// is necessary to support defmt's efficient encoding. +/// +/// # Examples +/// +/// The example from the bitflags crate works as-is: +/// +/// ``` +/// defmt::bitflags! { +/// struct Flags: u32 { +/// const A = 0b00000001; +/// const B = 0b00000010; +/// const C = 0b00000100; +/// const ABC = Self::A.bits | Self::B.bits | Self::C.bits; +/// } +/// } +/// +/// defmt::info!("Flags::ABC: {}", Flags::ABC); +/// defmt::info!("Flags::empty(): {}", Flags::empty()); +/// ``` +pub use defmt10::bitflags; + +#[doc(inline)] +pub use defmt10::{Debug2Format, Display2Format, Encoder, Formatter, Str}; + +#[doc(inline)] +pub use defmt10::{Format, Logger}; + +#[doc(hidden)] +pub use defmt10::export; + +#[doc(inline)] +pub use defmt10::flush; diff --git a/defmt/Cargo.toml b/defmt/Cargo.toml index d64a4a2e..0b90bb80 100644 --- a/defmt/Cargo.toml +++ b/defmt/Cargo.toml @@ -15,7 +15,7 @@ name = "defmt" readme = "README.md" repository = "https://github.com/knurling-rs/defmt" homepage = "https://knurling.ferrous-systems.com/" -version = "0.3.10" +version = "1.0.0-alpha" [features] alloc = [] @@ -45,7 +45,7 @@ unstable-test = [ "defmt-macros/unstable-test" ] [dependencies] # There is exactly one version of defmt-macros supported in this version of # defmt. Although, multiple versions of defmt might use the *same* defmt-macros. -defmt-macros = { path = "../macros", version = "=0.4.0" } +defmt-macros = { path = "../macros", version = "=1.0.0-alpha" } bitflags = "1" [dev-dependencies] diff --git a/defmt/src/lib.rs b/defmt/src/lib.rs index abffdf8f..605e96db 100644 --- a/defmt/src/lib.rs +++ b/defmt/src/lib.rs @@ -1,14 +1,19 @@ -//! A highly efficient logging framework that targets resource-constrained devices, like -//! microcontrollers. +//! A highly efficient logging framework that targets resource-constrained +//! devices, like microcontrollers. //! -//! Check out the defmt book at for more information about how -//! to use it. +//! Check out the defmt book at for more +//! information about how to use it. //! //! # Compatibility //! -//! The `defmt` wire format might change between major versions. Attempting to read a defmt stream -//! with an incompatible version will result in an error. This means that you have to update both -//! the host and target side if a breaking change in defmt is released. +//! The `defmt` wire format might change between minor versions. Attempting to +//! read a defmt stream with an incompatible version will result in an error, +//! and any tool used to process that stream should first check for a symbol +//! named like `_defmt_version_ = X`, where X indicates the wire format version +//! in use. +//! +//! Updating your version of defmt might mean you also have to update your +//! version of `defmt-print` or `defmt-decoder`. #![cfg_attr(not(feature = "unstable-test"), no_std)] // NOTE if you change this URL you'll also need to update all other crates in this repo diff --git a/firmware/defmt-itm/Cargo.toml b/firmware/defmt-itm/Cargo.toml index d4aa9ea3..a866edb2 100644 --- a/firmware/defmt-itm/Cargo.toml +++ b/firmware/defmt-itm/Cargo.toml @@ -8,9 +8,9 @@ license = "MIT OR Apache-2.0" name = "defmt-itm" readme = "README.md" repository = "https://github.com/knurling-rs/defmt" -version = "0.3.0" +version = "0.4.0" [dependencies] cortex-m = "0.7" critical-section = "1.2.0" -defmt = { version = "0.3", path = "../../defmt" } +defmt = { version = "1.0.0-alpha", path = "../../defmt" } diff --git a/firmware/defmt-rtt/Cargo.toml b/firmware/defmt-rtt/Cargo.toml index 128e0d3d..f46ef91e 100644 --- a/firmware/defmt-rtt/Cargo.toml +++ b/firmware/defmt-rtt/Cargo.toml @@ -8,11 +8,11 @@ license = "MIT OR Apache-2.0" name = "defmt-rtt" readme = "README.md" repository = "https://github.com/knurling-rs/defmt" -version = "0.4.1" +version = "1.0.0-alpha" [features] disable-blocking-mode = [] [dependencies] -defmt = { version = "0.3", path = "../../defmt" } +defmt = { version = "1.0.0-alpha", path = "../../defmt" } critical-section = "1.2" diff --git a/firmware/defmt-semihosting/Cargo.toml b/firmware/defmt-semihosting/Cargo.toml index 436c27b7..1de100ff 100644 --- a/firmware/defmt-semihosting/Cargo.toml +++ b/firmware/defmt-semihosting/Cargo.toml @@ -8,9 +8,9 @@ license = "MIT OR Apache-2.0" name = "defmt-semihosting" readme = "README.md" repository = "https://github.com/knurling-rs/defmt" -version = "0.1.0" +version = "0.2.0" [dependencies] -defmt = { version = "0.3", path = "../../defmt" } +defmt = { version = "1.0.0-alpha", path = "../../defmt" } cortex-m = "0.7" cortex-m-semihosting = "0.5" diff --git a/firmware/defmt-test/Cargo.toml b/firmware/defmt-test/Cargo.toml index d4530796..d8b9c7e1 100644 --- a/firmware/defmt-test/Cargo.toml +++ b/firmware/defmt-test/Cargo.toml @@ -8,10 +8,10 @@ license = "MIT OR Apache-2.0" name = "defmt-test" readme = "README.md" repository = "https://github.com/knurling-rs/defmt" -version = "0.3.2" +version = "0.4.0" [dependencies] cortex-m-rt = "0.7" cortex-m-semihosting = "0.5" -defmt = { version = "0.3", path = "../../defmt" } +defmt = { version = "1.0.0-alpha", path = "../../defmt" } defmt-test-macros = { version = "=0.3.1", path = "macros" } diff --git a/firmware/panic-probe/Cargo.toml b/firmware/panic-probe/Cargo.toml index eb5f770a..5a6640a4 100644 --- a/firmware/panic-probe/Cargo.toml +++ b/firmware/panic-probe/Cargo.toml @@ -8,11 +8,11 @@ license = "MIT OR Apache-2.0" name = "panic-probe" readme = "README.md" repository = "https://github.com/knurling-rs/defmt" -version = "0.3.2" +version = "1.0.0-alpha" [dependencies] cortex-m = "0.7" -defmt = { version = "0.3", path = "../../defmt", optional = true } +defmt = { version = "1.0.0-alpha", path = "../../defmt", optional = true } rtt-target = { version = "0.5", optional = true } diff --git a/macros/Cargo.toml b/macros/Cargo.toml index 6abf8179..25f7fde3 100644 --- a/macros/Cargo.toml +++ b/macros/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" name = "defmt-macros" readme = "README.md" repository = "https://github.com/knurling-rs/defmt" -version = "0.4.0" +version = "1.0.0-alpha" [lib] proc-macro = true @@ -17,7 +17,7 @@ proc-macro = true unstable-test = [] [dependencies] -defmt-parser = { version = "=0.4.1", path = "../parser" } +defmt-parser = { version = "=1.0.0-alpha", path = "../parser" } proc-macro-error2 = "2" proc-macro2 = "1" quote = "1" diff --git a/parser/Cargo.toml b/parser/Cargo.toml index 813a43a3..922449e0 100644 --- a/parser/Cargo.toml +++ b/parser/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" name = "defmt-parser" readme = "README.md" repository = "https://github.com/knurling-rs/defmt" -version = "0.4.1" +version = "1.0.0-alpha" [dependencies] thiserror = "2" diff --git a/print/Cargo.toml b/print/Cargo.toml index 802c4327..0dbb3d49 100644 --- a/print/Cargo.toml +++ b/print/Cargo.toml @@ -8,14 +8,14 @@ license = "MIT OR Apache-2.0" name = "defmt-print" readme = "README.md" repository = "https://github.com/knurling-rs/defmt" -version = "0.3.13" +version = "1.0.0-alpha" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] anyhow = "1" clap = { version = "4.0", features = ["derive", "env"] } -defmt-decoder = { version = "=0.4.0", path = "../decoder" } +defmt-decoder = { version = "=1.0.0-alpha", path = "../decoder" } log = "0.4" notify = "7" tokio = { version = "1.38", features = ["full"] } diff --git a/qemu-run/Cargo.toml b/qemu-run/Cargo.toml index 2d9a60de..0e95068f 100644 --- a/qemu-run/Cargo.toml +++ b/qemu-run/Cargo.toml @@ -8,4 +8,4 @@ version = "0.0.0" [dependencies] anyhow = "1" -defmt-decoder = { version = "=0.4.0", path = "../decoder" } +defmt-decoder = { version = "=1.0.0-alpha", path = "../decoder" } diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 75b7a589..5a9715c2 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -155,6 +155,17 @@ fn test_cross(deny_warnings: bool) { }, "cross", ); + do_test( + || { + run_command( + "cargo", + &["check", "--target", target, "--features", feature], + Some("defmt-03"), + &env, + ) + }, + "cross-03", + ); } } @@ -286,7 +297,7 @@ fn test_lint() { println!("🧪 lint"); // rustfmt - for cwd in [None, Some("firmware/")] { + for cwd in [None, Some("defmt-03/"), Some("firmware/")] { do_test( || run_command("cargo", &["fmt", "--", "--check"], cwd, &[]), "lint", From c7c4a9eed463f1cea2046f1a21f363652c4f70e0 Mon Sep 17 00:00:00 2001 From: Jonathan Pallant Date: Mon, 9 Dec 2024 18:37:00 +0000 Subject: [PATCH 2/7] Update CHANGELOG --- CHANGELOG.md | 88 ++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 71 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8ccaa58..27c46652 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,9 @@ We have several packages which live in this repository. Changes are tracked sepa > A highly efficient logging framework that targets resource-constrained devices, like microcontrollers -[defmt-next]: https://github.com/knurling-rs/defmt/compare/defmt-v0.3.10...main +[defmt-next]: https://github.com/knurling-rs/defmt/compare/defmt-v1.0.0...main +[defmt-v1.0.0]: https://github.com/knurling-rs/defmt/releases/tag/defmt-v1.0.0 +[defmt-v0.3.100]: https://github.com/knurling-rs/defmt/releases/tag/defmt-v0.3.100 [defmt-v0.3.10]: https://github.com/knurling-rs/defmt/releases/tag/defmt-v0.3.10 [defmt-v0.3.9]: https://github.com/knurling-rs/defmt/releases/tag/defmt-v0.3.9 [defmt-v0.3.8]: https://github.com/knurling-rs/defmt/releases/tag/defmt-v0.3.8 @@ -49,8 +51,17 @@ We have several packages which live in this repository. Changes are tracked sepa ### [defmt-next] +* No changes + +### [defmt-v1.0.0] (2025-01-01) + +* [#909] First 1.0 stable release :tada: * [#914] Add cargo-deny as a CI action to check crate security and licensing +### [defmt-v0.3.100] (2025-01-01) + +* [#909] Re-exports defmt-1.0.0 + ### [defmt-v0.3.10] (2024-11-29) * [#902] Minor change to Format impl for `core::panic::PanicInfo`, eliding a lifetime specifier to satisfy Clippy 1.83. @@ -380,7 +391,8 @@ Initial release > Macros for [defmt](#defmt) -[defmt-macros-next]: https://github.com/knurling-rs/defmt/compare/defmt-macros-v0.4.0...main +[defmt-macros-next]: https://github.com/knurling-rs/defmt/compare/defmt-macros-v1.0.0...main +[defmt-macros-v1.0.0]: https://github.com/knurling-rs/defmt/releases/tag/defmt-macros-v1.0.0 [defmt-macros-v0.4.0]: https://github.com/knurling-rs/defmt/releases/tag/defmt-macros-v0.4.0 [defmt-macros-v0.3.10]: https://github.com/knurling-rs/defmt/releases/tag/defmt-macros-v0.3.10 [defmt-macros-v0.3.9]: https://github.com/knurling-rs/defmt/releases/tag/defmt-macros-v0.3.9 @@ -402,6 +414,10 @@ Initial release ### [defmt-macros-next] +### [defmt-macros-v1.0.0] (2025-01-01) + +* [#909] First 1.0 stable release :tada: + ### [defmt-macros-v0.4.0] (2024-11-29) * [#899] Just a major version bump to stop it being used by older defmt versions. @@ -450,7 +466,8 @@ Initial release > A tool that decodes defmt logs and prints them to the console -[defmt-print-next]: https://github.com/knurling-rs/defmt/compare/defmt-print-v0.3.13...main +[defmt-print-next]: https://github.com/knurling-rs/defmt/compare/defmt-print-v1.0.0...main +[defmt-print-v1.0.0]: https://github.com/knurling-rs/defmt/releases/tag/defmt-print-v1.0.0 [defmt-print-v0.3.13]: https://github.com/knurling-rs/defmt/releases/tag/defmt-print-v0.3.13 [defmt-print-v0.3.12]: https://github.com/knurling-rs/defmt/releases/tag/defmt-print-v0.3.12 [defmt-print-v0.3.11]: https://github.com/knurling-rs/defmt/releases/tag/defmt-print-v0.3.11 @@ -470,6 +487,10 @@ Initial release ### [defmt-print-next] +### [defmt-print-v1.0.0] (2025-01-01) + +* [#909] First 1.0 stable release :tada: + ### [defmt-print-v0.3.13] (2024-11-27) * [#807] Add `watch_elf` flag to allow ELF file reload without restarting `defmt-print` @@ -520,7 +541,8 @@ Initial release > Decodes defmt log frames -[defmt-decoder-next]: https://github.com/knurling-rs/defmt/compare/defmt-decoder-v0.4.0...main +[defmt-decoder-next]: https://github.com/knurling-rs/defmt/compare/defmt-decoder-v1.0.0...main +[defmt-decoder-v1.0.0]: https://github.com/knurling-rs/defmt/releases/tag/defmt-decoder-v1.0.0 [defmt-decoder-v0.4.0]: https://github.com/knurling-rs/defmt/releases/tag/defmt-decoder-v0.4.0 [defmt-decoder-v0.3.11]: https://github.com/knurling-rs/defmt/releases/tag/defmt-decoder-v0.3.11 [defmt-decoder-v0.3.10]: https://github.com/knurling-rs/defmt/releases/tag/defmt-decoder-v0.3.10 @@ -543,6 +565,9 @@ Initial release ### [defmt-decoder-next] +### [defmt-decoder-v1.0.0] (2025-01-01) + +* [#909] First 1.0 stable release :tada: * [#902] Minor change to `impl StreamDecoder` for `Raw` and `Rzcobs`, eliding a lifetime specifier to satisfy Clippy 1.83. No observable change. ### [defmt-decoder-v0.4.0] (2024-11-27) @@ -594,7 +619,8 @@ Initial release > Parsing library for defmt format strings -[defmt-parser-next]: https://github.com/knurling-rs/defmt/compare/defmt-parser-v0.4.0...main +[defmt-parser-next]: https://github.com/knurling-rs/defmt/compare/defmt-parser-v1.0.0...main +[defmt-parser-v1.0.0]: https://github.com/knurling-rs/defmt/releases/tag/defmt-parser-v1.0.0 [defmt-parser-v0.4.1]: https://github.com/knurling-rs/defmt/releases/tag/defmt-parser-v0.4.1 [defmt-parser-v0.4.0]: https://github.com/knurling-rs/defmt/releases/tag/defmt-parser-v0.4.0 [defmt-parser-v0.3.4]: https://github.com/knurling-rs/defmt/releases/tag/defmt-parser-v0.3.4 @@ -609,6 +635,10 @@ Initial release ### [defmt-parser-next] +### [defmt-parser-v1.0.0] (2025-01-01) + +* [#909] First 1.0 stable release :tada: + ### [defmt-parser-v0.4.1] (2024-11-27) * [#897] Added its own README @@ -639,7 +669,8 @@ Initial release > Transmit defmt log messages over the RTT (Real-Time Transfer) protocol -[defmt-rtt-next]: https://github.com/knurling-rs/defmt/compare/defmt-rtt-v0.4.1...main +[defmt-rtt-next]: https://github.com/knurling-rs/defmt/compare/defmt-rtt-v1.0.0...main +[defmt-rtt-v1.0.0]: https://github.com/knurling-rs/defmt/releases/tag/defmt-rtt-v1.0.0 [defmt-rtt-v0.4.1]: https://github.com/knurling-rs/defmt/releases/tag/defmt-rtt-v0.4.1 [defmt-rtt-v0.4.0]: https://github.com/knurling-rs/defmt/releases/tag/defmt-rtt-v0.4.0 [defmt-rtt-v0.3.2]: https://github.com/knurling-rs/defmt/releases/tag/defmt-rtt-v0.3.2 @@ -650,9 +681,12 @@ Initial release ### [defmt-rtt-next] +### [defmt-rtt-v1.0.0] (2025-01-01) + +* [#915] Introduced `disable-blocking-mode` feature +* [#909] First 1.0 stable release :tada: * [#902] Use `core::ptr::addr_of_mut!` instead of `&mut` on mutable statics. No observable change. * [#901] `defmt-rtt`: Update to critical-section 1.2 -* [#915] Introduced `disable-blocking-mode` feature ### [defmt-rtt-v0.4.1] (2024-05-13) @@ -679,12 +713,16 @@ Initial release > Transmit defmt log messages over the ITM (Instrumentation Trace Macrocell) stimulus port -[defmt-itm-next]: https://github.com/knurling-rs/defmt/compare/defmt-itm-v0.3.0...main +[defmt-itm-next]: https://github.com/knurling-rs/defmt/compare/defmt-itm-v0.4.0...main +[defmt-itm-v0.4.0]: https://github.com/knurling-rs/defmt/releases/tag/defmt-itm-v0.4.0 [defmt-itm-v0.3.0]: https://github.com/knurling-rs/defmt/releases/tag/defmt-itm-v0.3.0 [defmt-itm-v0.2.0]: https://github.com/knurling-rs/defmt/releases/tag/defmt-itm-v0.2.0 ### [defmt-itm-next] +### [defmt-itm-v0.4.0] (2025-01-01) + +* [#909] Switch to using defmt-1.0 * [#902] Switch to using critical-section, and copy implementation over from defmt-rtt. ### [defmt-itm-v0.3.0] (2021-11-26) @@ -697,11 +735,16 @@ Initial release > Transmit defmt log messages over the semihosting (Instrumentation Trace Macrocell) stimulus port -[defmt-semihosting-next]: https://github.com/knurling-rs/defmt/compare/defmt-semihosting-v0.1.0...main +[defmt-semihosting-next]: https://github.com/knurling-rs/defmt/compare/defmt-semihosting-v0.2.0...main +[defmt-semihosting-v0.2.0]: https://github.com/knurling-rs/defmt/releases/tag/defmt-semihosting-v0.2.0 [defmt-semihosting-v0.1.0]: https://github.com/knurling-rs/defmt/releases/tag/defmt-semihosting-v0.1.0 ### [defmt-semihosting-next] +### [defmt-semihosting-v0.2.0] (2025-01-01) + +* [#909] Switch to using defmt-1.0 + ### [defmt-semihosting-v0.1.0] (2024-11-27) Initial release @@ -710,16 +753,21 @@ Initial release > Panic handler that exits `probe-run` with an error code -[panic-probe-next]: https://github.com/knurling-rs/defmt/compare/panic-probe-v0.3.2...main -[panic-probe-v0.3.2]: https://github.com/knurling-rs/defmt/compare/panic-probe-v0.3.1...panic-probe-v0.3.2 -[panic-probe-v0.3.1]: https://github.com/knurling-rs/defmt/compare/panic-probe-v0.3.0...panic-probe-v0.3.1 -[panic-probe-v0.3.0]: https://github.com/knurling-rs/defmt/compare/panic-probe-v0.2.1...panic-probe-v0.3.0 -[panic-probe-v0.2.1]: https://github.com/knurling-rs/defmt/compare/panic-probe-v0.2.0...panic-probe-v0.2.1 -[panic-probe-v0.2.0]: https://github.com/knurling-rs/defmt/compare/panic-probe-v0.1.0...panic-probe-v0.2.0 -[panic-probe-v0.1.0]: https://github.com/knurling-rs/defmt/compare/panic-probe-v0.0.0...panic-probe-v0.1.0 +[panic-probe-next]: https://github.com/knurling-rs/defmt/compare/panic-probe-v1.0.0...main +[panic-probe-v1.0.0]: https://github.com/knurling-rs/defmt/releases/tag/panic-probe-v1.0.0 +[panic-probe-v0.3.2]: https://github.com/knurling-rs/defmt/releases/tag/panic-probe-v0.3.1 +[panic-probe-v0.3.1]: https://github.com/knurling-rs/defmt/releases/tag/panic-probe-v0.3.0 +[panic-probe-v0.3.0]: https://github.com/knurling-rs/defmt/releases/tag/panic-probe-v0.2.1 +[panic-probe-v0.2.1]: https://github.com/knurling-rs/defmt/releases/tag/panic-probe-v0.2.0 +[panic-probe-v0.2.0]: https://github.com/knurling-rs/defmt/releases/tag/panic-probe-v0.1.0 +[panic-probe-v0.1.0]: https://github.com/knurling-rs/defmt/releases/tag/panic-probe-v0.0.0 ### [panic-probe-next] +### [panic-probe-v1.0.0] (2025-01-01) + +* [#909] Switch to using defmt-1.0 + ### [panic-probe-v0.3.2] (2024-05-13) ### [panic-probe-v0.3.1] (2023-03-29) @@ -740,7 +788,8 @@ Initial release > A test harness for embedded devices -[defmt-test-next]: https://github.com/knurling-rs/defmt/compare/defmt-test-v0.3.2...main +[defmt-test-next]: https://github.com/knurling-rs/defmt/compare/defmt-test-v0.4.0...main +[defmt-test-v0.4.0]: https://github.com/knurling-rs/defmt/releases/tag/defmt-test-v0.4.0 [defmt-test-v0.3.2]: https://github.com/knurling-rs/defmt/releases/tag/defmt-test-v0.3.2 [defmt-test-v0.3.1]: https://github.com/knurling-rs/defmt/releases/tag/defmt-test-v0.3.1 [defmt-test-v0.3.0]: https://github.com/knurling-rs/defmt/releases/tag/defmt-test-v0.3.0 @@ -753,6 +802,10 @@ Initial release ### [defmt-test-next] +### [defmt-test-v0.4.0] (2025-01-01) + +* [#909] Switch to using defmt-1.0 + ### [defmt-test-v0.3.2] (2024-03-05) ### [defmt-test-v0.3.1] (2023-10-11) @@ -839,6 +892,7 @@ Initial release --- [#914]: https://github.com/knurling-rs/defmt/pull/914 +[#909]: https://github.com/knurling-rs/defmt/pull/909 [#902]: https://github.com/knurling-rs/defmt/pull/902 [#901]: https://github.com/knurling-rs/defmt/pull/901 [#899]: https://github.com/knurling-rs/defmt/pull/899 From fbf0b85c8aea371f9e320d900e84f344e70ce13e Mon Sep 17 00:00:00 2001 From: Jonathan Pallant Date: Thu, 12 Dec 2024 11:45:49 +0000 Subject: [PATCH 3/7] semver-check crates one by one It doesn't like having two versions of defmt, and it ignores the 'exclude' field in the workspace. --- .github/workflows/cargo-semver-check.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/cargo-semver-check.yml b/.github/workflows/cargo-semver-check.yml index b86b92c1..dabb4d52 100644 --- a/.github/workflows/cargo-semver-check.yml +++ b/.github/workflows/cargo-semver-check.yml @@ -18,6 +18,27 @@ jobs: uses: obi1kenobi/cargo-semver-checks-action@v2 with: feature-group: default-features + manifest-path: defmt + - name: Semver check host crates + uses: obi1kenobi/cargo-semver-checks-action@v2 + with: + feature-group: default-features + manifest-path: defmt-03 + - name: Semver check host crates + uses: obi1kenobi/cargo-semver-checks-action@v2 + with: + feature-group: default-features + manifest-path: decoder + - name: Semver check host crates + uses: obi1kenobi/cargo-semver-checks-action@v2 + with: + feature-group: default-features + manifest-path: decoder/defmt-json-schema + - name: Semver check host crates + uses: obi1kenobi/cargo-semver-checks-action@v2 + with: + feature-group: default-features + manifest-path: parser - name: Semver check firmware crates uses: obi1kenobi/cargo-semver-checks-action@v2 with: From 5f46aef40bf46e6e21081fc0852cd6df61610249 Mon Sep 17 00:00:00 2001 From: Jonathan Pallant Date: Thu, 12 Dec 2024 11:50:36 +0000 Subject: [PATCH 4/7] Bump all the new releases to -rc.1 status. --- decoder/Cargo.toml | 4 ++-- defmt-03/Cargo.toml | 4 ++-- defmt/Cargo.toml | 4 ++-- firmware/defmt-itm/Cargo.toml | 2 +- firmware/defmt-rtt/Cargo.toml | 4 ++-- firmware/defmt-semihosting/Cargo.toml | 2 +- firmware/defmt-test/Cargo.toml | 2 +- firmware/panic-probe/Cargo.toml | 4 ++-- macros/Cargo.toml | 4 ++-- parser/Cargo.toml | 2 +- print/Cargo.toml | 4 ++-- qemu-run/Cargo.toml | 2 +- 12 files changed, 19 insertions(+), 19 deletions(-) diff --git a/decoder/Cargo.toml b/decoder/Cargo.toml index 44e2b213..600b9191 100644 --- a/decoder/Cargo.toml +++ b/decoder/Cargo.toml @@ -7,12 +7,12 @@ license = "MIT OR Apache-2.0" name = "defmt-decoder" readme = "README.md" repository = "https://github.com/knurling-rs/defmt" -version = "1.0.0-alpha" +version = "1.0.0-rc.1" [dependencies] byteorder = "1" colored = "2" -defmt-parser = { version = "=1.0.0-alpha", path = "../parser" } +defmt-parser = { version = "=1.0.0-rc.1", path = "../parser" } ryu = "1" nom = "7" diff --git a/defmt-03/Cargo.toml b/defmt-03/Cargo.toml index e52f2d9c..cb7c4e76 100644 --- a/defmt-03/Cargo.toml +++ b/defmt-03/Cargo.toml @@ -14,10 +14,10 @@ name = "defmt" readme = "README.md" repository = "https://github.com/knurling-rs/defmt" homepage = "https://knurling.ferrous-systems.com/" -version = "0.3.100" +version = "0.3.100-rc.1" [dependencies] -defmt10 = { package = "defmt", version = "1.0.0-alpha", path = "../defmt" } +defmt10 = { package = "defmt", version = "1.0.0-rc.1", path = "../defmt" } [features] alloc = ["defmt10/alloc"] diff --git a/defmt/Cargo.toml b/defmt/Cargo.toml index 0b90bb80..8e74d2da 100644 --- a/defmt/Cargo.toml +++ b/defmt/Cargo.toml @@ -15,7 +15,7 @@ name = "defmt" readme = "README.md" repository = "https://github.com/knurling-rs/defmt" homepage = "https://knurling.ferrous-systems.com/" -version = "1.0.0-alpha" +version = "1.0.0-rc.1" [features] alloc = [] @@ -45,7 +45,7 @@ unstable-test = [ "defmt-macros/unstable-test" ] [dependencies] # There is exactly one version of defmt-macros supported in this version of # defmt. Although, multiple versions of defmt might use the *same* defmt-macros. -defmt-macros = { path = "../macros", version = "=1.0.0-alpha" } +defmt-macros = { path = "../macros", version = "=1.0.0-rc.1" } bitflags = "1" [dev-dependencies] diff --git a/firmware/defmt-itm/Cargo.toml b/firmware/defmt-itm/Cargo.toml index a866edb2..cbfb457e 100644 --- a/firmware/defmt-itm/Cargo.toml +++ b/firmware/defmt-itm/Cargo.toml @@ -13,4 +13,4 @@ version = "0.4.0" [dependencies] cortex-m = "0.7" critical-section = "1.2.0" -defmt = { version = "1.0.0-alpha", path = "../../defmt" } +defmt = { version = "1.0.0-rc.1", path = "../../defmt" } diff --git a/firmware/defmt-rtt/Cargo.toml b/firmware/defmt-rtt/Cargo.toml index f46ef91e..07180c85 100644 --- a/firmware/defmt-rtt/Cargo.toml +++ b/firmware/defmt-rtt/Cargo.toml @@ -8,11 +8,11 @@ license = "MIT OR Apache-2.0" name = "defmt-rtt" readme = "README.md" repository = "https://github.com/knurling-rs/defmt" -version = "1.0.0-alpha" +version = "1.0.0-rc.1" [features] disable-blocking-mode = [] [dependencies] -defmt = { version = "1.0.0-alpha", path = "../../defmt" } +defmt = { version = "1.0.0-rc.1", path = "../../defmt" } critical-section = "1.2" diff --git a/firmware/defmt-semihosting/Cargo.toml b/firmware/defmt-semihosting/Cargo.toml index 1de100ff..9f9838fe 100644 --- a/firmware/defmt-semihosting/Cargo.toml +++ b/firmware/defmt-semihosting/Cargo.toml @@ -11,6 +11,6 @@ repository = "https://github.com/knurling-rs/defmt" version = "0.2.0" [dependencies] -defmt = { version = "1.0.0-alpha", path = "../../defmt" } +defmt = { version = "1.0.0-rc.1", path = "../../defmt" } cortex-m = "0.7" cortex-m-semihosting = "0.5" diff --git a/firmware/defmt-test/Cargo.toml b/firmware/defmt-test/Cargo.toml index d8b9c7e1..5359d6f0 100644 --- a/firmware/defmt-test/Cargo.toml +++ b/firmware/defmt-test/Cargo.toml @@ -13,5 +13,5 @@ version = "0.4.0" [dependencies] cortex-m-rt = "0.7" cortex-m-semihosting = "0.5" -defmt = { version = "1.0.0-alpha", path = "../../defmt" } +defmt = { version = "1.0.0-rc.1", path = "../../defmt" } defmt-test-macros = { version = "=0.3.1", path = "macros" } diff --git a/firmware/panic-probe/Cargo.toml b/firmware/panic-probe/Cargo.toml index 5a6640a4..74cfbf0f 100644 --- a/firmware/panic-probe/Cargo.toml +++ b/firmware/panic-probe/Cargo.toml @@ -8,11 +8,11 @@ license = "MIT OR Apache-2.0" name = "panic-probe" readme = "README.md" repository = "https://github.com/knurling-rs/defmt" -version = "1.0.0-alpha" +version = "1.0.0-rc.1" [dependencies] cortex-m = "0.7" -defmt = { version = "1.0.0-alpha", path = "../../defmt", optional = true } +defmt = { version = "1.0.0-rc.1", path = "../../defmt", optional = true } rtt-target = { version = "0.5", optional = true } diff --git a/macros/Cargo.toml b/macros/Cargo.toml index 25f7fde3..8087d71c 100644 --- a/macros/Cargo.toml +++ b/macros/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" name = "defmt-macros" readme = "README.md" repository = "https://github.com/knurling-rs/defmt" -version = "1.0.0-alpha" +version = "1.0.0-rc.1" [lib] proc-macro = true @@ -17,7 +17,7 @@ proc-macro = true unstable-test = [] [dependencies] -defmt-parser = { version = "=1.0.0-alpha", path = "../parser" } +defmt-parser = { version = "=1.0.0-rc.1", path = "../parser" } proc-macro-error2 = "2" proc-macro2 = "1" quote = "1" diff --git a/parser/Cargo.toml b/parser/Cargo.toml index 922449e0..13fbd426 100644 --- a/parser/Cargo.toml +++ b/parser/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" name = "defmt-parser" readme = "README.md" repository = "https://github.com/knurling-rs/defmt" -version = "1.0.0-alpha" +version = "1.0.0-rc.1" [dependencies] thiserror = "2" diff --git a/print/Cargo.toml b/print/Cargo.toml index 0dbb3d49..19951550 100644 --- a/print/Cargo.toml +++ b/print/Cargo.toml @@ -8,14 +8,14 @@ license = "MIT OR Apache-2.0" name = "defmt-print" readme = "README.md" repository = "https://github.com/knurling-rs/defmt" -version = "1.0.0-alpha" +version = "1.0.0-rc.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] anyhow = "1" clap = { version = "4.0", features = ["derive", "env"] } -defmt-decoder = { version = "=1.0.0-alpha", path = "../decoder" } +defmt-decoder = { version = "=1.0.0-rc.1", path = "../decoder" } log = "0.4" notify = "7" tokio = { version = "1.38", features = ["full"] } diff --git a/qemu-run/Cargo.toml b/qemu-run/Cargo.toml index 0e95068f..010e277d 100644 --- a/qemu-run/Cargo.toml +++ b/qemu-run/Cargo.toml @@ -8,4 +8,4 @@ version = "0.0.0" [dependencies] anyhow = "1" -defmt-decoder = { version = "=1.0.0-alpha", path = "../decoder" } +defmt-decoder = { version = "=1.0.0-rc.1", path = "../decoder" } From 9560a4c9ad5e27ca2ac4144e7d8bea8e28e2ea04 Mon Sep 17 00:00:00 2001 From: Jonathan Pallant Date: Thu, 12 Dec 2024 16:49:42 +0000 Subject: [PATCH 5/7] We cannot semver-check defmt-03 because semver-checks doesn't understand pub use re-exports. It's something Predrag is working on, but for now, we have to do this by hand. --- .github/workflows/cargo-semver-check.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/cargo-semver-check.yml b/.github/workflows/cargo-semver-check.yml index dabb4d52..0ce78f83 100644 --- a/.github/workflows/cargo-semver-check.yml +++ b/.github/workflows/cargo-semver-check.yml @@ -19,11 +19,6 @@ jobs: with: feature-group: default-features manifest-path: defmt - - name: Semver check host crates - uses: obi1kenobi/cargo-semver-checks-action@v2 - with: - feature-group: default-features - manifest-path: defmt-03 - name: Semver check host crates uses: obi1kenobi/cargo-semver-checks-action@v2 with: From 23435342e48000cc5bb2b322b7b94a7544342f16 Mon Sep 17 00:00:00 2001 From: Jonathan Pallant Date: Wed, 8 Jan 2025 11:41:25 +0000 Subject: [PATCH 6/7] Add missing README --- defmt-03/README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 defmt-03/README.md diff --git a/defmt-03/README.md b/defmt-03/README.md new file mode 100644 index 00000000..e1cd94a1 --- /dev/null +++ b/defmt-03/README.md @@ -0,0 +1,54 @@ +# `defmt` + +`defmt` ("de format", short for "deferred formatting") is a highly efficient logging framework that targets resource-constrained devices, like microcontrollers. + +For more details about the framework check the book at . + +This release is a semver-trick compatibility shim that allows packages using `defmt = "0.3"` to inter-operate with packages using `defmt = "1.0"`. + +## Setup + +### New project + +The fastest way to get started with `defmt` is to use our [app-template] to set up a new Cortex-M embedded project. + +[app-template]: https://github.com/knurling-rs/app-template + +### Existing project + +To include `defmt` in your existing project, follow our [Application Setup guide]. + +[Application Setup guide]: https://defmt.ferrous-systems.com/setup.html + +## MSRV + +The minimum supported Rust version is 1.76 (or Ferrocene 24.05). `defmt` is tested against the latest stable Rust version and the MSRV. + +## Support + +`defmt` is part of the [Knurling] project, [Ferrous Systems]' effort at +improving tooling used to develop for embedded systems. + +If you think that our work is useful, consider sponsoring it via [GitHub +Sponsors]. + +## License + +Licensed under either of + +- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or + http://www.apache.org/licenses/LICENSE-2.0) + +- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) + +at your option. + +### Contribution + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in the work by you, as defined in the Apache-2.0 license, shall be +licensed as above, without any additional terms or conditions. + +[Knurling]: https://knurling.ferrous-systems.com/ +[Ferrous Systems]: https://ferrous-systems.com/ +[GitHub Sponsors]: https://github.com/sponsors/knurling-rs From 2bb6072ac26477665f028cbdeaa33d24f847128f Mon Sep 17 00:00:00 2001 From: Jonathan Pallant Date: Thu, 9 Jan 2025 13:00:57 +0000 Subject: [PATCH 7/7] Drop the rc.1 suffix. --- decoder/Cargo.toml | 4 ++-- defmt-03/Cargo.toml | 4 ++-- defmt/Cargo.toml | 4 ++-- firmware/defmt-itm/Cargo.toml | 2 +- firmware/defmt-rtt/Cargo.toml | 4 ++-- firmware/defmt-semihosting/Cargo.toml | 2 +- firmware/defmt-test/Cargo.toml | 2 +- firmware/panic-probe/Cargo.toml | 4 ++-- macros/Cargo.toml | 4 ++-- parser/Cargo.toml | 2 +- print/Cargo.toml | 4 ++-- qemu-run/Cargo.toml | 2 +- 12 files changed, 19 insertions(+), 19 deletions(-) diff --git a/decoder/Cargo.toml b/decoder/Cargo.toml index 600b9191..a3cdd96d 100644 --- a/decoder/Cargo.toml +++ b/decoder/Cargo.toml @@ -7,12 +7,12 @@ license = "MIT OR Apache-2.0" name = "defmt-decoder" readme = "README.md" repository = "https://github.com/knurling-rs/defmt" -version = "1.0.0-rc.1" +version = "1.0.0" [dependencies] byteorder = "1" colored = "2" -defmt-parser = { version = "=1.0.0-rc.1", path = "../parser" } +defmt-parser = { version = "=1.0.0", path = "../parser" } ryu = "1" nom = "7" diff --git a/defmt-03/Cargo.toml b/defmt-03/Cargo.toml index cb7c4e76..254e4804 100644 --- a/defmt-03/Cargo.toml +++ b/defmt-03/Cargo.toml @@ -14,10 +14,10 @@ name = "defmt" readme = "README.md" repository = "https://github.com/knurling-rs/defmt" homepage = "https://knurling.ferrous-systems.com/" -version = "0.3.100-rc.1" +version = "0.3.100" [dependencies] -defmt10 = { package = "defmt", version = "1.0.0-rc.1", path = "../defmt" } +defmt10 = { package = "defmt", version = "1", path = "../defmt" } [features] alloc = ["defmt10/alloc"] diff --git a/defmt/Cargo.toml b/defmt/Cargo.toml index 8e74d2da..b4956f1d 100644 --- a/defmt/Cargo.toml +++ b/defmt/Cargo.toml @@ -15,7 +15,7 @@ name = "defmt" readme = "README.md" repository = "https://github.com/knurling-rs/defmt" homepage = "https://knurling.ferrous-systems.com/" -version = "1.0.0-rc.1" +version = "1.0.0" [features] alloc = [] @@ -45,7 +45,7 @@ unstable-test = [ "defmt-macros/unstable-test" ] [dependencies] # There is exactly one version of defmt-macros supported in this version of # defmt. Although, multiple versions of defmt might use the *same* defmt-macros. -defmt-macros = { path = "../macros", version = "=1.0.0-rc.1" } +defmt-macros = { path = "../macros", version = "=1.0.0" } bitflags = "1" [dev-dependencies] diff --git a/firmware/defmt-itm/Cargo.toml b/firmware/defmt-itm/Cargo.toml index cbfb457e..62eda688 100644 --- a/firmware/defmt-itm/Cargo.toml +++ b/firmware/defmt-itm/Cargo.toml @@ -13,4 +13,4 @@ version = "0.4.0" [dependencies] cortex-m = "0.7" critical-section = "1.2.0" -defmt = { version = "1.0.0-rc.1", path = "../../defmt" } +defmt = { version = "1", path = "../../defmt" } diff --git a/firmware/defmt-rtt/Cargo.toml b/firmware/defmt-rtt/Cargo.toml index 07180c85..939ffe03 100644 --- a/firmware/defmt-rtt/Cargo.toml +++ b/firmware/defmt-rtt/Cargo.toml @@ -8,11 +8,11 @@ license = "MIT OR Apache-2.0" name = "defmt-rtt" readme = "README.md" repository = "https://github.com/knurling-rs/defmt" -version = "1.0.0-rc.1" +version = "1.0.0" [features] disable-blocking-mode = [] [dependencies] -defmt = { version = "1.0.0-rc.1", path = "../../defmt" } +defmt = { version = "1", path = "../../defmt" } critical-section = "1.2" diff --git a/firmware/defmt-semihosting/Cargo.toml b/firmware/defmt-semihosting/Cargo.toml index 9f9838fe..dd0c3f1e 100644 --- a/firmware/defmt-semihosting/Cargo.toml +++ b/firmware/defmt-semihosting/Cargo.toml @@ -11,6 +11,6 @@ repository = "https://github.com/knurling-rs/defmt" version = "0.2.0" [dependencies] -defmt = { version = "1.0.0-rc.1", path = "../../defmt" } +defmt = { version = "1", path = "../../defmt" } cortex-m = "0.7" cortex-m-semihosting = "0.5" diff --git a/firmware/defmt-test/Cargo.toml b/firmware/defmt-test/Cargo.toml index 5359d6f0..fadbbfb0 100644 --- a/firmware/defmt-test/Cargo.toml +++ b/firmware/defmt-test/Cargo.toml @@ -13,5 +13,5 @@ version = "0.4.0" [dependencies] cortex-m-rt = "0.7" cortex-m-semihosting = "0.5" -defmt = { version = "1.0.0-rc.1", path = "../../defmt" } +defmt = { version = "1", path = "../../defmt" } defmt-test-macros = { version = "=0.3.1", path = "macros" } diff --git a/firmware/panic-probe/Cargo.toml b/firmware/panic-probe/Cargo.toml index 74cfbf0f..a1251aff 100644 --- a/firmware/panic-probe/Cargo.toml +++ b/firmware/panic-probe/Cargo.toml @@ -8,11 +8,11 @@ license = "MIT OR Apache-2.0" name = "panic-probe" readme = "README.md" repository = "https://github.com/knurling-rs/defmt" -version = "1.0.0-rc.1" +version = "1.0.0" [dependencies] cortex-m = "0.7" -defmt = { version = "1.0.0-rc.1", path = "../../defmt", optional = true } +defmt = { version = "1", path = "../../defmt", optional = true } rtt-target = { version = "0.5", optional = true } diff --git a/macros/Cargo.toml b/macros/Cargo.toml index 8087d71c..269693a0 100644 --- a/macros/Cargo.toml +++ b/macros/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" name = "defmt-macros" readme = "README.md" repository = "https://github.com/knurling-rs/defmt" -version = "1.0.0-rc.1" +version = "1.0.0" [lib] proc-macro = true @@ -17,7 +17,7 @@ proc-macro = true unstable-test = [] [dependencies] -defmt-parser = { version = "=1.0.0-rc.1", path = "../parser" } +defmt-parser = { version = "=1.0.0", path = "../parser" } proc-macro-error2 = "2" proc-macro2 = "1" quote = "1" diff --git a/parser/Cargo.toml b/parser/Cargo.toml index 13fbd426..2a81dfdf 100644 --- a/parser/Cargo.toml +++ b/parser/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT OR Apache-2.0" name = "defmt-parser" readme = "README.md" repository = "https://github.com/knurling-rs/defmt" -version = "1.0.0-rc.1" +version = "1.0.0" [dependencies] thiserror = "2" diff --git a/print/Cargo.toml b/print/Cargo.toml index 19951550..18fa0f00 100644 --- a/print/Cargo.toml +++ b/print/Cargo.toml @@ -8,14 +8,14 @@ license = "MIT OR Apache-2.0" name = "defmt-print" readme = "README.md" repository = "https://github.com/knurling-rs/defmt" -version = "1.0.0-rc.1" +version = "1.0.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] anyhow = "1" clap = { version = "4.0", features = ["derive", "env"] } -defmt-decoder = { version = "=1.0.0-rc.1", path = "../decoder" } +defmt-decoder = { version = "=1.0.0", path = "../decoder" } log = "0.4" notify = "7" tokio = { version = "1.38", features = ["full"] } diff --git a/qemu-run/Cargo.toml b/qemu-run/Cargo.toml index 010e277d..5450838c 100644 --- a/qemu-run/Cargo.toml +++ b/qemu-run/Cargo.toml @@ -8,4 +8,4 @@ version = "0.0.0" [dependencies] anyhow = "1" -defmt-decoder = { version = "=1.0.0-rc.1", path = "../decoder" } +defmt-decoder = { version = "=1.0.0", path = "../decoder" }