From d5c418e909ddbadb6e030219bbb3e61c3b91a4ad Mon Sep 17 00:00:00 2001 From: Hocuri Date: Thu, 24 Jul 2025 17:24:54 +0200 Subject: [PATCH] feat: Put the debug/release build version into the info (#7034) The info will look like: ``` debug_assertions=On - DO NOT RELEASE THIS BUILD ``` or: ``` debug_assertions=Off ``` I tested that this actually works when compiling on Android.
This is how it looked before the second commit

The deltachat_core_version line in the info will look like: ``` deltachat_core_version=v2.5.0 [debug build] ``` or: ``` deltachat_core_version=v2.5.0 [release build] ``` I tested that this actually works when compiling on Android.

--- src/context.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/context.rs b/src/context.rs index c346367f4..9e891d8e7 100644 --- a/src/context.rs +++ b/src/context.rs @@ -333,6 +333,15 @@ impl Default for RunningState { /// about the context on top of the information here. pub fn get_info() -> BTreeMap<&'static str, String> { let mut res = BTreeMap::new(); + + #[cfg(debug_assertions)] + res.insert( + "debug_assertions", + "On - DO NOT RELEASE THIS BUILD".to_string(), + ); + #[cfg(not(debug_assertions))] + res.insert("debug_assertions", "Off".to_string()); + res.insert("deltachat_core_version", format!("v{}", &*DC_VERSION_STR)); res.insert("sqlite_version", rusqlite::version().to_string()); res.insert("arch", (std::mem::size_of::() * 8).to_string());