Skip to content

Commit 19f2aea

Browse files
authored
doc(Godot): Update "Readable Stack Traces" guide (#15005)
1 parent b0068ca commit 19f2aea

File tree

1 file changed

+66
-12
lines changed

1 file changed

+66
-12
lines changed

docs/platforms/godot/configuration/stack-traces.mdx

Lines changed: 66 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Debug information files allow Sentry to extract stack traces and provide additio
1111

1212
To get debug information, we need to compile export templates with debug symbols produced. You'll need Git, SCons build tool, Python, and a C++ compiler for your target platform installed.
1313

14+
For Android, you'll also need the Android SDK (command-line tools are enough). On macOS, don't use the Android SDK provided by Homebrew as it will not be installed in a unified location.
15+
1416
Ensure you have a compatible C++ compiler. On Windows, for instance, you can use [Visual Studio Community 2022](https://visualstudio.microsoft.com/) with the C++ workload installed, GCC on Linux and Clang on macOS.
1517

1618
Here are a few ways to install the **SCons** build tool:
@@ -45,7 +47,7 @@ For compiling on macOS you also need to install [Vulkan SDK](https://sdk.lunarg.
4547

4648
<Alert>
4749

48-
For more information, refer to [Building from Source](https://docs.godotengine.org/en/stable/contributing/development/compiling/index.html) in the official Godot documentation. It provides detailed instructions for compiling Godot on different platforms and with different tools. This guide offers streamlined instructions tailored for our use case, and may omit some details you require.
50+
For more information, refer to [Building from Source](https://docs.godotengine.org/en/stable/engine_details/development/compiling/index.html) in the official Godot documentation. It provides detailed instructions for compiling Godot on different platforms and with different tools. This guide offers streamlined instructions tailored for our use case, and may omit some details you require.
4951

5052
</Alert>
5153

@@ -55,20 +57,38 @@ Start in a terminal with Git available. Clone Godot Engine repository and switch
5557
```bash
5658
git clone https://github.com/godotengine/godot
5759
cd godot
58-
git checkout 4.4-stable
60+
git checkout 4.5-stable
5961
```
6062

63+
<Expandable title="Additional Setup for Android">
64+
65+
For Android compilation, Godot requires the Swappy frame pacing library. Download the pre-built library from [https://github.com/godotengine/godot-swappy/releases](https://github.com/godotengine/godot-swappy/releases) and extract the archive contents to the `thirdparty/swappy-frame-pacing/` directory within your cloned Godot source tree.
66+
67+
</Expandable>
68+
6169
## Compiling Templates
6270

63-
To compile the Godot release export template with debug symbols, run the following command:
71+
To compile the Godot export templates with debug symbols, run the following commands:
6472

6573
```bash {tabTitle:Windows/Linux}
6674
scons target=template_release production=yes debug_symbols=yes separate_debug_symbols=yes
6775
```
6876

6977
```bash {tabTitle:macOS}
70-
scons target=template_release arch=x86_64 production=yes debug_symbols=yes separate_debug_symbols=yes platform=macos
71-
scons target=template_release arch=arm64 generate_bundle=yes production=yes debug_symbols=yes separate_debug_symbols=yes platform=macos
78+
scons target=template_release platform=macos arch=x86_64 production=yes debug_symbols=yes separate_debug_symbols=yes
79+
scons target=template_release platform=macos arch=arm64 production=yes debug_symbols=yes separate_debug_symbols=yes generate_bundle=yes
80+
```
81+
82+
```bash {tabTitle:iOS}
83+
scons target=template_debug platform=ios production=yes debug_symbols=yes separate_debug_symbols=yes
84+
scons target=template_release platform=ios production=yes debug_symbols=yes separate_debug_symbols=yes generate_bundle=yes
85+
```
86+
87+
```bash {tabTitle:Android}
88+
scons target=template_debug platform=android arch=arm32 production=yes debug_symbols=yes separate_debug_symbols=yes
89+
scons target=template_debug platform=android arch=arm64 production=yes debug_symbols=yes separate_debug_symbols=yes
90+
scons target=template_release platform=android arch=arm32 production=yes debug_symbols=yes separate_debug_symbols=yes
91+
scons target=template_release platform=android arch=arm64 production=yes debug_symbols=yes separate_debug_symbols=yes generate_android_binaries=yes
7292
```
7393

7494
<Expandable title="Options explained">
@@ -78,13 +98,22 @@ scons target=template_release arch=arm64 generate_bundle=yes production=yes debu
7898
- `production`: set build defaults for production use
7999
- `debug_symbols`: include debugging symbols in the build
80100
- `separate_debug_symbols`: extract symbols into a separate file
81-
- `generate_bundle`: generate an APP bundle `godot_macos.zip` after building macOS binaries
101+
- `generate_bundle`: generate application bundle archive (`godot_macos.zip` for macOS or `godot_ios.zip` for iOS)
102+
- `generate_android_binaries`: generate Android template AARs and Gradle template project after build is complete (`android_source.zip`)
82103

83104
For more information, run: `scons --help`
84105

85106
</Expandable>
86107

87-
If all goes well, the export template files should appear as the result of the build process in the `bin/` directory inside the Godot source tree. When using MSVC on Windows, you will find `.exe` files alongside `.pdb` files, which contain debug information. On macOS, you will find `godot_macos.zip` containing a universal binary supporting both x86_64 and ARM64 architectures and also two folders ending with `.dSYM` containing debug information bundles for each architecture.
108+
After a successful build, the export template files will be generated in the `bin/` directory within the Godot source tree:
109+
110+
**Windows (MSVC):** You'll find `.exe` executable files alongside corresponding `.pdb` files containing the debug information.
111+
112+
**macOS:** The build generates `godot_macos.zip` containing a universal binary that supports both x86_64 and ARM64 architectures. Additionally, you'll see two separate `.dSYM` folders (debug symbol bundles) for each architecture.
113+
114+
**iOS:** The build generates `godot_ios.zip` containing universal frameworks with static libraries and Xcode project files for both release and debug export configurations.
115+
116+
**Android:** The build produces `android_source.zip`, which contains the Gradle build template with the compiled export template libraries. Additionally, the build generates `android-template-release-native-symbols.zip` and `android-template-debug-native-symbols.zip` archives containing the corresponding debug symbols for each template variant.
88117

89118
<Alert>
90119

@@ -94,13 +123,32 @@ Learn more about debug formats in [Debug Information Files](/platforms/native/da
94123

95124
## Exporting Project
96125

97-
Now you can export your project using your custom template. In the Godot **Export** dialog window, follow these steps:
126+
With your custom templates compiled, you can now export your project with debug symbols. Open the Godot **Export** dialog and configure it as follows:
127+
128+
1. Select or add an export preset for your target platform.
129+
130+
2. Enable **Advanced Options** in the top-right corner of the dialog.
131+
132+
3. Configure the custom template in the **Options** tab:
133+
134+
**For Windows/Linux:**
135+
- Find the **Custom Template** section
136+
- Under **Release**, browse and select your compiled template executable from the `bin/` directory
137+
138+
**For macOS**
139+
- Find the **Custom Template** section
140+
- Under **Release**, browse and select `godot_macos.zip` bundle from the `bin/` directory
98141

99-
1. Select or add an export preset.
100-
2. Enable the **Advanced Options** toggle.
101-
3. In the **Options** tab, under **Custom Template -> Release**, assign your custom template executable file.
142+
**For iOS:**
143+
- Find the **Custom Template** section
144+
- Under both **Release** and **Debug**, browse and select the same `godot_ios.zip` bundle from the `bin/` directory
102145

103-
This will configure your project to use the custom export template with the debug symbols you compiled earlier.
146+
**For Android:**
147+
- Enable **Gradle Build** in the **Gradle** section
148+
- Set **Android Source Template** to point to the `android_source.zip` file generated during compilation
149+
- Install the Android build template by navigating to **Project > Install Android Build Template...** in the editor menu
150+
151+
Once configured, your export preset will use the custom template containing the debug information needed for readable stack traces in Sentry.
104152

105153
![Export Dialog](./imgs/godot_export_dialog.png)
106154

@@ -158,6 +206,12 @@ sentry-cli debug-files upload --include-sources --org ___ORG_SLUG___ --project _
158206

159207
This uploads debug information files from the `bin` directory to Sentry, creating the source bundles on the fly.
160208

209+
<Alert title="Important note for iOS">
210+
211+
For iOS projects, you must export your project to a directory first, then run the `sentry-cli debug-files upload` command on that exported directory rather than the `bin/` directory. This is necessary because Godot uses an Xcode project with static libraries for iOS exports, and the debug symbols are only available after the export compilation process is complete.
212+
213+
</Alert>
214+
161215
<Expandable title="Generating source bundle archives separately">
162216

163217
You can also create the source bundles separately from the upload step by running:

0 commit comments

Comments
 (0)