Skip to content

Fix build with debug python #3345

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

Merged
merged 15 commits into from
Feb 27, 2025
Merged

Fix build with debug python #3345

merged 15 commits into from
Feb 27, 2025

Conversation

oddbookworm
Copy link
Member

Our build currently sucks when we use python with debug symbols. This at least gets us in a working spot. First commit is to baseline the CI and demo the problem. When that's done, I'll push the fix commit

@oddbookworm oddbookworm added Code quality/robustness Code quality and resilience to changes CI Issue with the Continuous Integration (CI), the actions/bots that test things bugfix PR that fixes bug labels Feb 22, 2025
@oddbookworm
Copy link
Member Author

debug_fix.zip

For anyone too impatient to wait for the CI to be finished, here's the patch (in a zip because github doesn't like the raw patch file lol)

@oddbookworm oddbookworm marked this pull request as ready for review February 22, 2025 18:58
@oddbookworm oddbookworm requested a review from a team as a code owner February 22, 2025 18:58

#if PY_VERSION_HEX >= 0x030C0000

#define CREATE_CACHE_VARIABLES static PyObject *__cached_exception = NULL;
Copy link
Member

Choose a reason for hiding this comment

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

Can probably name this better lol, "cache variables" sounds misleading. Maybe DECLARE_EXC, GET_EXC and SET_EXC?

Copy link
Member Author

Choose a reason for hiding this comment

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

Names are hard lol

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe DECLARE_EXCEPTION_CACHE, CACHE_EXCEPTION, RESTORE_EXCEPTION? I'm not as big a fan of GET_EXC and SET_EXC because it's not as clear IMO what they're actually doing, and DECLARE_EXC makes it sound like you're declaring an exception itself, not a cache to be used

Copy link
Member

Choose a reason for hiding this comment

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

names do be hard 💀

IG my confusion is with the word "cache" because it's not really a cache, is it? I mean, IG we can have DECLARE_EXCEPTION_STORE, STORE_EXCEPTION and RESTORE_EXCEPTION but I'm not too fond of these names either.

Copy link
Member Author

Choose a reason for hiding this comment

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

It is a cache. It’s caching the current exception while we call API that would throw a fit if it was active

Copy link
Contributor

Choose a reason for hiding this comment

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

Why they don't have the PG_ prefix?

Copy link
Member Author

Choose a reason for hiding this comment

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

Renamed to something @ankith26 approved of on discrod

Copy link
Member

@ankith26 ankith26 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the PR 🎉

Copy link
Contributor

@gresm gresm left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@gresm gresm added this to the 2.5.4 milestone Feb 27, 2025
@gresm gresm merged commit 5846dcb into main Feb 27, 2025
27 checks passed
@damusss damusss deleted the fix-debug-python branch May 17, 2025 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix PR that fixes bug CI Issue with the Continuous Integration (CI), the actions/bots that test things Code quality/robustness Code quality and resilience to changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants