From 385fbd4228f6f9469636f18df95a00cde88a136e Mon Sep 17 00:00:00 2001 From: GitHub Date: Tue, 29 Oct 2024 18:18:35 +0000 Subject: [PATCH 01/10] chore: update modules/sentry-native to 0.7.11 --- CHANGELOG.md | 3 +++ modules/sentry-native | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe38797a..bf061437 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 Native SDK from v0.7.6 to v0.7.11 ([#667](https://github.com/getsentry/sentry-unreal/pull/667)) + - [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0711) + - [diff](https://github.com/getsentry/sentry-native/compare/0.7.6...0.7.11) ## 0.20.1 diff --git a/modules/sentry-native b/modules/sentry-native index 37bf7336..33739b5c 160000 --- a/modules/sentry-native +++ b/modules/sentry-native @@ -1 +1 @@ -Subproject commit 37bf733697e4ce7481bc4630300617768d006a4e +Subproject commit 33739b5ccf0c0d1513d284ac64b610e74adb62cf From b47500fd1b33911a2ec119bc24befb0e2069dbc0 Mon Sep 17 00:00:00 2001 From: Ivan Tustanivskyi Date: Wed, 30 Oct 2024 16:30:56 +0200 Subject: [PATCH 02/10] Update CI setup for Native SDK build --- .github/workflows/ci.yml | 3 ++- .github/workflows/sdk.yml | 7 ++++++- scripts/build-linux.sh | 6 +++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e26c2df5..a6dc7550 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -200,7 +200,8 @@ jobs: - name: Setup C++ runtime run: docker exec --user root unreal bash -c ' apt-get update ; - apt-get install -y libc++-dev ' + add-apt-repository ppa:ubuntu-toolchain-r/test ; + apt-get install -y libstdc++-10-dev' - name: Download package uses: actions/download-artifact@v4 diff --git a/.github/workflows/sdk.yml b/.github/workflows/sdk.yml index d62ca4b7..faedcf4e 100644 --- a/.github/workflows/sdk.yml +++ b/.github/workflows/sdk.yml @@ -47,7 +47,12 @@ jobs: if: ${{ inputs.target == 'Linux' && steps.cache.outputs.cache-hit != 'true' }} run: | sudo apt-get update - sudo apt-get install zlib1g-dev libcurl4-openssl-dev clang libc++-dev + sudo add-apt-repository ppa:ubuntu-toolchain-r/test + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 13 + sudo ./llvm.sh 16 + sudo apt-get install libc++-16-dev libc++abi-16-dev libstdc++-10-dev zlib1g-dev libcurl4-openssl-dev gcc-11 g++-11 - uses: actions/setup-java@v3 if: ${{ inputs.target == 'Android' }} diff --git a/scripts/build-linux.sh b/scripts/build-linux.sh index 17ee1f9c..869ba826 100755 --- a/scripts/build-linux.sh +++ b/scripts/build-linux.sh @@ -8,13 +8,13 @@ rm -rf "${sentryArtifactsDestination}/"* # Build sentry-native using clang and libc++ for static libs cmake -S "${sentryNativeRoot}" -B "${sentryNativeRoot}/build" -D SENTRY_BACKEND=crashpad -D SENTRY_TRANSPORT=none -D SENTRY_SDK_NAME=sentry.native.unreal -D SENTRY_BUILD_SHARED_LIBS=OFF \ - -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_C_COMPILER=clang -D CMAKE_CXX_COMPILER="clang++" -D CMAKE_CXX_FLAGS="-stdlib=libc++" -D CMAKE_EXE_LINKER_FLAGS="-stdlib=libc++" + -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_C_COMPILER=clang-13 -D CMAKE_CXX_COMPILER="clang++-13" -D CMAKE_CXX_FLAGS="-stdlib=libc++" -D CMAKE_EXE_LINKER_FLAGS="-stdlib=libc++" cmake --build "${sentryNativeRoot}/build" --target sentry --parallel cmake --install "${sentryNativeRoot}/build" --prefix "${sentryNativeRoot}/install" -# Build sentry-native using gcc for crashpad which's not depending on libc++ +# Build sentry-native using clang and libstdc++ for crashpad executable cmake -S "${sentryNativeRoot}" -B "${sentryNativeRoot}/build_crashpad_handler" -D SENTRY_BACKEND=crashpad -D SENTRY_TRANSPORT=none -D SENTRY_SDK_NAME=sentry.native.unreal -D SENTRY_BUILD_SHARED_LIBS=OFF \ - -D CMAKE_BUILD_TYPE=RelWithDebInfo + -D CMAKE_BUILD_TYPE=RelWithDebInfo -D CMAKE_C_COMPILER=clang-13 -D CMAKE_CXX_COMPILER="clang++-13" -D CMAKE_CXX_FLAGS="-stdlib=libstdc++" -D CMAKE_EXE_LINKER_FLAGS="-stdlib=libstdc++" cmake --build "${sentryNativeRoot}/build_crashpad_handler" --target sentry --parallel cmake --install "${sentryNativeRoot}/build_crashpad_handler" --prefix "${sentryNativeRoot}/install_crashpad_handler" From fe27e30184d49747278d110ba2c77dd11055921e Mon Sep 17 00:00:00 2001 From: Ivan Tustanivskyi Date: Thu, 31 Oct 2024 17:21:38 +0200 Subject: [PATCH 03/10] Try to run tests for older engine version in CI --- .github/workflows/ci.yml | 2 +- scripts/packaging/engine-versions.txt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76302d61..5f7e0556 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -132,7 +132,7 @@ jobs: fail-fast: false matrix: # Note: these versions must match scripts/packaging/engine-versions.txt - unreal: ['5.2', '5.3', '5.4'] + unreal: ['5.0', '5.1', '5.2', '5.3', '5.4'] app: ['sample'] steps: diff --git a/scripts/packaging/engine-versions.txt b/scripts/packaging/engine-versions.txt index d2ab9e6e..4e698181 100644 --- a/scripts/packaging/engine-versions.txt +++ b/scripts/packaging/engine-versions.txt @@ -1,3 +1,5 @@ 5.4 5.3 -5.2 \ No newline at end of file +5.2 +5.1 +5.0 \ No newline at end of file From 2b7c29e8e9d62d67f2a3eff0c0c0b3783b71c5dc Mon Sep 17 00:00:00 2001 From: Ivan Tustanivskyi Date: Thu, 31 Oct 2024 17:48:07 +0200 Subject: [PATCH 04/10] Fix missing API build errors --- .../Source/Sentry/Private/Utils/SentryScreenshotUtils.cpp | 2 +- plugin-dev/Source/Sentry/Public/SentryOutputDevice.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin-dev/Source/Sentry/Private/Utils/SentryScreenshotUtils.cpp b/plugin-dev/Source/Sentry/Private/Utils/SentryScreenshotUtils.cpp index 0a379ff2..6b479e9d 100644 --- a/plugin-dev/Source/Sentry/Private/Utils/SentryScreenshotUtils.cpp +++ b/plugin-dev/Source/Sentry/Private/Utils/SentryScreenshotUtils.cpp @@ -48,7 +48,7 @@ bool SentryScreenshotUtils::CaptureScreenshot(const FString& ScreenshotSavePath) return false; } -#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1 +#if ENGINE_MAJOR_VERSION == 5 GetHighResScreenshotConfig().MergeMaskIntoAlpha(Bitmap, FIntRect()); TArray64 CompressedBitmap; FImageUtils::PNGCompressImageArray(ViewportSize.X, ViewportSize.Y, Bitmap, CompressedBitmap); diff --git a/plugin-dev/Source/Sentry/Public/SentryOutputDevice.h b/plugin-dev/Source/Sentry/Public/SentryOutputDevice.h index 5aecd169..0e93f2a4 100644 --- a/plugin-dev/Source/Sentry/Public/SentryOutputDevice.h +++ b/plugin-dev/Source/Sentry/Public/SentryOutputDevice.h @@ -13,7 +13,7 @@ class FSentryOutputDevice : public FOutputDevice virtual bool CanBeUsedOnAnyThread() const override; virtual bool CanBeUsedOnMultipleThreads() const override; -#if ENGINE_MAJOR_VERSION >= 5 +#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1 virtual bool CanBeUsedOnPanicThread() const override; #endif }; From dff7f0144d1181419f7638502c24c5643f607493 Mon Sep 17 00:00:00 2001 From: Ivan Tustanivskyi Date: Thu, 31 Oct 2024 19:41:43 +0200 Subject: [PATCH 05/10] Fix condition --- plugin-dev/Source/Sentry/Private/SentryOutputDevice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin-dev/Source/Sentry/Private/SentryOutputDevice.cpp b/plugin-dev/Source/Sentry/Private/SentryOutputDevice.cpp index a10707c3..d77f59f1 100644 --- a/plugin-dev/Source/Sentry/Private/SentryOutputDevice.cpp +++ b/plugin-dev/Source/Sentry/Private/SentryOutputDevice.cpp @@ -75,7 +75,7 @@ bool FSentryOutputDevice::CanBeUsedOnMultipleThreads() const return true; } -#if ENGINE_MAJOR_VERSION >= 5 +#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1 bool FSentryOutputDevice::CanBeUsedOnPanicThread() const { return true; From a0c5eb08a64ea7bb0df6f05f3f3dbebd20c85713 Mon Sep 17 00:00:00 2001 From: Ivan Tustanivskyi Date: Thu, 31 Oct 2024 20:22:19 +0200 Subject: [PATCH 06/10] Add UE 4.27 --- .github/workflows/ci.yml | 2 +- scripts/packaging/engine-versions.txt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f7e0556..bd531177 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -132,7 +132,7 @@ jobs: fail-fast: false matrix: # Note: these versions must match scripts/packaging/engine-versions.txt - unreal: ['5.0', '5.1', '5.2', '5.3', '5.4'] + unreal: ['4.27', '5.0', '5.1', '5.2', '5.3', '5.4'] app: ['sample'] steps: diff --git a/scripts/packaging/engine-versions.txt b/scripts/packaging/engine-versions.txt index 4e698181..58c3c15f 100644 --- a/scripts/packaging/engine-versions.txt +++ b/scripts/packaging/engine-versions.txt @@ -2,4 +2,5 @@ 5.3 5.2 5.1 -5.0 \ No newline at end of file +5.0 +4.27 \ No newline at end of file From 8ff745e173484722141a52853c5e4de90a47e053 Mon Sep 17 00:00:00 2001 From: Ivan Tustanivskyi Date: Mon, 4 Nov 2024 14:53:27 +0200 Subject: [PATCH 07/10] Try remove `gcc-11` and `g++-11` --- .github/workflows/sdk.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sdk.yml b/.github/workflows/sdk.yml index faedcf4e..d2c4df57 100644 --- a/.github/workflows/sdk.yml +++ b/.github/workflows/sdk.yml @@ -52,7 +52,7 @@ jobs: chmod +x llvm.sh sudo ./llvm.sh 13 sudo ./llvm.sh 16 - sudo apt-get install libc++-16-dev libc++abi-16-dev libstdc++-10-dev zlib1g-dev libcurl4-openssl-dev gcc-11 g++-11 + sudo apt-get install libc++-16-dev libc++abi-16-dev libstdc++-10-dev zlib1g-dev libcurl4-openssl-dev - uses: actions/setup-java@v3 if: ${{ inputs.target == 'Android' }} From dbeb43204310c4701d68c7523735fdbc050da79c Mon Sep 17 00:00:00 2001 From: Ivan Tustanivskyi Date: Mon, 4 Nov 2024 14:58:10 +0200 Subject: [PATCH 08/10] uSE libstdc++-11-dev --- .github/workflows/sdk.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sdk.yml b/.github/workflows/sdk.yml index d2c4df57..ebd8cfa9 100644 --- a/.github/workflows/sdk.yml +++ b/.github/workflows/sdk.yml @@ -52,7 +52,7 @@ jobs: chmod +x llvm.sh sudo ./llvm.sh 13 sudo ./llvm.sh 16 - sudo apt-get install libc++-16-dev libc++abi-16-dev libstdc++-10-dev zlib1g-dev libcurl4-openssl-dev + sudo apt-get install libc++-16-dev libc++abi-16-dev libstdc++-11-dev zlib1g-dev libcurl4-openssl-dev - uses: actions/setup-java@v3 if: ${{ inputs.target == 'Android' }} From e56a496860c02f4f8d46582c33118e1f70ea6d0a Mon Sep 17 00:00:00 2001 From: Ivan Tustanivskyi Date: Mon, 4 Nov 2024 17:02:36 +0200 Subject: [PATCH 09/10] Test `libstdc++6` in docker container --- .github/workflows/ci.yml | 2 +- README.md | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dfa3aa9c..dad5cab1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -197,7 +197,7 @@ jobs: run: docker exec --user root unreal bash -c ' apt-get update ; add-apt-repository ppa:ubuntu-toolchain-r/test ; - apt-get install -y libstdc++-10-dev' + apt-get install -y libstdc++6' - name: Download package uses: actions/download-artifact@v4 diff --git a/README.md b/README.md index 31fef606..0ae01429 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ The SDK compiles with three latest engine versions. ## Known Limitations -- On all platforms captured crashes are uploaded to Sentry only after relaunching the crashed app since the in-process handler cannot do this within the same session. The only exceptions are Windows (if using the GitHub package) and Linux for which the out-of-process crashpad handler is used and crashes are uploaded immediately. +- On all platforms captured crashes are uploaded to Sentry only after relaunching the crashed app since the in-process handler cannot do this within the same session. The only exceptions are Windows (if using the GitHub package) and Linux for which the out-of-process crashpad handler handler is used and crashes are uploaded immediately. - To automatically capture crashes in Windows game builds that were made using engine versions prior to UE 5.2, the [Crash Reporter has to be configured](https://docs.sentry.io/platforms/unreal/setup-crashreport/) first. @@ -52,6 +52,13 @@ The SDK compiles with three latest engine versions. - On Windows/Linux if crash event was captured during the garbage collection the `BeforeSendHandler` will not be invoked. +- It may be required to upgrade the C++ standard library (`libstdc++`) on older Linux distributions (such as Ubuntu 18.04 and 20.04) to ensure crashpad handler proper functionality within the deployment environment. This can be achieved with something like this: +``` +sudo apt-get update +sudo add-apt-repository ppa:ubuntu-toolchain-r/test +sudo apt-get install -y libstdc++6 +``` + ## Development Please see the [contribution guide](./CONTRIBUTING.md). From a6c9ad3e9f7ae052f8505a926bab8a8c2a832235 Mon Sep 17 00:00:00 2001 From: Ivan Tustanivskyi Date: Mon, 4 Nov 2024 17:04:14 +0200 Subject: [PATCH 10/10] Fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0ae01429..9ea855f1 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ The SDK compiles with three latest engine versions. ## Known Limitations -- On all platforms captured crashes are uploaded to Sentry only after relaunching the crashed app since the in-process handler cannot do this within the same session. The only exceptions are Windows (if using the GitHub package) and Linux for which the out-of-process crashpad handler handler is used and crashes are uploaded immediately. +- On all platforms captured crashes are uploaded to Sentry only after relaunching the crashed app since the in-process handler cannot do this within the same session. The only exceptions are Windows (if using the GitHub package) and Linux for which the out-of-process crashpad handler is used and crashes are uploaded immediately. - To automatically capture crashes in Windows game builds that were made using engine versions prior to UE 5.2, the [Crash Reporter has to be configured](https://docs.sentry.io/platforms/unreal/setup-crashreport/) first.