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 #20517

Merged
merged 2 commits into from
Feb 12, 2024
Merged

Bump PyO3 to 0.20 to fix backtraces #20517

merged 2 commits into from
Feb 12, 2024

Conversation

tgolsson
Copy link
Contributor

@tgolsson tgolsson commented Feb 9, 2024

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

@tgolsson tgolsson added needs-cherrypick category:bugfix Bug fixes for released features labels Feb 9, 2024
@tgolsson tgolsson added this to the 2.19.x milestone Feb 9, 2024
@tgolsson tgolsson requested a review from huonw February 9, 2024 20:49
@tgolsson tgolsson merged commit e30da1c into main Feb 12, 2024
24 checks passed
@tgolsson tgolsson deleted the ts/pyo3-0-20 branch February 12, 2024 08:57
@WorkerPants
Copy link
Member

I tried to automatically cherry-pick this change back to each relevant milestone, so that it is available in those older releases of Pants.

❌ 2.19.x

I was unable to cherry-pick this PR to 2.19.x, likely due to merge-conflicts.

Steps to Cherry-Pick locally

To resolve:

  1. (Ensure your git working directory is clean)
  2. Run the following script to reproduce the merge-conflicts:
    git fetch https://github.com/pantsbuild/pants main \
      && git fetch https://github.com/pantsbuild/pants 2.19.x \
      && git checkout -b cherry-pick-20517-to-2.19.x FETCH_HEAD \
      && git cherry-pick e30da1ce11dfbe091e1b72772dc034d66d2b43e9
  3. Fix the merge conflicts and commit the changes
  4. Run build-support/cherry_pick/make_pr.sh "20517" "2.19.x"

Please note that I cannot re-run CI if a job fails. Please work with your PR approver(s) to re-run CI if necessary.


When you're done manually cherry-picking, please remove the needs-cherrypick label on this PR.

Thanks again for your contributions!

🤖 Beep Boop here's my run link

@WorkerPants WorkerPants added the auto-cherry-picking-failed Auto Cherry-Picking Failed label Feb 12, 2024
tgolsson added a commit that referenced this pull request Feb 12, 2024
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 added a commit that referenced this pull request Feb 12, 2024
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-cherry-picking-failed Auto Cherry-Picking Failed category:bugfix Bug fixes for released features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stack traces in union rules or anything called from a union rule are being swallowed
4 participants