-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(rust): document how to set up source context #13151
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
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| --- | ||
| title: Source Context | ||
| sidebar_order: 2400 | ||
| description: "Learn about showing your source code as part of stack traces." | ||
| --- | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| [Install](/cli/installation/) and [Configure](/cli/configuration/) Sentry CLI by providing an auth token, org and project. | ||
|
|
||
| Then, enable full debug information for your release build: | ||
| ```toml {filename:Cargo.toml} | ||
| [profiles.release] | ||
| debug = true | ||
| ``` | ||
|
|
||
| We will strip the binary, extract the necessary debug information and upload it to Sentry along with the source code. | ||
|
|
||
| ## Upload debug information files and source code | ||
|
|
||
| Build the release binary, strip and extract debug information: | ||
| ```bash | ||
| cargo build --release | ||
| objcopy --only-keep-debug target/release/app{,.d} | ||
| objcopy --strip-debug --strip-unneeded target/release/app | ||
| objcopy --add-gnu-debuglink target/release/app{.d,} | ||
| zip app-debug.zip target/release/app.d | ||
| ``` | ||
|
|
||
| Use Sentry CLI to create a source bundle: | ||
|
|
||
| ```bash | ||
| sentry-cli difutil bundle-sources target/release/app.d | ||
| mv target/release/app.src.zip ./app.src.zip | ||
| ``` | ||
|
|
||
| Finally, use Sentry CLI to upload both debug information files and sources to Sentry: | ||
| ```bash | ||
| sentry-cli upload-dif ./app-debug.zip ./app.src.zip | ||
| ``` | ||
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.
Uh oh!
There was an error while loading. Please reload this page.