Skip to content

Commit 0d3fae1

Browse files
committed
Fix native backend configuration issues
- Fix INI setting placement in CI workflows to ensure UseNativeBackend=True is inserted under the correct [/Script/Sentry.SentrySettings] section instead of being appended at the end of the file - Add guard to prevent calling crashpad-specific API when native backend is active in Windows platform code
1 parent d9c6d6f commit 0d3fae1

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

.github/workflows/test-linux.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,7 @@ jobs:
203203
- name: Enable native backend
204204
if: ${{ success() && steps.run-tests.outcome == 'success' }}
205205
run: |
206-
echo "" >> checkout/sample/Config/DefaultEngine.ini
207-
echo "UseNativeBackend=True" >> checkout/sample/Config/DefaultEngine.ini
206+
sed -i '/^\[\/Script\/Sentry\.SentrySettings\]/a UseNativeBackend=True' checkout/sample/Config/DefaultEngine.ini
208207
209208
- name: Build and test (Native)
210209
id: run-tests-native

.github/workflows/test-windows.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,10 @@ jobs:
139139
- name: Enable native backend
140140
if: ${{ success() && steps.run-tests.outcome == 'success' }}
141141
run: |
142-
Add-Content -Path "checkout/sample/Config/DefaultEngine.ini" -Value "`nUseNativeBackend=True"
142+
$content = Get-Content -Path "checkout/sample/Config/DefaultEngine.ini"
143+
$index = ($content | Select-String -Pattern '^\[/Script/Sentry\.SentrySettings\]').LineNumber
144+
$content = $content[0..($index-1)] + "UseNativeBackend=True" + $content[$index..($content.Length-1)]
145+
$content | Set-Content -Path "checkout/sample/Config/DefaultEngine.ini"
143146
144147
- name: Build and test (Native)
145148
id: run-tests-native

plugin-dev/Source/Sentry/Private/Windows/WindowsSentrySubsystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void FWindowsSentrySubsystem::ConfigureHandlerPath(sentry_options_t* Options)
100100

101101
void FWindowsSentrySubsystem::ConfigureStackCaptureStrategy(sentry_options_t* Options)
102102
{
103-
if (WineProtonInfo.bIsRunningUnderWine)
103+
if (WineProtonInfo.bIsRunningUnderWine && !bUseNativeBackend)
104104
{
105105
UE_LOG(LogSentrySdk, Log, TEXT("Enabling Crashpad stack capture adjustment for Wine/Proton compatibility"));
106106
sentry_options_set_crashpad_limit_stack_capture_to_sp(Options, 1);

0 commit comments

Comments
 (0)