From 6e4ee91fd538cede13e95635dd1e38c3ad0ab0ba Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 24 Oct 2024 09:25:16 +0300 Subject: [PATCH 1/5] chore: update modules/sentry-java to 7.16.0 (#665) Co-authored-by: GitHub --- CHANGELOG.md | 3 +++ modules/sentry-java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15abee9b..a3038fd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ - 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 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) ## 0.20.1 diff --git a/modules/sentry-java b/modules/sentry-java index f74af4a8..95f6443b 160000 --- a/modules/sentry-java +++ b/modules/sentry-java @@ -1 +1 @@ -Subproject commit f74af4a8271a05cad169d47f05b801f90446dbdb +Subproject commit 95f6443bdcdb65a2855452a8e6f9fa3bd524d5f7 From c9a3bb919c362bc7c6594476e2d2690fa1cc4a4d Mon Sep 17 00:00:00 2001 From: Ivan Tustanivskyi Date: Tue, 29 Oct 2024 20:18:10 +0200 Subject: [PATCH 2/5] Add printing callstack to a log file for assertions/crashes (#637) * Add callstack logging utility * Update package snapshot * Add assert callstack for Apple * Update changelog * Fix stack walking mode * Filter callstack logs when adding automatic breadcrumbs * Add crash stacktrace logging during handling a crash * Add logging for ensures on Apple * Update CHANGELOG.md Co-authored-by: Stefan Jandl --------- Co-authored-by: Stefan Jandl --- CHANGELOG.md | 4 ++ .../Private/Apple/SentrySubsystemApple.cpp | 10 +++- .../SentryConvertorsDesktop.cpp | 50 +++++++++++++++++++ .../Infrastructure/SentryConvertorsDesktop.h | 2 + .../Desktop/SentrySubsystemDesktop.cpp | 49 +++++++++++++++++- .../Sentry/Private/SentryOutputDevice.cpp | 2 +- .../Source/Sentry/Private/SentrySubsystem.cpp | 1 + .../Sentry/Private/Utils/SentryLogUtils.cpp | 27 ++++++++++ .../Sentry/Private/Utils/SentryLogUtils.h | 12 +++++ scripts/packaging/package-github.snapshot | 2 + .../packaging/package-marketplace.snapshot | 2 + 11 files changed, 158 insertions(+), 3 deletions(-) create mode 100644 plugin-dev/Source/Sentry/Private/Utils/SentryLogUtils.cpp create mode 100644 plugin-dev/Source/Sentry/Private/Utils/SentryLogUtils.h diff --git a/CHANGELOG.md b/CHANGELOG.md index a3038fd5..fe38797a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## 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)) diff --git a/plugin-dev/Source/Sentry/Private/Apple/SentrySubsystemApple.cpp b/plugin-dev/Source/Sentry/Private/Apple/SentrySubsystemApple.cpp index 44aac2f6..c7d04eee 100644 --- a/plugin-dev/Source/Sentry/Private/Apple/SentrySubsystemApple.cpp +++ b/plugin-dev/Source/Sentry/Private/Apple/SentrySubsystemApple.cpp @@ -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) { @@ -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) diff --git a/plugin-dev/Source/Sentry/Private/Desktop/Infrastructure/SentryConvertorsDesktop.cpp b/plugin-dev/Source/Sentry/Private/Desktop/Infrastructure/SentryConvertorsDesktop.cpp index ee98aa72..a615fc9f 100644 --- a/plugin-dev/Source/Sentry/Private/Desktop/Infrastructure/SentryConvertorsDesktop.cpp +++ b/plugin-dev/Source/Sentry/Private/Desktop/Infrastructure/SentryConvertorsDesktop.cpp @@ -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 diff --git a/plugin-dev/Source/Sentry/Private/Desktop/Infrastructure/SentryConvertorsDesktop.h b/plugin-dev/Source/Sentry/Private/Desktop/Infrastructure/SentryConvertorsDesktop.h index 66a2e84d..a70a908e 100644 --- a/plugin-dev/Source/Sentry/Private/Desktop/Infrastructure/SentryConvertorsDesktop.h +++ b/plugin-dev/Source/Sentry/Private/Desktop/Infrastructure/SentryConvertorsDesktop.h @@ -37,6 +37,8 @@ class SentryConvertorsDesktop static FString SentryLevelToString(ESentryLevel level); static TArray 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 diff --git a/plugin-dev/Source/Sentry/Private/Desktop/SentrySubsystemDesktop.cpp b/plugin-dev/Source/Sentry/Private/Desktop/SentrySubsystemDesktop.cpp index 659ac6cf..9bca57db 100644 --- a/plugin-dev/Source/Sentry/Private/Desktop/SentrySubsystemDesktop.cpp +++ b/plugin-dev/Source/Sentry/Private/Desktop/SentrySubsystemDesktop.cpp @@ -21,6 +21,7 @@ #include "SentryTransactionContext.h" #include "SentryUserFeedbackDesktop.h" +#include "Utils/SentryLogUtils.h" #include "Utils/SentryScreenshotUtils.h" #include "Infrastructure/SentryConvertorsDesktop.h" @@ -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" @@ -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(closure); @@ -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(closure); SentrySubsystem->TryCaptureScreenshot(); @@ -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) diff --git a/plugin-dev/Source/Sentry/Private/SentryOutputDevice.cpp b/plugin-dev/Source/Sentry/Private/SentryOutputDevice.cpp index 31656098..a10707c3 100644 --- a/plugin-dev/Source/Sentry/Private/SentryOutputDevice.cpp +++ b/plugin-dev/Source/Sentry/Private/SentryOutputDevice.cpp @@ -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; } diff --git a/plugin-dev/Source/Sentry/Private/SentrySubsystem.cpp b/plugin-dev/Source/Sentry/Private/SentrySubsystem.cpp index ba51d875..c5b392a0 100644 --- a/plugin-dev/Source/Sentry/Private/SentrySubsystem.cpp +++ b/plugin-dev/Source/Sentry/Private/SentrySubsystem.cpp @@ -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" diff --git a/plugin-dev/Source/Sentry/Private/Utils/SentryLogUtils.cpp b/plugin-dev/Source/Sentry/Private/Utils/SentryLogUtils.cpp new file mode 100644 index 00000000..092d1470 --- /dev/null +++ b/plugin-dev/Source/Sentry/Private/Utils/SentryLogUtils.cpp @@ -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 +} diff --git a/plugin-dev/Source/Sentry/Private/Utils/SentryLogUtils.h b/plugin-dev/Source/Sentry/Private/Utils/SentryLogUtils.h new file mode 100644 index 00000000..1a6011b9 --- /dev/null +++ b/plugin-dev/Source/Sentry/Private/Utils/SentryLogUtils.h @@ -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); +}; diff --git a/scripts/packaging/package-github.snapshot b/scripts/packaging/package-github.snapshot index b391fb09..09531eea 100644 --- a/scripts/packaging/package-github.snapshot +++ b/scripts/packaging/package-github.snapshot @@ -171,6 +171,8 @@ Source/Sentry/Private/Tests/SentryUser.spec.cpp Source/Sentry/Private/Utils/ Source/Sentry/Private/Utils/SentryFileUtils.cpp Source/Sentry/Private/Utils/SentryFileUtils.h +Source/Sentry/Private/Utils/SentryLogUtils.cpp +Source/Sentry/Private/Utils/SentryLogUtils.h Source/Sentry/Private/Utils/SentryScreenshotUtils.cpp Source/Sentry/Private/Utils/SentryScreenshotUtils.h Source/Sentry/Public/ diff --git a/scripts/packaging/package-marketplace.snapshot b/scripts/packaging/package-marketplace.snapshot index 16669248..a79d3fc4 100644 --- a/scripts/packaging/package-marketplace.snapshot +++ b/scripts/packaging/package-marketplace.snapshot @@ -169,6 +169,8 @@ Source/Sentry/Private/Tests/SentryUser.spec.cpp Source/Sentry/Private/Utils/ Source/Sentry/Private/Utils/SentryFileUtils.cpp Source/Sentry/Private/Utils/SentryFileUtils.h +Source/Sentry/Private/Utils/SentryLogUtils.cpp +Source/Sentry/Private/Utils/SentryLogUtils.h Source/Sentry/Private/Utils/SentryScreenshotUtils.cpp Source/Sentry/Private/Utils/SentryScreenshotUtils.h Source/Sentry/Public/ From b96454ce582c657e7847cd9922b6f712c5c46d38 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 31 Oct 2024 09:40:37 +0200 Subject: [PATCH 3/5] chore: update plugin-dev/sentry-cli.properties to 2.38.1 (#670) Co-authored-by: GitHub --- CHANGELOG.md | 6 +++--- plugin-dev/sentry-cli.properties | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe38797a..e685ad0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,9 +8,9 @@ ### 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) diff --git a/plugin-dev/sentry-cli.properties b/plugin-dev/sentry-cli.properties index c2f4783a..6c3da15c 100644 --- a/plugin-dev/sentry-cli.properties +++ b/plugin-dev/sentry-cli.properties @@ -1,2 +1,2 @@ -version=2.38.0 +version=2.38.1 repo=https://github.com/getsentry/sentry-cli From 3055132f50048b2ceac82b46b01fe17461d47667 Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Thu, 31 Oct 2024 08:03:47 -0400 Subject: [PATCH 4/5] ci: heavy linux workload on ubuntu-latest-4-cores (#658) --- .github/workflows/ci.yml | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e26c2df5..d42c9e7e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -126,7 +126,7 @@ jobs: test: name: Test UE ${{ matrix.unreal }} - runs-on: ubuntu-latest + runs-on: ubuntu-latest-4-cores strategy: fail-fast: false @@ -179,8 +179,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 ; @@ -191,12 +189,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 ; @@ -221,8 +213,20 @@ 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" \ @@ -230,7 +234,7 @@ jobs: -Unattended \ -NoPause \ -NoSplash \ - -NullRHI + -NullRHI - name: Collect ${{ matrix.app }} test info if: ${{ always() && steps.run-tests.outcome == 'failure' }} @@ -239,17 +243,9 @@ jobs: name: UE ${{ matrix.unreal }} ${{ matrix.app }} test report 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 @@ -257,4 +253,4 @@ jobs: checkout/${{ matrix.app }}/Saved/Logs checkout/${{ matrix.app }}/Saved/Stats checkout/${{ matrix.app }}/Saved/MaterialStats - checkout/${{ matrix.app }}/Saved/MaterialStatsDebug \ No newline at end of file + checkout/${{ matrix.app }}/Saved/MaterialStatsDebug From 9f6b1e86ae246ff3d90ae234b14e1bbb383d8ef8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 31 Oct 2024 15:21:46 +0200 Subject: [PATCH 5/5] chore(deps): update Cocoa SDK (iOS) to v8.39.0 (#668) * chore: update modules/sentry-cocoa to 8.39.0 * Update build scripts * Fix build script invocation * Fix framework path * Optimize build times * Add missing output param * Fix path for Mac * Fix header paths * Update snapshot --------- Co-authored-by: GitHub Co-authored-by: Ivan Tustanivskyi --- CHANGELOG.md | 3 +++ modules/sentry-cocoa | 2 +- scripts/build-ios.sh | 23 ++++++++++++++-- scripts/build-mac.sh | 27 ++++++++++++++++--- scripts/packaging/package-github.snapshot | 2 -- .../packaging/package-marketplace.snapshot | 2 -- 6 files changed, 48 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e685ad0c..d8b0d707 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ - 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 diff --git a/modules/sentry-cocoa b/modules/sentry-cocoa index 54cc2e3e..0b8ba88f 160000 --- a/modules/sentry-cocoa +++ b/modules/sentry-cocoa @@ -1 +1 @@ -Subproject commit 54cc2e3e4fcbf9d4c7708ce00d3b6eee29aecbb1 +Subproject commit 0b8ba88f5fd70062887d55f87a970c59b1ceebcf diff --git a/scripts/build-ios.sh b/scripts/build-ios.sh index d84f7558..1014844f 100755 --- a/scripts/build-ios.sh +++ b/scripts/build-ios.sh @@ -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" diff --git a/scripts/build-mac.sh b/scripts/build-mac.sh index b19928de..47486a88 100755 --- a/scripts/build-mac.sh +++ b/scripts/build-mac.sh @@ -6,12 +6,31 @@ export sentryArtifactsDestination=$2 rm -rf "${sentryArtifactsDestination}/"* -carthage build --project-directory "${sentryCocoaRoot}" --no-skip-current --platform macOS +pushd "${sentryCocoaRoot}" + +xcodebuild archive \ + -project Sentry.xcodeproj/ \ + -scheme "Sentry" \ + -configuration "Release" \ + -sdk "macosx" \ + -archivePath "./Carthage/archive/Sentry/macosx.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/macosx.xcarchive/Products/Library/Frameworks/Sentry.framework -output Carthage/Sentry.xcframework + +popd mkdir "${sentryArtifactsDestination}/bin" mkdir "${sentryArtifactsDestination}/include" -cp "${sentryCocoaRoot}/Carthage/Build/Mac/Sentry.framework/Sentry" "${sentryArtifactsDestination}/bin/sentry.dylib" +cp "${sentryCocoaRoot}/Carthage/Sentry.xcframework/macos-arm64_arm64e_x86_64/Sentry.framework/Sentry" "${sentryArtifactsDestination}/bin/sentry.dylib" -cp -rL "${sentryCocoaRoot}/Carthage/Build/Mac/Sentry.framework/Headers" "${sentryArtifactsDestination}/include/Sentry" -cp -rL "${sentryCocoaRoot}/Carthage/Build/Mac/Sentry.framework/PrivateHeaders/." "${sentryArtifactsDestination}/include/Sentry" \ No newline at end of file +cp -rL "${sentryCocoaRoot}/Carthage/Sentry.xcframework/macos-arm64_arm64e_x86_64/Sentry.framework/Headers" "${sentryArtifactsDestination}/include/Sentry" +cp -rL "${sentryCocoaRoot}/Carthage/Sentry.xcframework/macos-arm64_arm64e_x86_64/Sentry.framework/PrivateHeaders/." "${sentryArtifactsDestination}/include/Sentry" \ No newline at end of file diff --git a/scripts/packaging/package-github.snapshot b/scripts/packaging/package-github.snapshot index 09531eea..7f8db80e 100644 --- a/scripts/packaging/package-github.snapshot +++ b/scripts/packaging/package-github.snapshot @@ -276,12 +276,10 @@ Source/ThirdParty/IOS/Sentry.framework/Modules/Sentry.swiftmodule/arm64-apple-io Source/ThirdParty/IOS/Sentry.framework/Modules/Sentry.swiftmodule/arm64-apple-ios.private.swiftinterface Source/ThirdParty/IOS/Sentry.framework/Modules/Sentry.swiftmodule/arm64-apple-ios.swiftdoc Source/ThirdParty/IOS/Sentry.framework/Modules/Sentry.swiftmodule/arm64-apple-ios.swiftinterface -Source/ThirdParty/IOS/Sentry.framework/Modules/Sentry.swiftmodule/arm64-apple-ios.swiftmodule Source/ThirdParty/IOS/Sentry.framework/Modules/Sentry.swiftmodule/arm64e-apple-ios.abi.json Source/ThirdParty/IOS/Sentry.framework/Modules/Sentry.swiftmodule/arm64e-apple-ios.private.swiftinterface Source/ThirdParty/IOS/Sentry.framework/Modules/Sentry.swiftmodule/arm64e-apple-ios.swiftdoc Source/ThirdParty/IOS/Sentry.framework/Modules/Sentry.swiftmodule/arm64e-apple-ios.swiftinterface -Source/ThirdParty/IOS/Sentry.framework/Modules/Sentry.swiftmodule/arm64e-apple-ios.swiftmodule Source/ThirdParty/IOS/Sentry.framework/PrivacyInfo.xcprivacy Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/ Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/PrivateSentrySDKOnly.h diff --git a/scripts/packaging/package-marketplace.snapshot b/scripts/packaging/package-marketplace.snapshot index a79d3fc4..46ba6ae3 100644 --- a/scripts/packaging/package-marketplace.snapshot +++ b/scripts/packaging/package-marketplace.snapshot @@ -273,12 +273,10 @@ Source/ThirdParty/IOS/Sentry.framework/Modules/Sentry.swiftmodule/arm64-apple-io Source/ThirdParty/IOS/Sentry.framework/Modules/Sentry.swiftmodule/arm64-apple-ios.private.swiftinterface Source/ThirdParty/IOS/Sentry.framework/Modules/Sentry.swiftmodule/arm64-apple-ios.swiftdoc Source/ThirdParty/IOS/Sentry.framework/Modules/Sentry.swiftmodule/arm64-apple-ios.swiftinterface -Source/ThirdParty/IOS/Sentry.framework/Modules/Sentry.swiftmodule/arm64-apple-ios.swiftmodule Source/ThirdParty/IOS/Sentry.framework/Modules/Sentry.swiftmodule/arm64e-apple-ios.abi.json Source/ThirdParty/IOS/Sentry.framework/Modules/Sentry.swiftmodule/arm64e-apple-ios.private.swiftinterface Source/ThirdParty/IOS/Sentry.framework/Modules/Sentry.swiftmodule/arm64e-apple-ios.swiftdoc Source/ThirdParty/IOS/Sentry.framework/Modules/Sentry.swiftmodule/arm64e-apple-ios.swiftinterface -Source/ThirdParty/IOS/Sentry.framework/Modules/Sentry.swiftmodule/arm64e-apple-ios.swiftmodule Source/ThirdParty/IOS/Sentry.framework/PrivacyInfo.xcprivacy Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/ Source/ThirdParty/IOS/Sentry.framework/PrivateHeaders/PrivateSentrySDKOnly.h