Skip to content

[WIP] feat: In debug builds, panic on errors in C bindings #6844

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Hocuri
Copy link
Collaborator

@Hocuri Hocuri commented May 5, 2025

In order to get a chance on finding the root cause of errors such as deltachat/deltachat-android#3756, I suggest that we panic on errors with debug assertions enabled. This way, we get the the root error message and can fix the problem.

This is in line with us adding debug_assert!() in some places, and it will only apply for people like myself who are building their own APK with scripts/ndk-make.sh --debug. Every other APK, including the preview APKs build here on GitHub for every PR, are not affected.

I didn't test this yet, first wanted to ask whether you think something like this might be reasonable.

@Hocuri Hocuri requested review from r10s, link2xt and adbenitez May 5, 2025 17:05
@link2xt
Copy link
Collaborator

link2xt commented May 5, 2025

Legacy Python tests for incorrect calls should probably be removed.

@Hocuri Hocuri marked this pull request as draft May 5, 2025 17:41
@Hocuri Hocuri changed the title feat: In debug builds, panic on errors in C bindings [WIP] feat: In debug builds, panic on errors in C bindings May 11, 2025
@iequidoo
Copy link
Collaborator

Looks reasonable, but should probably be feat: In debug builds, panic on critical errors and incorrect calls in C bindings

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