feat: compile-time feature-gated Rust backtrace for JNI error diagnostics#6365
Open
summaryzb wants to merge 1 commit intolance-format:mainfrom
Open
feat: compile-time feature-gated Rust backtrace for JNI error diagnostics#6365summaryzb wants to merge 1 commit intolance-format:mainfrom
summaryzb wants to merge 1 commit intolance-format:mainfrom
Conversation
Contributor
|
ACTION NEEDED The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification. For details on the error please inspect the "PR Title Check" action. |
Author
|
@hamersaw PTAL |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No regression for release builds, Python layer also can reuse this mechanism
The overall design employs a two-tiered strategy of "compile-time switching + runtime gating":
Compile-time switching: Two versions of the
MaybeBacktracetype are defined through conditional compilation using#[cfg(feature = "backtrace")], when the feature is disabled error size, layout, and runtime behavior are unchanged as beforeRuntime Gating: With the
backtracefeature enabled, actual backtrace capture is still controlled by the runtime environment variableRUST_BACKTRACE=1Java integration: The transformation logic calls
err.backtrace()to obtain an optional backtrace. If exists, it is passed to the corresponding Java exception class. Users can enable this feature during Maven builds using-Drust.features=backtrace.