Skip to content

Commit

Permalink
Merge branch 'main' into feat/linux-arm-64
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/ci.yml
  • Loading branch information
tustanivsky committed Oct 31, 2024
2 parents 761a7ea + 9f6b1e8 commit 49a45bc
Show file tree
Hide file tree
Showing 17 changed files with 231 additions and 40 deletions.
38 changes: 17 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ jobs:

test:
name: Test UE ${{ matrix.unreal }}
runs-on: ubuntu-latest
runs-on: ubuntu-latest-4-cores

strategy:
fail-fast: false
Expand Down Expand Up @@ -190,8 +190,6 @@ jobs:
--network ip6net -p 80:80 \
ghcr.io/epicgames/unreal-engine:dev-slim-${{ matrix.unreal }}.1
docker logout ghcr.io
# Add the user so it has a home directory (needed for the pip cache later on)
docker exec --user root unreal useradd -u $uid -g $gid --create-home $user
# Ensure CA certs are in the right directory (needed for running tests)
docker exec --user root unreal bash -c "
mkdir -p /etc/pki/tls/certs ;
Expand All @@ -202,12 +200,6 @@ jobs:
chown -R $uid /home/ue4/UnrealEngine/Engine/Binaries/ThirdParty/Mono/Linux ;
chown -R $uid /home/ue4/UnrealEngine/Engine/Binaries/ThirdParty/DotNet "
- name: Setup UE CLI
run: docker exec unreal bash -c '
pip3 install --upgrade pip ;
pip3 install -Iv ue4cli==0.0.54 ;
ue4 setroot /home/ue4/UnrealEngine '

- name: Setup C++ runtime
run: docker exec --user root unreal bash -c '
apt-get update ;
Expand All @@ -232,16 +224,28 @@ jobs:
- name: Run tests
id: run-tests
run: |
docker exec -w /workspace/checkout/${{ matrix.app }} unreal ue4 build
docker exec -w /workspace/checkout/${{ matrix.app }} unreal ue4 editor \
docker exec -w /workspace/checkout/${{ matrix.app }} unreal /home/ue4/UnrealEngine/Engine/Build/BatchFiles/RunUAT.sh BuildCookRun \
-project=/workspace/checkout/${{ matrix.app }}/SentryPlayground.uproject \
-archivedirectory=/workspace/checkout/${{ matrix.app }}/Builds \
-platform=Linux \
-nop4 \
-cook \
-build \
-stage \
-prereqss \
-package \
-archive
docker exec -w /workspace/checkout/${{ matrix.app }} unreal bash -c "
cp -r '/home/ue4/Library/Logs/Unreal Engine/LocalBuildLogs' Saved/Logs "
docker exec -w /workspace/checkout/${{ matrix.app }} unreal /home/ue4/UnrealEngine/Engine/Binaries/Linux/UnrealEditor \
/workspace/checkout/${{ matrix.app }}/SentryPlayground.uproject \
-ReportExportPath=/workspace/checkout/${{ matrix.app }}/Saved/Automation \
-ExecCmds="Automation RunTests Sentry;quit" \
-TestExit="Automation Test Queue Empty" \
-Unattended \
-NoPause \
-NoSplash \
-NullRHI
-NullRHI
- name: Collect ${{ matrix.app }} test info
if: ${{ always() && steps.run-tests.outcome == 'failure' }}
Expand All @@ -251,16 +255,8 @@ jobs:
path: |
checkout/${{ matrix.app }}/Saved/Automation
- name: Build & package ${{ matrix.app }}
# Unreal 5.0 takes ~1 hour to build+package the app so only do it on v4.27
if: ${{ matrix.unreal == '4.27'}}
id: package-app
run: |
docker exec -w /workspace/checkout/${{ matrix.app }} unreal ue4 package
docker exec -w /workspace/checkout/${{ matrix.app }} unreal cp -r '/home/gh/Library/Logs/Unreal Engine/LocalBuildLogs' Saved/Logs
- name: Collect ${{ matrix.app }} build info
if: contains(fromJson('["success", "failure"]'), steps.package-app.outcome)
if: contains(fromJson('["success", "failure"]'), steps.run-tests.outcome)
uses: actions/upload-artifact@v4
with:
name: UE ${{ matrix.unreal }} ${{ matrix.app }} build logs
Expand Down
16 changes: 13 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@

## Unreleased

### Features

- Assertions now print their callstack a log file ([#637](https://github.com/getsentry/sentry-unreal/pull/637))

### Dependencies

- Bump CLI from v2.37.0 to v2.38.0 ([#663](https://github.com/getsentry/sentry-unreal/pull/663))
- [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2380)
- [diff](https://github.com/getsentry/sentry-cli/compare/2.37.0...2.38.0)
- Bump CLI from v2.37.0 to v2.38.1 ([#663](https://github.com/getsentry/sentry-unreal/pull/663), [#670](https://github.com/getsentry/sentry-unreal/pull/670))
- [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2381)
- [diff](https://github.com/getsentry/sentry-cli/compare/2.37.0...2.38.1)
- Bump Java SDK (Android) from v7.15.0 to v7.16.0 ([#665](https://github.com/getsentry/sentry-unreal/pull/665))
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#7160)
- [diff](https://github.com/getsentry/sentry-java/compare/7.15.0...7.16.0)
- Bump Cocoa SDK (iOS) from v8.38.0 to v8.39.0 ([#668](https://github.com/getsentry/sentry-unreal/pull/668))
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8390)
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.38.0...8.39.0)

## 0.20.1

Expand Down
2 changes: 1 addition & 1 deletion modules/sentry-cocoa
Submodule sentry-cocoa updated 171 files
2 changes: 1 addition & 1 deletion modules/sentry-java
Submodule sentry-java updated 91 files
+12 −0 .github/file-filters.yml
+2 −2 .github/workflows/agp-matrix.yml
+2 −2 .github/workflows/build.yml
+49 −0 .github/workflows/changes-in-high-risk-code.yml
+3 −3 .github/workflows/codeql-analysis.yml
+1 −1 .github/workflows/enforce-license-compliance.yml
+2 −2 .github/workflows/generate-javadocs.yml
+2 −2 .github/workflows/integration-tests-benchmarks.yml
+106 −0 .github/workflows/integration-tests-ui-critical.yml
+1 −1 .github/workflows/integration-tests-ui.yml
+1 −1 .github/workflows/release-build.yml
+31 −4 .github/workflows/system-tests-backend.yml
+38 −0 CHANGELOG.md
+9 −1 Makefile
+1 −0 build.gradle.kts
+4 −1 gradle.properties
+35 −0 scripts/test-ui-critical.sh
+1 −1 sentry-android-core/src/main/java/io/sentry/android/core/ActivityBreadcrumbsIntegration.java
+1 −1 sentry-android-core/src/main/java/io/sentry/android/core/ActivityLifecycleIntegration.java
+10 −2 sentry-android-core/src/main/java/io/sentry/android/core/AndroidLogger.java
+1 −1 sentry-android-core/src/main/java/io/sentry/android/core/AnrIntegration.java
+4 −4 sentry-android-core/src/main/java/io/sentry/android/core/AnrV2EventProcessor.java
+1 −1 sentry-android-core/src/main/java/io/sentry/android/core/AnrV2Integration.java
+1 −1 sentry-android-core/src/main/java/io/sentry/android/core/AppComponentsBreadcrumbsIntegration.java
+1 −1 sentry-android-core/src/main/java/io/sentry/android/core/AppLifecycleIntegration.java
+13 −11 sentry-android-core/src/main/java/io/sentry/android/core/ManifestMetadataReader.java
+1 −1 sentry-android-core/src/main/java/io/sentry/android/core/NdkIntegration.java
+1 −1 sentry-android-core/src/main/java/io/sentry/android/core/NetworkBreadcrumbsIntegration.java
+1 −1 sentry-android-core/src/main/java/io/sentry/android/core/PhoneStateBreadcrumbsIntegration.java
+1 −1 sentry-android-core/src/main/java/io/sentry/android/core/ScreenshotEventProcessor.java
+3 −0 sentry-android-core/src/main/java/io/sentry/android/core/SendCachedEnvelopeIntegration.java
+1 −1 sentry-android-core/src/main/java/io/sentry/android/core/SystemEventsBreadcrumbsIntegration.java
+1 −1 sentry-android-core/src/main/java/io/sentry/android/core/TempSensorBreadcrumbsIntegration.java
+1 −1 sentry-android-core/src/main/java/io/sentry/android/core/UserInteractionIntegration.java
+1 −1 sentry-android-core/src/main/java/io/sentry/android/core/ViewHierarchyEventProcessor.java
+11 −0 sentry-android-core/src/test/java/io/sentry/android/core/AndroidTransactionProfilerTest.kt
+25 −0 sentry-android-core/src/test/java/io/sentry/android/core/ManifestMetadataReaderTest.kt
+5 −1 sentry-android-core/src/test/java/io/sentry/android/core/SentryAndroidTest.kt
+5 −0 sentry-android-fragment/api/sentry-android-fragment.api
+3 −3 sentry-android-fragment/src/main/java/io/sentry/android/fragment/FragmentLifecycleIntegration.kt
+17 −1 sentry-android-fragment/src/main/java/io/sentry/android/fragment/FragmentLifecycleState.kt
+2 −2 sentry-android-fragment/src/main/java/io/sentry/android/fragment/SentryFragmentLifecycleCallbacks.kt
+11 −0 sentry-android-fragment/src/test/java/io/sentry/android/fragment/FragmentLifecycleStateTest.kt
+1 −1 sentry-android-fragment/src/test/java/io/sentry/android/fragment/SentryFragmentLifecycleCallbacksTest.kt
+2 −0 sentry-android-integration-tests/sentry-uitest-android-critical/.gitignore
+69 −0 sentry-android-integration-tests/sentry-uitest-android-critical/build.gradle.kts
+11 −0 sentry-android-integration-tests/sentry-uitest-android-critical/maestro/corruptEnvelope.yaml
+6 −0 sentry-android-integration-tests/sentry-uitest-android-critical/maestro/crash.yaml
+21 −0 sentry-android-integration-tests/sentry-uitest-android-critical/proguard-rules.pro
+21 −0 sentry-android-integration-tests/sentry-uitest-android-critical/src/main/AndroidManifest.xml
+51 −0 ...ration-tests/sentry-uitest-android-critical/src/main/java/io/sentry/uitest/android/critical/MainActivity.kt
+1 −1 sentry-android-navigation/src/main/java/io/sentry/android/navigation/SentryNavigationListener.kt
+1 −1 sentry-android-ndk/build.gradle.kts
+44 −26 sentry-android-ndk/src/main/java/io/sentry/android/ndk/NdkScopeObserver.java
+50 −15 sentry-android-ndk/src/main/java/io/sentry/android/ndk/SentryNdk.java
+38 −0 sentry-android-ndk/src/test/java/io/sentry/android/ndk/NdkScopeObserverTest.kt
+1 −1 sentry-android-okhttp/src/main/java/io/sentry/android/okhttp/SentryOkHttpInterceptor.kt
+8 −8 sentry-android-replay/src/main/java/io/sentry/android/replay/DefaultReplayBreadcrumbConverter.kt
+3 −3 sentry-android-replay/src/main/java/io/sentry/android/replay/ReplayIntegration.kt
+14 −9 sentry-android-replay/src/main/java/io/sentry/android/replay/ScreenshotRecorder.kt
+0 −4 sentry-android-replay/src/main/java/io/sentry/android/replay/capture/BaseCaptureStrategy.kt
+2 −2 sentry-android-replay/src/main/java/io/sentry/android/replay/capture/BufferCaptureStrategy.kt
+2 −2 sentry-android-replay/src/main/java/io/sentry/android/replay/util/Sampling.kt
+8 −8 sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ComposeViewHierarchyNode.kt
+2 −2 sentry-android-replay/src/main/java/io/sentry/android/replay/viewhierarchy/ViewHierarchyNode.kt
+2 −2 sentry-android-replay/src/test/java/io/sentry/android/replay/capture/BufferCaptureStrategyTest.kt
+1 −1 sentry-android-timber/src/main/java/io/sentry/android/timber/SentryTimberIntegration.kt
+1 −1 sentry-apollo/src/main/java/io/sentry/apollo/SentryApolloInterceptor.kt
+2 −2 sentry-okhttp/src/main/java/io/sentry/okhttp/SentryOkHttpInterceptor.kt
+14 −1 sentry/api/sentry.api
+3 −3 sentry/src/main/java/io/sentry/Baggage.java
+1 −1 sentry/src/main/java/io/sentry/DsnUtil.java
+1 −1 sentry/src/main/java/io/sentry/ProfilingTraceData.java
+1 −1 sentry/src/main/java/io/sentry/ProfilingTransactionData.java
+1 −1 sentry/src/main/java/io/sentry/RequestDetailsResolver.java
+1 −1 sentry/src/main/java/io/sentry/SendCachedEnvelopeFireAndForgetIntegration.java
+18 −2 sentry/src/main/java/io/sentry/Sentry.java
+3 −3 sentry/src/main/java/io/sentry/SentryClient.java
+35 −2 sentry/src/main/java/io/sentry/SentryOptions.java
+1 −1 sentry/src/main/java/io/sentry/ShutdownHookIntegration.java
+5 −4 sentry/src/main/java/io/sentry/TracesSampler.java
+1 −1 sentry/src/main/java/io/sentry/UncaughtExceptionHandlerIntegration.java
+6 −0 sentry/src/main/java/io/sentry/cache/PersistingScopeObserver.java
+2 −2 sentry/src/main/java/io/sentry/metrics/MetricsHelper.java
+0 −10 sentry/src/main/java/io/sentry/util/IntegrationUtils.java
+12 −1 sentry/src/main/java/io/sentry/util/LazyEvaluator.java
+466 −0 sentry/src/main/java/io/sentry/util/Random.java
+2 −2 sentry/src/test/java/io/sentry/JsonSerializerTest.kt
+2 −2 sentry/src/test/java/io/sentry/TracesSamplerTest.kt
+14 −0 sentry/src/test/java/io/sentry/util/LazyEvaluatorTest.kt
+1 −0 settings.gradle.kts
10 changes: 9 additions & 1 deletion plugin-dev/Source/Sentry/Private/Apple/SentrySubsystemApple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "GenericPlatform/GenericPlatformOutputDevices.h"
#include "HAL/FileManager.h"
#include "UObject/GarbageCollection.h"
#include "Utils/SentryLogUtils.h"

void SentrySubsystemApple::InitWithSettings(const USentrySettings* settings, USentryBeforeSendHandler* beforeSendHandler, USentryTraceSampler* traceSampler)
{
Expand Down Expand Up @@ -205,12 +206,19 @@ USentryId* SentrySubsystemApple::CaptureAssertion(const FString& type, const FSt
#elif PLATFORM_IOS
int32 framesToSkip = 5;
#endif

SentryLogUtils::LogStackTrace(*message, ELogVerbosity::Error, framesToSkip);

return CaptureException(type, message, framesToSkip);
}

USentryId* SentrySubsystemApple::CaptureEnsure(const FString& type, const FString& message)
{
return CaptureException(type, message, 6);
int32 framesToSkip = 6;

SentryLogUtils::LogStackTrace(*message, ELogVerbosity::Error, framesToSkip);

return CaptureException(type, message, framesToSkip);
}

void SentrySubsystemApple::CaptureUserFeedback(USentryUserFeedback* userFeedback)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,4 +276,54 @@ ELogVerbosity::Type SentryConvertorsDesktop::SentryLevelToLogVerbosity(sentry_le
return LogVerbosity;
}

void SentryConvertorsDesktop::SentryCrashContextToString(const sentry_ucontext_t* crashContext, TCHAR* outErrorString, int32 errorStringBufSize)
{
#if PLATFORM_WINDOWS

EXCEPTION_RECORD* ExceptionRecord = crashContext->exception_ptrs.ExceptionRecord;

FString ErrorString = TEXT("Unhandled Exception: ");

#define HANDLE_CASE(x) case x: ErrorString += TEXT(#x); break;

switch (ExceptionRecord->ExceptionCode)
{
case EXCEPTION_ACCESS_VIOLATION:
ErrorString += TEXT("EXCEPTION_ACCESS_VIOLATION ");
if (ExceptionRecord->ExceptionInformation[0] == 0)
{
ErrorString += TEXT("reading address ");
}
else if (ExceptionRecord->ExceptionInformation[0] == 1)
{
ErrorString += TEXT("writing address ");
}
ErrorString += FString::Printf(
#if PLATFORM_64BITS
TEXT("0x%016llx")
#else
TEXT("0x%08x")
#endif
, ExceptionRecord->ExceptionInformation[1]);
break;
HANDLE_CASE(EXCEPTION_ARRAY_BOUNDS_EXCEEDED)
HANDLE_CASE(EXCEPTION_DATATYPE_MISALIGNMENT)
HANDLE_CASE(EXCEPTION_FLT_DENORMAL_OPERAND)
HANDLE_CASE(EXCEPTION_FLT_DIVIDE_BY_ZERO)
HANDLE_CASE(EXCEPTION_FLT_INVALID_OPERATION)
HANDLE_CASE(EXCEPTION_ILLEGAL_INSTRUCTION)
HANDLE_CASE(EXCEPTION_INT_DIVIDE_BY_ZERO)
HANDLE_CASE(EXCEPTION_PRIV_INSTRUCTION)
HANDLE_CASE(EXCEPTION_STACK_OVERFLOW)
default:
ErrorString += FString::Printf(TEXT("0x%08x"), (uint32)ExceptionRecord->ExceptionCode);
}

FCString::Strncpy(outErrorString, *ErrorString, errorStringBufSize);

#undef HANDLE_CASE

#endif
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class SentryConvertorsDesktop
static FString SentryLevelToString(ESentryLevel level);
static TArray<uint8> SentryEnvelopeToByteArray(sentry_envelope_t* envelope);
static ELogVerbosity::Type SentryLevelToLogVerbosity(sentry_level_t level);

static void SentryCrashContextToString(const sentry_ucontext_t* crashContext, TCHAR* outErrorString, int32 errorStringBufSize);
};

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "SentryTransactionContext.h"
#include "SentryUserFeedbackDesktop.h"

#include "Utils/SentryLogUtils.h"
#include "Utils/SentryScreenshotUtils.h"

#include "Infrastructure/SentryConvertorsDesktop.h"
Expand All @@ -32,10 +33,12 @@

#include "Misc/Paths.h"
#include "Misc/ScopeLock.h"
#include "Misc/CoreDelegates.h"
#include "HAL/FileManager.h"
#include "Runtime/Launch/Resources/Version.h"
#include "GenericPlatform/GenericPlatformOutputDevices.h"
#include "GenericPlatform/GenericPlatformCrashContext.h"
#include "HAL/ExceptionHandling.h"
#include "UObject/GarbageCollection.h"
#include "UObject/UObjectThreadContext.h"

Expand Down Expand Up @@ -69,6 +72,36 @@ void PrintVerboseLog(sentry_level_t level, const char *message, va_list args, vo
GLog->CategorizedLogf(SentryCategoryName, SentryConvertorsDesktop::SentryLevelToLogVerbosity(level), TEXT("%s"), *MessageBuf);
}

void PrintCrashLog(const sentry_ucontext_t *uctx)
{
#if PLATFORM_WINDOWS

SentryConvertorsDesktop::SentryCrashContextToString(uctx, GErrorExceptionDescription, UE_ARRAY_COUNT(GErrorExceptionDescription));

const SIZE_T StackTraceSize = 65535;
ANSICHAR* StackTrace = (ANSICHAR*)GMalloc->Malloc(StackTraceSize);
StackTrace[0] = 0;

// Currently raw crash data stored in `uctx` can be utilized for stalk walking on Windows only
void* ProgramCounter = uctx->exception_ptrs.ExceptionRecord->ExceptionAddress;

FPlatformStackWalk::StackWalkAndDump(StackTrace, StackTraceSize, ProgramCounter);

FCString::Strncat(GErrorHist, GErrorExceptionDescription, UE_ARRAY_COUNT(GErrorHist));
FCString::Strncat(GErrorHist, TEXT("\r\n\r\n"), UE_ARRAY_COUNT(GErrorHist));
FCString::Strncat(GErrorHist, ANSI_TO_TCHAR(StackTrace), UE_ARRAY_COUNT(GErrorHist));

#if !NO_LOGGING
FDebug::LogFormattedMessageWithCallstack(LogSentrySdk.GetCategoryName(), __FILE__, __LINE__, TEXT("=== Critical error: ==="), GErrorHist, ELogVerbosity::Error);
#endif

GLog->Panic();

GMalloc->Free(StackTrace);

#endif
}

sentry_value_t HandleBeforeSend(sentry_value_t event, void *hint, void *closure)
{
SentrySubsystemDesktop* SentrySubsystem = static_cast<SentrySubsystemDesktop*>(closure);
Expand All @@ -94,6 +127,12 @@ sentry_value_t HandleBeforeSend(sentry_value_t event, void *hint, void *closure)

sentry_value_t HandleBeforeCrash(const sentry_ucontext_t *uctx, sentry_value_t event, void *closure)
{
#if PLATFORM_WINDOWS
// Ensures that error message and corresponding callstack flushed to a log file (if available)
// before it's attached to the captured crash event and uploaded to Sentry.
PrintCrashLog(uctx);
#endif

SentrySubsystemDesktop* SentrySubsystem = static_cast<SentrySubsystemDesktop*>(closure);
SentrySubsystem->TryCaptureScreenshot();

Expand Down Expand Up @@ -395,7 +434,15 @@ USentryId* SentrySubsystemDesktop::CaptureException(const FString& type, const F

USentryId* SentrySubsystemDesktop::CaptureAssertion(const FString& type, const FString& message)
{
return CaptureException(type, message, 7);
#if PLATFORM_WINDOWS
int32 framesToSkip = 7;
#else
int32 framesToSkip = 5;
#endif

SentryLogUtils::LogStackTrace(*message, ELogVerbosity::Error, framesToSkip);

return CaptureException(type, message, framesToSkip);
}

USentryId* SentrySubsystemDesktop::CaptureEnsure(const FString& type, const FString& message)
Expand Down
2 changes: 1 addition & 1 deletion plugin-dev/Source/Sentry/Private/SentryOutputDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
void FSentryOutputDevice::Serialize(const TCHAR* V, ELogVerbosity::Type Verbosity, const FName& Category)
{
const FString Message = FString(V).TrimStartAndEnd();
if (Message.IsEmpty())
if (Message.IsEmpty() || Message.StartsWith(TEXT("[Callstack]")))
{
return;
}
Expand Down
1 change: 1 addition & 0 deletions plugin-dev/Source/Sentry/Private/SentrySubsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "Misc/EngineVersion.h"
#include "Misc/CoreDelegates.h"
#include "Misc/App.h"
#include "Misc/AssertionMacros.h"
#include "GenericPlatform/GenericPlatformDriver.h"
#include "GenericPlatform/GenericPlatformMisc.h"

Expand Down
27 changes: 27 additions & 0 deletions plugin-dev/Source/Sentry/Private/Utils/SentryLogUtils.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright (c) 2024 Sentry. All Rights Reserved.

#include "SentryLogUtils.h"

#include "CoreGlobals.h"
#include "GenericPlatform/GenericPlatformStackWalk.h"
#include "HAL/UnrealMemory.h"
#include "Misc/OutputDeviceRedirector.h"

void SentryLogUtils::LogStackTrace(const TCHAR* Heading, const ELogVerbosity::Type LogVerbosity, int FramesToSkip)
{
#if !NO_LOGGING
const SIZE_T StackTraceSize = 65535;
ANSICHAR* StackTrace = (ANSICHAR*)FMemory::SystemMalloc(StackTraceSize);

{
StackTrace[0] = 0;
FGenericPlatformStackWalk::StackWalkAndDumpEx(StackTrace, StackTraceSize, FramesToSkip + 1, FGenericPlatformStackWalk::EStackWalkFlags::AccurateStackWalk);
}

FDebug::LogFormattedMessageWithCallstack(LogOutputDevice.GetCategoryName(), __FILE__, __LINE__, Heading, ANSI_TO_TCHAR(StackTrace), LogVerbosity);

GLog->Flush();

FMemory::SystemFree(StackTrace);
#endif
}
12 changes: 12 additions & 0 deletions plugin-dev/Source/Sentry/Private/Utils/SentryLogUtils.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright (c) 2024 Sentry. All Rights Reserved.

#pragma once

#include "CoreTypes.h"
#include "Logging/LogVerbosity.h"

class SentryLogUtils
{
public:
static void LogStackTrace(const TCHAR* Heading, const ELogVerbosity::Type LogVerbosity, int FramesToSkip);
};
2 changes: 1 addition & 1 deletion plugin-dev/sentry-cli.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=2.38.0
version=2.38.1
repo=https://github.com/getsentry/sentry-cli
23 changes: 21 additions & 2 deletions scripts/build-ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,28 @@ export sentryArtifactsDestination=$2

rm -rf "${sentryArtifactsDestination}/"*

carthage build --project-directory "${sentryIosRoot}" --use-xcframeworks --no-skip-current --platform iOS
pushd "${sentryIosRoot}"

cp -R "${sentryIosRoot}/Carthage/Build/Sentry.xcframework/ios-arm64_arm64e/Sentry.framework" "${sentryArtifactsDestination}/Sentry.framework"
xcodebuild archive \
-project Sentry.xcodeproj/ \
-scheme "Sentry" \
-configuration "Release" \
-sdk "iphoneos" \
-archivePath "./Carthage/archive/Sentry/iphoneos.xcarchive" \
CODE_SIGNING_REQUIRED=NO \
SKIP_INSTALL=NO \
CODE_SIGN_IDENTITY= \
CARTHAGE=YES \
MACH_O_TYPE="mh_dylib" \
ENABLE_CODE_COVERAGE=NO \
GCC_GENERATE_DEBUGGING_SYMBOLS="YES" \
OTHER_LDFLAGS="-Wl,-make_mergeable"

xcodebuild -create-xcframework -framework Carthage/archive/Sentry/iphoneos.xcarchive/Products/Library/Frameworks/Sentry.framework -output Carthage/Sentry.xcframework

popd

cp -R "${sentryIosRoot}/Carthage/Sentry.xcframework/ios-arm64_arm64e/Sentry.framework" "${sentryArtifactsDestination}/Sentry.framework"

mkdir "Sentry.embeddedframework"

Expand Down
Loading

0 comments on commit 49a45bc

Please sign in to comment.