Skip to content

Commit 481f369

Browse files
authored
feat(rust): document how to set up source context on macOS
1 parent 1ed2d5a commit 481f369

File tree

1 file changed

+25
-4
lines changed
  • docs/platforms/rust/common/source-context

1 file changed

+25
-4
lines changed

docs/platforms/rust/common/source-context/index.mdx

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ description: "Learn about showing your source code as part of stack traces."
88

99
[Install](/cli/installation/) and [Configure](/cli/configuration/) Sentry CLI by providing an auth token, org and project.
1010

11-
Then, enable full debug information for your release build:
11+
## Compile and create debug information files
12+
13+
### Linux
14+
15+
Enable full debug information for your release build:
1216
```toml {filename:Cargo.toml}
1317
[profiles.release]
1418
debug = true
1519
```
1620

17-
## Upload debug information files and source code
18-
1921
Build the release binary, extract debug information and strip it from the binary:
2022
```bash
2123
cargo build --release
@@ -24,10 +26,29 @@ objcopy --strip-debug --strip-unneeded target/release/app
2426
objcopy --add-gnu-debuglink target/release/app{.d,}
2527
```
2628

27-
If you don't want to strip the binary, you should disable the `debug-images` integration of the SDK, as otherwise you will run into the issue documented [here](https://github.com/getsentry/sentry-rust/issues/470#issuecomment-1472136215) which could cause duplicated frames to appear in your Sentry issues.
29+
### macOS
30+
31+
Use a profile like the following for your release builds:
32+
```toml {filename:Cargo.toml}
33+
[profile.release]
34+
debug = true
35+
split-debuginfo = "packed"
36+
strip = true
37+
```
38+
39+
Build the release binary, debug information will be available in separate files and stripped from the binary automatically:
40+
```bash
41+
cargo build --release
42+
```
43+
44+
## Upload debug information and source files
2845

2946
Use Sentry CLI to upload debug information and source files:
3047

3148
```bash
3249
sentry-cli debug-files upload --include-sources .
3350
```
51+
52+
## Troubleshooting
53+
54+
If you don't want to strip the binary, you should disable the `debug-images` integration of the SDK, as otherwise you will run into the issue documented [here](https://github.com/getsentry/sentry-rust/issues/470#issuecomment-1472136215) which could cause duplicated frames to appear in your Sentry issues.

0 commit comments

Comments
 (0)