From 1ef28e8c3e4aa130374edbcb1b103ae04b99f8af Mon Sep 17 00:00:00 2001 From: lucas Date: Thu, 31 Oct 2024 12:38:31 +0000 Subject: [PATCH 1/4] add SENTRY_DISABLE_DEBUG_FILE_UPLOAD flag for ios --- packages/core/scripts/sentry-xcode-debug-files.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/core/scripts/sentry-xcode-debug-files.sh b/packages/core/scripts/sentry-xcode-debug-files.sh index 8788c2f30a..cfb5b4327c 100755 --- a/packages/core/scripts/sentry-xcode-debug-files.sh +++ b/packages/core/scripts/sentry-xcode-debug-files.sh @@ -35,6 +35,8 @@ XCODE_BUILD_CONFIGURATION="${CONFIGURATION}" if [ "$SENTRY_DISABLE_AUTO_UPLOAD" == true ]; then echo "SENTRY_DISABLE_AUTO_UPLOAD=true, skipping debug files upload" +elif [ "$SENTRY_DISABLE_DIF_UPLOAD" == true ]; then + echo "SENTRY_DISABLE_DEBUG_FILE_UPLOAD=true, skipping native debug files upload" elif echo "$XCODE_BUILD_CONFIGURATION" | grep -iq "debug"; then # case insensitive check for "debug" echo "Skipping debug files upload for *Debug* configuration" else From a44ab10489cf01be9f0fc729935e67bfd9c53631 Mon Sep 17 00:00:00 2001 From: lucas Date: Thu, 31 Oct 2024 12:40:23 +0000 Subject: [PATCH 2/4] nit --- packages/core/scripts/sentry-xcode-debug-files.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/scripts/sentry-xcode-debug-files.sh b/packages/core/scripts/sentry-xcode-debug-files.sh index cfb5b4327c..60cca3661f 100755 --- a/packages/core/scripts/sentry-xcode-debug-files.sh +++ b/packages/core/scripts/sentry-xcode-debug-files.sh @@ -35,8 +35,8 @@ XCODE_BUILD_CONFIGURATION="${CONFIGURATION}" if [ "$SENTRY_DISABLE_AUTO_UPLOAD" == true ]; then echo "SENTRY_DISABLE_AUTO_UPLOAD=true, skipping debug files upload" -elif [ "$SENTRY_DISABLE_DIF_UPLOAD" == true ]; then - echo "SENTRY_DISABLE_DEBUG_FILE_UPLOAD=true, skipping native debug files upload" +elif [ "$SENTRY_DISABLE_XCODE_DEBUG_UPLOAD" == true ]; then + echo "SENTRY_DISABLE_XCODE_DEBUG_UPLOAD=true, skipping native debug files upload" elif echo "$XCODE_BUILD_CONFIGURATION" | grep -iq "debug"; then # case insensitive check for "debug" echo "Skipping debug files upload for *Debug* configuration" else From 937b94eca79bca0feb49cac34e25c42c866d2bf4 Mon Sep 17 00:00:00 2001 From: lucas Date: Thu, 31 Oct 2024 12:47:44 +0000 Subject: [PATCH 3/4] changelog --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e8022f860..cdd8799c84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,17 @@ ## Unreleased +### Features + +- Add env flag `SENTRY_DISABLE_XCODE_DEBUG_UPLOAD` to allow disabling the debug file upload ([#4223](https://github.com/getsentry/sentry-react-native/pull/4223)) + + How to use in Xcode? Make sure you are using `scripts/sentry-xcode.sh` and `scripts/sentry-xcode-debug-files.sh` in your + build phases. And add the following to your `ios/.xcode.env.local` file. + + ```bash + export SENTRY_DISABLE_XCODE_DEBUG_UPLOAD=true + ``` + ### Fixes - Skips ignoring require cycle logs for RN 0.70 or newer ([#4214](https://github.com/getsentry/sentry-react-native/pull/4214)) From 1d24470d291a7411a1b3fba34ca063180c4a7291 Mon Sep 17 00:00:00 2001 From: lucas Date: Thu, 31 Oct 2024 14:51:10 +0000 Subject: [PATCH 4/4] also apply it for Android --- CHANGELOG.md | 15 +++++++++++++-- packages/core/sentry.gradle | 3 ++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdd8799c84..a0727ae1b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,13 +10,24 @@ ### Features -- Add env flag `SENTRY_DISABLE_XCODE_DEBUG_UPLOAD` to allow disabling the debug file upload ([#4223](https://github.com/getsentry/sentry-react-native/pull/4223)) +- Add env flag `SENTRY_DISABLE_NATIVE_DEBUG_UPLOAD` to allow disabling the debug file upload ([#4223](https://github.com/getsentry/sentry-react-native/pull/4223)) + + How to use in Android project? It works by default, just set `export SENTRY_DISABLE_NATIVE_DEBUG_UPLOAD=true` in your build environment. For Sentry Android Gradle Plugin add the following to your `android/app/build.gradle`. + + ```gradle + apply from: "../../../sentry.gradle" + + sentry { + autoUploadProguardMapping = shouldSentryAutoUpload() + uploadNativeSymbols = shouldSentryAutoUpload() + } + ``` How to use in Xcode? Make sure you are using `scripts/sentry-xcode.sh` and `scripts/sentry-xcode-debug-files.sh` in your build phases. And add the following to your `ios/.xcode.env.local` file. ```bash - export SENTRY_DISABLE_XCODE_DEBUG_UPLOAD=true + export SENTRY_DISABLE_NATIVE_DEBUG_UPLOAD=true ``` ### Fixes diff --git a/packages/core/sentry.gradle b/packages/core/sentry.gradle index 640f9a3b28..e5630ef458 100644 --- a/packages/core/sentry.gradle +++ b/packages/core/sentry.gradle @@ -4,7 +4,8 @@ import java.util.regex.Matcher import java.util.regex.Pattern project.ext.shouldSentryAutoUpload = { -> - return System.getenv('SENTRY_DISABLE_AUTO_UPLOAD') != 'true' + return System.getenv('SENTRY_DISABLE_AUTO_UPLOAD') != 'true' || + System.getenv('SENTRY_DISABLE_NATIVE_DEBUG_UPLOAD') != 'true' } def config = project.hasProperty("sentryCli") ? project.sentryCli : [];