From 29932b1c3d398c226795bacbc8b25d7a85bc949d Mon Sep 17 00:00:00 2001 From: David Herberth Date: Wed, 5 Mar 2025 20:37:16 +0100 Subject: [PATCH] build: pin MSRV to 1.73 and clarify policy --- CHANGELOG.md | 6 ++++++ Cargo.toml | 4 ++++ README.md | 7 +++++++ symbolic-cfi/Cargo.toml | 3 ++- symbolic-common/Cargo.toml | 3 ++- symbolic-common/src/path.rs | 2 +- symbolic-debuginfo/Cargo.toml | 3 ++- symbolic-demangle/Cargo.toml | 3 ++- symbolic-il2cpp/Cargo.toml | 3 ++- symbolic-ppdb/Cargo.toml | 3 ++- symbolic-symcache/Cargo.toml | 3 ++- symbolic-symcache/src/lookup.rs | 12 ++++++++---- symbolic-symcache/src/writer.rs | 13 +++++++++++-- symbolic-unreal/Cargo.toml | 3 ++- symbolic/Cargo.toml | 3 ++- 15 files changed, 55 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0b3ee4d8..ecc88a303 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Unreleased + +**Fixes** + +- Restore support for older Rust versions and clarify MSRV policy. ([#902](https://github.com/getsentry/symbolic/pull/902)) + ## 12.14.0 **Features** diff --git a/Cargo.toml b/Cargo.toml index e8f17957d..4f4c6c32a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,10 @@ resolver = "2" members = ["symbolic*", "examples/*"] +[workspace.package] +edition = "2021" +rust-version = "1.73" + [workspace.dependencies] anyhow = "1.0.32" anylog = "0.6.4" diff --git a/README.md b/README.md index 4ffc8c6db..9c9853c54 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,13 @@ To run these examples, use the `run` script. For example: ./run minidump_stackwalk mini.dmp /path/to/files ``` +## Supported Rust Versions + +Symbolic tries to not break MSRV compatibility but makes no guarantees about the Rust version. +Although you can expect Rust version compatibility of **at least 6 months**. + +The current MSRV is 1.73. + ## License Symbolic is licensed under the MIT license. It uses some Apache2 licensed code diff --git a/symbolic-cfi/Cargo.toml b/symbolic-cfi/Cargo.toml index 2217464a1..9115b85de 100644 --- a/symbolic-cfi/Cargo.toml +++ b/symbolic-cfi/Cargo.toml @@ -12,7 +12,8 @@ repository = "https://github.com/getsentry/symbolic" description = """ A library to process call frame information """ -edition = "2021" +edition.workspace = true +rust-version.workspace = true [dependencies] symbolic-common = { version = "12.14.0", path = "../symbolic-common" } diff --git a/symbolic-common/Cargo.toml b/symbolic-common/Cargo.toml index e42a2e8d6..23ead1b90 100644 --- a/symbolic-common/Cargo.toml +++ b/symbolic-common/Cargo.toml @@ -14,7 +14,8 @@ description = """ Common types and utilities for symbolic, a library to symbolicate and process stack traces from native applications, minidumps or minified JavaScript. """ -edition = "2021" +edition.workspace = true +rust-version.workspace = true [package.metadata.docs.rs] all-features = true diff --git a/symbolic-common/src/path.rs b/symbolic-common/src/path.rs index 52bcfa021..da43da2b4 100644 --- a/symbolic-common/src/path.rs +++ b/symbolic-common/src/path.rs @@ -54,7 +54,7 @@ fn is_windows_driveletter>(path: P) -> bool { if let (Some(drive_letter), Some(b':')) = (path.first(), path.get(1)) { if drive_letter.is_ascii_alphabetic() { - return path.get(2).is_none_or(is_windows_separator); + return path.get(2).map_or(true, is_windows_separator); } } diff --git a/symbolic-debuginfo/Cargo.toml b/symbolic-debuginfo/Cargo.toml index c6e87527e..e52c893ab 100644 --- a/symbolic-debuginfo/Cargo.toml +++ b/symbolic-debuginfo/Cargo.toml @@ -13,7 +13,8 @@ description = """ A library to inspect and load DWARF debugging information from binaries, such as Mach-O or ELF. """ -edition = "2021" +edition.workspace = true +rust-version.workspace = true exclude = ["tests/**/*"] diff --git a/symbolic-demangle/Cargo.toml b/symbolic-demangle/Cargo.toml index 52ed92854..efa26aede 100644 --- a/symbolic-demangle/Cargo.toml +++ b/symbolic-demangle/Cargo.toml @@ -14,7 +14,8 @@ description = """ A library to demangle symbols from various languages and compilers. """ build = "build.rs" -edition = "2021" +edition.workspace = true +rust-version.workspace = true exclude = ["tests/**/*"] diff --git a/symbolic-il2cpp/Cargo.toml b/symbolic-il2cpp/Cargo.toml index 57c346725..93282e2c3 100644 --- a/symbolic-il2cpp/Cargo.toml +++ b/symbolic-il2cpp/Cargo.toml @@ -9,7 +9,8 @@ repository = "https://github.com/getsentry/symbolic" description = """ A library for parsing il2cpp line mappings. """ -edition = "2021" +edition.workspace = true +rust-version.workspace = true [dependencies] indexmap = { workspace = true } diff --git a/symbolic-ppdb/Cargo.toml b/symbolic-ppdb/Cargo.toml index a492824c4..a10868fe6 100644 --- a/symbolic-ppdb/Cargo.toml +++ b/symbolic-ppdb/Cargo.toml @@ -12,7 +12,8 @@ repository = "https://github.com/getsentry/symbolic" description = """ A library for parsing and performing lookups on Portable PDB files. """ -edition = "2021" +edition.workspace = true +rust-version.workspace = true exclude = ["tests/**/*"] diff --git a/symbolic-symcache/Cargo.toml b/symbolic-symcache/Cargo.toml index 0d0bfef21..78d168598 100644 --- a/symbolic-symcache/Cargo.toml +++ b/symbolic-symcache/Cargo.toml @@ -13,7 +13,8 @@ description = """ An optimized cache file for fast and memory efficient lookup of symbols and stack frames in debugging information. """ -edition = "2021" +edition.workspace = true +rust-version.workspace = true exclude = ["tests/**/*"] diff --git a/symbolic-symcache/src/lookup.rs b/symbolic-symcache/src/lookup.rs index f5eccb1e6..ec72dbfaa 100644 --- a/symbolic-symcache/src/lookup.rs +++ b/symbolic-symcache/src/lookup.rs @@ -228,9 +228,11 @@ impl<'data> Iterator for Functions<'data> { } } - function.inspect(|_f| { + if function.is_some() { self.function_idx += 1; - }) + } + + function } } @@ -265,9 +267,11 @@ impl<'data> Iterator for Files<'data> { type Item = File<'data>; fn next(&mut self) -> Option { - self.cache.get_file(self.file_idx).inspect(|_f| { + let file = self.cache.get_file(self.file_idx); + if file.is_some() { self.file_idx += 1; - }) + } + file } } diff --git a/symbolic-symcache/src/writer.rs b/symbolic-symcache/src/writer.rs index 170c64723..7eae227a0 100644 --- a/symbolic-symcache/src/writer.rs +++ b/symbolic-symcache/src/writer.rs @@ -309,7 +309,7 @@ impl<'a> SymCacheConverter<'a> { // Emit our source location at current_address if current_address is not covered by an inlinee. if next_inline .as_ref() - .is_none_or(|next| next.start > current_address) + .map_or(true, |next| next.start > current_address) { // "insert_range" self.ranges.insert(current_address, source_location.clone()); @@ -317,7 +317,8 @@ impl<'a> SymCacheConverter<'a> { // If there is an inlinee range covered by this line record, turn this line into that // call's "call line". Make a `call_location_idx` for it and store it in `callee_call_locations`. - if let Some(inline_range) = next_inline.take_if(|next| next.start < line_range_end) + if let Some(inline_range) = + take_if(&mut next_inline, |next| next.start < line_range_end) { // "make_call_location" let (call_location_idx, _) = @@ -589,6 +590,14 @@ fn line_boundaries(address: u64, size: Option) -> (u32, u32) { (start, end) } +fn take_if(opt: &mut Option, predicate: impl FnOnce(&mut T) -> bool) -> Option { + if opt.as_mut().is_some_and(predicate) { + opt.take() + } else { + None + } +} + #[cfg(test)] mod tests { use super::*; diff --git a/symbolic-unreal/Cargo.toml b/symbolic-unreal/Cargo.toml index ea628f410..5f6997388 100644 --- a/symbolic-unreal/Cargo.toml +++ b/symbolic-unreal/Cargo.toml @@ -13,7 +13,8 @@ repository = "https://github.com/getsentry/symbolic" description = """ Parsing and processing utilities for Unreal Engine 4 crash files. """ -edition = "2021" +edition.workspace = true +rust-version.workspace = true exclude = ["tests/**/*"] diff --git a/symbolic/Cargo.toml b/symbolic/Cargo.toml index bc9cb61ec..3f9cf47c3 100644 --- a/symbolic/Cargo.toml +++ b/symbolic/Cargo.toml @@ -14,7 +14,8 @@ description = """ A library to symbolicate and process stack traces from native applications, minidumps, Unreal Engine 4 or minified JavaScript. """ -edition = "2021" +edition.workspace = true +rust-version.workspace = true [package.metadata.docs.rs] all-features = true