Skip to content
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

Bump PyO3 to 0.20 to fix backtraces (Cherry-pick of #20517) #20532

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

tgolsson
Copy link
Contributor

Fixes #20460. Caused by PyO3/pyo3#3327.

Nothing in the changelog stands out to me as a super-immediate need so doing the minimal upgrade.

@ndellosa95 if you check this out branch run it as MODE=debug ../path/to/repo/pants, does it fix your cases too? I only tested a single rule in my case.

Edit: It looks like this broke a single test, but the original nested chain seems odd to me -- where it previously showed just a "raise from" pointing at a yield (?) it now shows the full proper callstack. So now we have an extraneous "original error" at the top that ends at the rule edge. I think this is still an improvement over #20460, but if we can figure out where that original chained exception is added it'd be great.

EEdit: The reason it looks like this is that we throw when we handle the error on the Rust side. Unfortunately, at the point where we throw we can't tell whether we're in the middle of handling a raised error from Python or a new one. So the below reads:

  • Rust received an error from a rule invocation,
  • And re-raised a new error with the full stack trace,
  • And that was then re-raised

Since this chaining doesn't seem to show up in most actual usage I'm opting to leave this as is/future work.

image

Fixes #20460. Caused by PyO3/pyo3#3327.

Nothing in the [changelog](https://pyo3.rs/v0.20.0/changelog.html)
stands out to me as a super-immediate need so doing the minimal upgrade.
@tgolsson tgolsson added this to the 2.19.x milestone Feb 12, 2024
@tgolsson tgolsson added the category:bugfix Bug fixes for released features label Feb 12, 2024
@tgolsson tgolsson requested a review from huonw February 12, 2024 14:27
@tgolsson tgolsson merged commit 3626c19 into 2.19.x Feb 12, 2024
24 checks passed
@tgolsson tgolsson deleted the cherry-pick-20517-to-2.19.x branch February 12, 2024 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:bugfix Bug fixes for released features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants