Skip to content

Conversation

Hocuri
Copy link
Collaborator

@Hocuri Hocuri commented Jul 23, 2025

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.

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]
```
@link2xt
Copy link
Collaborator

link2xt commented Jul 23, 2025

I'd rather put it into a separate variable, e.g. build_profile=debug or build_profile=release, instead of appending to the existing one, just in case someone parses this info.

@r10s
Copy link
Contributor

r10s commented Jul 23, 2025

thanks a lot! this is super-helpful, at least on iOS, where the release-or-not-flag is set implicitly using a build-script and some tools.

it was not clear to me, that i ran DEBUG core, see - and even if one tracks the path and flags, it is good to have a proof by what core is actually doing

if the info is added as an own var or appended to the version, this would not matter to me, it is only about having that info

ftr, i tested on iOS, and indeed, it is DEBUG (there was a point that DEBUG rust was unbearable slow wrt key generation, that time we always compiled RELEASE, maybe i had that in mind)

@Hocuri
Copy link
Collaborator Author

Hocuri commented Jul 23, 2025

I pushed a commit that puts it into a separate variable instead, and edited the PR description accordingly

@Hocuri
Copy link
Collaborator Author

Hocuri commented Jul 23, 2025

this is super-helpful, at least on iOS

Nice!

ftr, indeed, it is DEBUG (there was a point that DEBUG rust was unbearable slow wrt key generation, that time we always compiled RELEASE, maybe i had that in mind)

FTR FTR, these days we solve this by always optimizing dependencies, even in debug builds, because one rarely has to rebuild them, anyways - in Cargo.toml:

# Always optimize dependencies.
# This does not apply to crates in the workspace.
# <https://doc.rust-lang.org/cargo/reference/profiles.html#overrides>
[profile.dev.package."*"]
opt-level = "z"

@Hocuri
Copy link
Collaborator Author

Hocuri commented Jul 23, 2025

CI is not finishing because of #7035

src/context.rs Outdated
@@ -333,6 +333,12 @@ 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("build_profile", "debug".to_string());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe name it debug_assertions then? It's possible to define more profiles or disable debug assertions in release.

@Hocuri Hocuri merged commit d5c418e into main Jul 24, 2025
29 checks passed
@Hocuri Hocuri deleted the hoc/note-debug-build branch July 24, 2025 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants