diff --git a/.github/workflows/sample-application.yml b/.github/workflows/sample-application.yml index efb32a6d89..13082b8df0 100644 --- a/.github/workflows/sample-application.yml +++ b/.github/workflows/sample-application.yml @@ -43,7 +43,7 @@ jobs: caller_ref: ${{ github.ref }} build-ios: - name: Build ${{ matrix.rn-architecture }} ios ${{ matrix.build-type }} ${{ matrix.ios-use-frameworks }} ${{ matrix.sentry-consumption }} + name: Build ${{ matrix.rn-architecture }} ios ${{ matrix.build-type }} ${{ matrix.ios-use-frameworks }} runs-on: macos-26-xlarge needs: [diff_check, detect-changes] if: >- @@ -60,16 +60,6 @@ jobs: rn-architecture: ["new"] ios-use-frameworks: ["no-frameworks"] build-type: ["dev", "production"] - sentry-consumption: ["xcframework"] - # `xcframework` is the default: RNSentry vendors a prebuilt - # `Sentry-Dynamic.xcframework` downloaded from sentry-cocoa's release. - # Keep a single CocoaPods job to catch regressions in the source-build - # fallback (`SENTRY_USE_XCFRAMEWORK=0`). - include: - - rn-architecture: "new" - ios-use-frameworks: "no-frameworks" - build-type: "production" - sentry-consumption: "cocoapods" steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 @@ -105,7 +95,6 @@ jobs: [[ "${{ matrix.build-type }}" == "production" ]] && export ENABLE_PROD=1 || export ENABLE_PROD=0 [[ "${{ matrix.rn-architecture }}" == "new" ]] && export ENABLE_NEW_ARCH=1 || export ENABLE_NEW_ARCH=0 [[ "${{ matrix.ios-use-frameworks }}" == "dynamic-frameworks" ]] && export USE_FRAMEWORKS=dynamic - [[ "${{ matrix.sentry-consumption }}" == "cocoapods" ]] && export SENTRY_USE_XCFRAMEWORK=0 ./scripts/pod-install.sh @@ -123,10 +112,7 @@ jobs: ./scripts/build-ios.sh - name: Archive iOS App - # Only upload from the xcframework job (the default consumption path) - # to avoid duplicate artifact names when the CocoaPods regression job - # runs. - if: ${{ matrix.rn-architecture == 'new' && matrix.build-type == 'production' && matrix.ios-use-frameworks == 'no-frameworks' && matrix.sentry-consumption == 'xcframework' }} + if: ${{ matrix.rn-architecture == 'new' && matrix.build-type == 'production' && matrix.ios-use-frameworks == 'no-frameworks' }} working-directory: ${{ env.REACT_NATIVE_SAMPLE_PATH }} run: | zip -r \ @@ -134,7 +120,7 @@ jobs: sentryreactnativesample.app - name: Upload iOS APP - if: ${{ matrix.rn-architecture == 'new' && matrix.build-type == 'production' && matrix.ios-use-frameworks == 'no-frameworks' && matrix.sentry-consumption == 'xcframework' }} + if: ${{ matrix.rn-architecture == 'new' && matrix.build-type == 'production' && matrix.ios-use-frameworks == 'no-frameworks' }} uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: name: sample-rn-${{ matrix.rn-architecture }}-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks}}-ios @@ -145,7 +131,7 @@ jobs: if: ${{ always() }} uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: - name: build-sample-${{ matrix.rn-architecture }}-ios-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks}}-${{ matrix.sentry-consumption }}-logs + name: build-sample-${{ matrix.rn-architecture }}-ios-${{ matrix.build-type }}-${{ matrix.ios-use-frameworks}}-logs path: ${{ env.REACT_NATIVE_SAMPLE_PATH }}/ios/*.log build-android: diff --git a/CHANGELOG.md b/CHANGELOG.md index e1e2cc0160..5743ebc7fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,16 +6,6 @@ > make sure you follow our [migration guide](https://docs.sentry.io/platforms/react-native/migration/) first. -## 8.18.0-alpha.3 - -### Changes - -- Consume `sentry-cocoa` as a prebuilt xcframework by default on iOS ([#6381](https://github.com/getsentry/sentry-react-native/pull/6381)) - - **Warning** - - **This may be a breaking change for some setups.** `pod install` now downloads `Sentry.xcframework` from sentry-cocoa's GitHub release (SHA256-verified) and vendors it, instead of building Sentry from source as a CocoaPod. If your iOS build breaks after upgrading (e.g. when another pod also depends on the `Sentry` CocoaPod), or if your `pod install` environment cannot reach `github.com`, set `SENTRY_USE_XCFRAMEWORK=0` before `pod install` to restore the previous source-build behavior. - ## 8.17.2 ### Fixes diff --git a/SDK-VERSIONS.md b/SDK-VERSIONS.md index c24cd290cd..97d4565128 100644 --- a/SDK-VERSIONS.md +++ b/SDK-VERSIONS.md @@ -12,7 +12,6 @@ To manually update the table with the current version, run `./scripts/update-sdk | React Native SDK | Android SDK | Cocoa SDK | JavaScript SDK | | ---------------- | ----------- | --------- | -------------- | -| [8.18.0-alpha.3](https://github.com/getsentry/sentry-react-native/releases/tag/8.18.0-alpha.3) | [8.47.0](https://github.com/getsentry/sentry-java/releases/tag/8.47.0) | [9.19.1](https://github.com/getsentry/sentry-cocoa/releases/tag/9.19.1) | [10.63.0](https://github.com/getsentry/sentry-javascript/releases/tag/10.63.0) | | [8.17.2](https://github.com/getsentry/sentry-react-native/releases/tag/8.17.2) | [8.47.0](https://github.com/getsentry/sentry-java/releases/tag/8.47.0) | [9.19.1](https://github.com/getsentry/sentry-cocoa/releases/tag/9.19.1) | [10.63.0](https://github.com/getsentry/sentry-javascript/releases/tag/10.63.0) | | [8.17.1](https://github.com/getsentry/sentry-react-native/releases/tag/8.17.1) | [8.47.0](https://github.com/getsentry/sentry-java/releases/tag/8.47.0) | [9.19.1](https://github.com/getsentry/sentry-cocoa/releases/tag/9.19.1) | [10.63.0](https://github.com/getsentry/sentry-javascript/releases/tag/10.63.0) | | [8.17.0](https://github.com/getsentry/sentry-react-native/releases/tag/8.17.0) | [8.47.0](https://github.com/getsentry/sentry-java/releases/tag/8.47.0) | [9.19.1](https://github.com/getsentry/sentry-cocoa/releases/tag/9.19.1) | [10.63.0](https://github.com/getsentry/sentry-javascript/releases/tag/10.63.0) | diff --git a/dev-packages/e2e-tests/package.json b/dev-packages/e2e-tests/package.json index 3ad54c8b49..17c18363c0 100644 --- a/dev-packages/e2e-tests/package.json +++ b/dev-packages/e2e-tests/package.json @@ -1,6 +1,6 @@ { "name": "sentry-react-native-e2e-tests", - "version": "8.18.0-alpha.3", + "version": "8.17.2", "private": true, "description": "Sentry React Native End to End Tests Library", "main": "dist/index.js", @@ -14,7 +14,7 @@ "@babel/preset-env": "^7.25.3", "@babel/preset-typescript": "^7.18.6", "@sentry/core": "10.63.0", - "@sentry/react-native": "8.18.0-alpha.3", + "@sentry/react-native": "8.17.2", "@types/node": "^20.9.3", "@types/react": "^19.1.4", "appium": "3.2.2", diff --git a/dev-packages/type-check/package.json b/dev-packages/type-check/package.json index 8cb1583406..a3374df8a3 100644 --- a/dev-packages/type-check/package.json +++ b/dev-packages/type-check/package.json @@ -1,7 +1,7 @@ { "name": "sentry-react-native-type-check", "private": true, - "version": "8.18.0-alpha.3", + "version": "8.17.2", "scripts": { "type-check": "./run-type-check.sh" } diff --git a/dev-packages/utils/package.json b/dev-packages/utils/package.json index bfcca2d420..74309e7f89 100644 --- a/dev-packages/utils/package.json +++ b/dev-packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "sentry-react-native-samples-utils", - "version": "8.18.0-alpha.3", + "version": "8.17.2", "description": "Internal Samples Utils", "main": "index.js", "license": "MIT", diff --git a/lerna.json b/lerna.json index 9722789bed..6cb7f41fa8 100644 --- a/lerna.json +++ b/lerna.json @@ -1,6 +1,6 @@ { "$schema": "node_modules/lerna/schemas/lerna-schema.json", - "version": "8.18.0-alpha.3", + "version": "8.17.2", "packages": [ "packages/*", "dev-packages/*", diff --git a/packages/core/RNSentry.podspec b/packages/core/RNSentry.podspec index 4162b140dd..84189b7df6 100644 --- a/packages/core/RNSentry.podspec +++ b/packages/core/RNSentry.podspec @@ -45,115 +45,41 @@ Pod::Spec.new do |s| # is pulled in here; on Android it is compiled by the dedicated CMake target # in `android/CMakeLists.txt`. The files are guarded with # `RCT_NEW_ARCH_ENABLED` so they compile to empty TUs on Old Arch. - # - # We include `.swift` (for `RNSentrySwiftLinkStub.swift`) only on RN >= - # 0.75. Adding a Swift file makes CocoaPods treat RNSentry as a Swift - # pod, which then requires modular headers from its ObjC dependencies - # (React-Core, React-hermes) — RN < 0.75 doesn't emit those, so - # `pod install` fails with: - # "The Swift pod `RNSentry` depends upon `React-hermes`, which does - # not define modules." - # The stub is only needed when linking Sentry.xcframework's Swift - # symbols into a dynamic framework anyway (RN 0.86+ `use_frameworks! - # :dynamic`), so gating on RN 0.75 is safe. - supports_swift_stub = rn_version[:major] >= 1 || (rn_version[:major] == 0 && rn_version[:minor] >= 75) - if supports_swift_stub - s.source_files = 'ios/**/*.{h,m,mm,swift}', 'cpp/**/*.{h,cpp}' - s.swift_versions = ['5.5'] - else - s.source_files = 'ios/**/*.{h,m,mm}', 'cpp/**/*.{h,cpp}' - end + s.source_files = 'ios/**/*.{h,m,mm}', 'cpp/**/*.{h,cpp}' s.public_header_files = 'ios/RNSentry.h', 'ios/RNSentrySDK.h', 'ios/RNSentryStart.h', 'ios/RNSentryVersion.h', 'ios/RNSentryBreadcrumb.h', 'ios/RNSentryReplay.h', 'ios/RNSentryReplayBreadcrumbConverter.h', 'ios/Replay/RNSentryReplayMask.h', 'ios/Replay/RNSentryReplayUnmask.h', 'ios/RNSentryTimeToDisplay.h' s.compiler_flags = other_cflags - pod_target_xcconfig = { + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } sentry_cocoa_version = '9.19.1' - # Consume sentry-cocoa as a prebuilt `Sentry.xcframework` by default. + # Opt-in to consuming sentry-cocoa via Swift Package Manager. + # When `SENTRY_USE_SPM=1` is set, RNSentry pulls `Sentry` from the + # sentry-cocoa SPM package as a binary xcframework instead of from + # the Sentry CocoaPods source build. Defaults to CocoaPods consumption + # for backward compatibility with the full RN version range we support. # - # The xcframework is downloaded from sentry-cocoa's GitHub Release, - # SHA256-verified, and cached under `~/Library/Caches/sentry-react-native/ - # xcframeworks//` (override with `SENTRY_XCFRAMEWORK_CACHE_DIR`). - # Slice paths are then wired into the pod and app target via - # `FRAMEWORK_SEARCH_PATHS` below. Consuming the xcframework this way - # avoids compiling sentry-cocoa from source (fast install) and - # sidesteps the Xcode 16/26 archive bug that affects the same - # xcframework when consumed through Xcode's SPM integration - # (`Signatures/*.signature` collision during archive). - # - # Set `SENTRY_USE_XCFRAMEWORK=0` to fall back to the source-built - # `Sentry` CocoaPod (e.g. for offline builds behind a restrictive proxy). - # - # `SENTRY_USE_SPM` was the name in earlier drafts of this PR; honor it as a - # deprecated alias so CI or local envs still exporting `SENTRY_USE_SPM=0` - # don't silently take the new xcframework path. - env_use_xcframework = ENV['SENTRY_USE_XCFRAMEWORK'] - if env_use_xcframework.nil? && !ENV['SENTRY_USE_SPM'].nil? - Pod::UI.warn '[Sentry] SENTRY_USE_SPM is deprecated; use SENTRY_USE_XCFRAMEWORK instead.' if defined?(Pod::UI) - env_use_xcframework = ENV['SENTRY_USE_SPM'] - end - use_xcframework = case env_use_xcframework - when '0' then false - else true - end - - if use_xcframework - sentry_xcframework_dir = ensure_sentry_xcframework(sentry_cocoa_version, 'Sentry') - - # We deliberately do NOT set `s.vendored_frameworks` even though the - # xcframework is downloaded and referenced below. CocoaPods doesn't - # stage vendored xcframeworks for `path:` (development) pods anyway - # — it did nothing for us functionally — and pointing it at a path - # inside `node_modules/@sentry/react-native/ios/Vendor/` used to be - # actively harmful, because that path only existed when the SDK was - # cached into the package directory (broken under pnpm's isolated - # store / Yarn PnP where node_modules is read-only). Framework - # linking still happens: `@import Sentry;` in RNSentry.mm + user - # code triggers clang's `-fmodules-autolink`, which emits the - # `-framework Sentry` linker directive automatically once the - # module is discovered via `FRAMEWORK_SEARCH_PATHS` below. - - # Xcode's `-F ` doesn't descend into `.xcframework` bundles — it - # looks for `Sentry.framework` directly at the given path. Point a - # separate framework search path at each slice, gated by the matching - # SDK selector so `#import ` resolves against exactly one - # slice per build. An unconditional search-path list would let Xcode's - # Swift module precompiler stumble into a slice for a different arch - # and fail with "unsupported Swift architecture". - # - # We hardcode the slice → SDK map in `SENTRY_XCFRAMEWORK_SLICES_BY_SDK` - # (see `sentry_utils.rb`) rather than scanning the extracted bundle — - # sentry-cocoa's `Sentry.xcframework` layout is stable across releases. - # Add a slice there if a future release ships one. - # - # Point the search paths at the pod-install-time absolute path to the - # xcframework. `${PODS_TARGET_SRCROOT}` is only defined in per-pod - # xcconfigs, not in aggregate/user-target xcconfigs, and a - # `${PODS_ROOT}`-relative fallback works for one Podfile layout but - # breaks for another (e.g. the RN sample apps put node_modules at a - # different depth from RNSentryCocoaTester). Using the absolute path - # avoids the layout-detection dance — the path is regenerated on - # every `pod install`, so it's not something anyone commits. - xcframework_search_paths = SENTRY_XCFRAMEWORK_SLICES_BY_SDK.each_with_object({}) do |(sdk, slice_ids), acc| - paths = slice_ids.map { |slice| %("#{File.join(sentry_xcframework_dir, slice)}") } - acc["FRAMEWORK_SEARCH_PATHS[sdk=#{sdk}*]"] = (['$(inherited)'] + paths).join(' ') + # Requires React Native >= 0.75 because the SPM helper + # (`react-native/scripts/cocoapods/spm.rb`) is loaded transitively from + # the Podfile via `react_native_pods.rb`. + if ENV['SENTRY_USE_SPM'] == '1' + unless defined?(SPM) && SPM.respond_to?(:dependency) + raise 'SENTRY_USE_SPM=1 is set but the SPM helper is not loaded. ' \ + 'This requires React Native >= 0.75 and a Podfile that imports ' \ + 'react_native_pods.rb.' end - - pod_target_xcconfig.merge!(xcframework_search_paths) - s.user_target_xcconfig = xcframework_search_paths + SPM.dependency(s, + url: 'https://github.com/getsentry/sentry-cocoa', + requirement: { kind: 'exactVersion', version: sentry_cocoa_version }, + products: ['Sentry'] + ) else s.dependency 'Sentry', sentry_cocoa_version end - # Assign before `install_modules_dependencies` so it can merge its - # RN-specific settings on top. Assigning after would clobber those and - # break header resolution across the pod. - s.pod_target_xcconfig = pod_target_xcconfig - if defined? install_modules_dependencies # Default React Native dependencies for 0.71 and above (new and legacy architecture) install_modules_dependencies(s) @@ -162,13 +88,10 @@ Pod::Spec.new do |s| if is_new_arch_enabled then # New Architecture on React Native 0.70 and older - pod_target_xcconfig.merge!({ + s.pod_target_xcconfig.merge!({ "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"", "CLANG_CXX_LANGUAGE_STANDARD" => "c++17" }) - # `install_modules_dependencies` is not defined on RN < 0.71 so re-assigning - # here is safe — nothing else has written to `s.pod_target_xcconfig` yet. - s.pod_target_xcconfig = pod_target_xcconfig s.dependency "React-RCTFabric" # Required for Fabric Components (like RCTViewComponentView) s.dependency "React-Codegen" diff --git a/packages/core/android/src/main/java/io/sentry/react/RNSentryVersion.java b/packages/core/android/src/main/java/io/sentry/react/RNSentryVersion.java index f2d63ed8d0..64264a199f 100644 --- a/packages/core/android/src/main/java/io/sentry/react/RNSentryVersion.java +++ b/packages/core/android/src/main/java/io/sentry/react/RNSentryVersion.java @@ -2,7 +2,7 @@ class RNSentryVersion { static final String REACT_NATIVE_SDK_PACKAGE_NAME = "npm:@sentry/react-native"; - static final String REACT_NATIVE_SDK_PACKAGE_VERSION = "8.18.0-alpha.3"; + static final String REACT_NATIVE_SDK_PACKAGE_VERSION = "8.17.2"; static final String NATIVE_SDK_NAME = "sentry.native.android.react-native"; static final String ANDROID_SDK_NAME = "sentry.java.android.react-native"; static final String REACT_NATIVE_SDK_NAME = "sentry.javascript.react-native"; diff --git a/packages/core/ios/RNSentrySwiftLinkStub.swift b/packages/core/ios/RNSentrySwiftLinkStub.swift deleted file mode 100644 index 7e456ef6c1..0000000000 --- a/packages/core/ios/RNSentrySwiftLinkStub.swift +++ /dev/null @@ -1,12 +0,0 @@ -// This file exists to force Xcode to link the Swift runtime compatibility -// libraries (e.g. libswiftCompatibility56, libswiftCompatibilityConcurrency) -// into RNSentry. Those libs are required by our vendored `Sentry.xcframework` -// static Swift library and Xcode only auto-links them when the consuming -// target itself contains Swift code — without this stub, linking a dynamic -// RNSentry framework fails with: -// Undefined symbols: "__swift_FORCE_LOAD_$_swiftCompatibility56" - -// A private, unused constant so the compiler emits a real object file. A -// pure-comment file compiles to nothing and would defeat the purpose of -// the stub. -private let _rnSentrySwiftLinkStub: Void = () diff --git a/packages/core/ios/RNSentryVersion.m b/packages/core/ios/RNSentryVersion.m index 5e1e1cafc9..903d38f0ff 100644 --- a/packages/core/ios/RNSentryVersion.m +++ b/packages/core/ios/RNSentryVersion.m @@ -3,4 +3,4 @@ NSString *const NATIVE_SDK_NAME = @"sentry.cocoa.react-native"; NSString *const REACT_NATIVE_SDK_NAME = @"sentry.javascript.react-native"; NSString *const REACT_NATIVE_SDK_PACKAGE_NAME = @"npm:@sentry/react-native"; -NSString *const REACT_NATIVE_SDK_PACKAGE_VERSION = @"8.18.0-alpha.3"; +NSString *const REACT_NATIVE_SDK_PACKAGE_VERSION = @"8.17.2"; diff --git a/packages/core/package.json b/packages/core/package.json index 0632974c59..08159ea9dc 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -2,7 +2,7 @@ "name": "@sentry/react-native", "homepage": "https://github.com/getsentry/sentry-react-native", "repository": "https://github.com/getsentry/sentry-react-native", - "version": "8.18.0-alpha.3", + "version": "8.17.2", "description": "Official Sentry SDK for react-native", "typings": "dist/js/index.d.ts", "types": "dist/js/index.d.ts", diff --git a/packages/core/scripts/sentry_utils.rb b/packages/core/scripts/sentry_utils.rb index 43a778c019..5dc57a3b52 100644 --- a/packages/core/scripts/sentry_utils.rb +++ b/packages/core/scripts/sentry_utils.rb @@ -40,128 +40,3 @@ def should_use_folly_flags(rn_version) def is_new_hermes_runtime(rn_version) return (rn_version[:major] >= 1 || (rn_version[:major] == 0 && rn_version[:minor] >= 81)) end - -require 'digest' -require 'fileutils' -require 'open-uri' - -# SHA256 checksums of `.xcframework.zip` assets published in -# sentry-cocoa GitHub releases (same value as the SPM binary target checksum -# in sentry-cocoa's `Package.swift`). Register the checksum for each -# sentry-cocoa version we ship a prebuilt xcframework for. -# -# Kept in sync with `sentry_cocoa_version` in `RNSentry.podspec` by -# `scripts/update-cocoa.sh set-version `, which downloads the new -# release archive, computes its SHA256, and rewrites the entry below. -SENTRY_COCOA_XCFRAMEWORK_CHECKSUMS = { - # `Sentry.xcframework.zip` — the static product. Its enclosing xcframework - # name matches the framework name inside (both `Sentry`), which CocoaPods - # requires to generate `-framework Sentry` correctly and to resolve the - # `Sentry` module. `Sentry-Dynamic.xcframework` would ship the same - # `Sentry.framework` inside but under a mismatched enclosing name, so - # CocoaPods generates `-framework Sentry-Dynamic` and fails at link. - '9.19.1' => { - 'Sentry' => 'd6d545af17e49851cda2747b0f45cde78ce08ea37709dde5a956c6b4671224e8', - }, -}.freeze - -# Static map from xcframework slice directory name to the Xcode SDK selector -# it should be attached to. `sentry-cocoa`'s `Sentry.xcframework` layout is -# stable across releases — same slice names come out of every build — so we -# hardcode the mapping rather than scanning the extracted bundle. Add a -# new entry here if `sentry-cocoa` ever ships a new platform slice. -SENTRY_XCFRAMEWORK_SLICES_BY_SDK = { - 'iphoneos' => %w[ios-arm64_arm64e], - 'iphonesimulator' => %w[ios-arm64_x86_64-simulator], - 'maccatalyst' => %w[ios-arm64_arm64e_x86_64-maccatalyst], - 'macosx' => %w[macos-arm64_arm64e_x86_64], - 'appletvos' => %w[tvos-arm64_arm64e], - 'appletvsimulator' => %w[tvos-arm64_x86_64-simulator], - 'watchos' => %w[watchos-arm64_arm64_32_arm64e_armv7k], - 'watchsimulator' => %w[watchos-arm64_x86_64-simulator], - 'xros' => %w[xros-arm64_arm64e], - 'xrsimulator' => %w[xros-arm64_x86_64-simulator], -}.freeze - -# Ensures `//.xcframework` exists. -# -# On first invocation, downloads the prebuilt xcframework zip from -# sentry-cocoa's GitHub release, verifies its SHA256 checksum against -# `SENTRY_COCOA_XCFRAMEWORK_CHECKSUMS`, and extracts it. Subsequent -# invocations are no-ops. Returns the absolute path to the extracted -# xcframework, which callers pass to `FRAMEWORK_SEARCH_PATHS`. -# -# The cache lives under a user-writable directory (`~/Library/Caches/ -# sentry-react-native/xcframeworks/` on macOS by default; override with -# `SENTRY_XCFRAMEWORK_CACHE_DIR`). Cannot live under the pod's own source -# tree because pnpm's isolated store makes `node_modules/@sentry/ -# react-native/ios/` read-only, and `Yarn PnP` doesn't materialize the -# package directory at all — writing there fails with `EACCES`. -# Deduplicating cache across multiple RN projects on the same machine -# is a nice side effect. -# -# Consuming sentry-cocoa this way (vs. through Xcode's SPM integration) -# avoids the Xcode 16/26 archive bug where a signed SPM binary xcframework's -# `Signatures/*.signature` file collides during the archive step. -def ensure_sentry_xcframework(version, product = 'Sentry') - cache_root = ENV['SENTRY_XCFRAMEWORK_CACHE_DIR'] || - File.expand_path('~/Library/Caches/sentry-react-native/xcframeworks') - vendor_dir = File.join(cache_root, version) - target_dir = File.join(vendor_dir, "#{product}.xcframework") - # Treat the presence of `Info.plist` inside the xcframework as the "healthy" - # sentinel rather than just the directory existence. A directory without - # `Info.plist` most likely came from an interrupted `unzip` and would - # otherwise silently short-circuit re-download here. - target_manifest = File.join(target_dir, 'Info.plist') - return target_dir if File.file?(target_manifest) - - expected_checksum = SENTRY_COCOA_XCFRAMEWORK_CHECKSUMS.dig(version, product) - unless expected_checksum - raise "sentry-cocoa xcframework checksum not registered for #{product} " \ - "#{version}. Add it to SENTRY_COCOA_XCFRAMEWORK_CHECKSUMS in " \ - "packages/core/scripts/sentry_utils.rb after bumping the version." - end - - # Wipe any stale partial extract from a previous interrupted run so we - # always start from a clean tree. - FileUtils.rm_rf(target_dir) - FileUtils.mkdir_p(vendor_dir) - zip_path = File.join(vendor_dir, "#{product}.xcframework.zip") - url = "https://github.com/getsentry/sentry-cocoa/releases/download/" \ - "#{version}/#{product}.xcframework.zip" - - Pod::UI.puts "[Sentry] Downloading #{product} #{version} from GitHub Releases…" if defined?(Pod::UI) - begin - URI.open(url, redirect: true) do |remote| - File.open(zip_path, 'wb') { |f| IO.copy_stream(remote, f) } - end - rescue OpenURI::HTTPError, SocketError, StandardError => e - FileUtils.rm_f(zip_path) - raise "Failed to download #{url}: #{e.class}: #{e.message}" - end - - actual_checksum = Digest::SHA256.file(zip_path).hexdigest - unless actual_checksum == expected_checksum - FileUtils.rm_f(zip_path) - raise "Checksum mismatch for #{product} #{version}: expected " \ - "#{expected_checksum}, got #{actual_checksum}" - end - - unless system('unzip', '-q', '-o', zip_path, '-d', vendor_dir) - raise "Failed to extract #{zip_path}" - end - FileUtils.rm_f(zip_path) - - # Guard against a release archive whose internal layout changed (e.g. a - # nested folder). Without this check, a wrong layout silently succeeds and - # then fails much later during `pod install` with a confusing "framework - # not found" error. - unless File.file?(target_manifest) - raise "Expected #{target_manifest} after extracting #{product}.xcframework.zip. " \ - "The sentry-cocoa release archive layout may have changed — update " \ - "the extraction logic in packages/core/scripts/sentry_utils.rb." - end - - target_dir -end - diff --git a/packages/core/src/js/version.ts b/packages/core/src/js/version.ts index 1e5a9bc94a..beb8478406 100644 --- a/packages/core/src/js/version.ts +++ b/packages/core/src/js/version.ts @@ -1,3 +1,3 @@ export const SDK_PACKAGE_NAME = 'npm:@sentry/react-native'; export const SDK_NAME = 'sentry.javascript.react-native'; -export const SDK_VERSION: string = '8.18.0-alpha.3'; +export const SDK_VERSION: string = '8.17.2'; diff --git a/packages/expo-upload-sourcemaps/package.json b/packages/expo-upload-sourcemaps/package.json index 0866c285d8..861af2efdf 100644 --- a/packages/expo-upload-sourcemaps/package.json +++ b/packages/expo-upload-sourcemaps/package.json @@ -1,6 +1,6 @@ { "name": "@sentry/expo-upload-sourcemaps", - "version": "8.18.0-alpha.3", + "version": "8.17.2", "description": "CLI to upload bundles and source maps from Expo builds to Sentry.", "homepage": "https://github.com/getsentry/sentry-react-native/tree/main/packages/expo-upload-sourcemaps", "repository": { diff --git a/performance-tests/TestAppPlain/package.json b/performance-tests/TestAppPlain/package.json index fe33146477..ebf44ec87e 100644 --- a/performance-tests/TestAppPlain/package.json +++ b/performance-tests/TestAppPlain/package.json @@ -1,6 +1,6 @@ { "name": "TestAppPlain", - "version": "8.18.0-alpha.3", + "version": "8.17.2", "private": true, "scripts": { "android": "react-native run-android", diff --git a/performance-tests/TestAppSentry/package.json b/performance-tests/TestAppSentry/package.json index bc13bd20e0..f3f7e4e232 100644 --- a/performance-tests/TestAppSentry/package.json +++ b/performance-tests/TestAppSentry/package.json @@ -1,6 +1,6 @@ { "name": "TestAppSentry", - "version": "8.18.0-alpha.3", + "version": "8.17.2", "private": true, "scripts": { "android": "react-native run-android", @@ -9,7 +9,7 @@ }, "dependencies": { "@react-native/new-app-screen": "0.86.0", - "@sentry/react-native": "8.18.0-alpha.3", + "@sentry/react-native": "8.17.2", "react": "19.2.3", "react-native": "0.86.0" }, diff --git a/samples/expo/app.json b/samples/expo/app.json index 7adac61874..251a295994 100644 --- a/samples/expo/app.json +++ b/samples/expo/app.json @@ -4,7 +4,7 @@ "slug": "sentry-react-native-expo-sample", "jsEngine": "hermes", "scheme": "sentry-expo-sample", - "version": "8.18.0-alpha.3", + "version": "8.17.2", "orientation": "portrait", "icon": "./assets/icon.png", "userInterfaceStyle": "light", @@ -19,7 +19,7 @@ "ios": { "supportsTablet": true, "bundleIdentifier": "io.sentry.expo.sample", - "buildNumber": "96" + "buildNumber": "95" }, "android": { "adaptiveIcon": { @@ -27,7 +27,7 @@ "backgroundColor": "#ffffff" }, "package": "io.sentry.expo.sample", - "versionCode": 96 + "versionCode": 95 }, "web": { "bundler": "metro", diff --git a/samples/expo/package.json b/samples/expo/package.json index 20eb0a319a..1de4058a66 100644 --- a/samples/expo/package.json +++ b/samples/expo/package.json @@ -1,6 +1,6 @@ { "name": "sentry-react-native-expo-sample", - "version": "8.18.0-alpha.3", + "version": "8.17.2", "main": "expo-router/entry", "scripts": { "start": "expo start", @@ -24,7 +24,7 @@ }, "dependencies": { "@sentry/core": "10.63.0", - "@sentry/react-native": "8.18.0-alpha.3", + "@sentry/react-native": "8.17.2", "@types/react": "~19.2.10", "expo": "^57.0.0", "expo-constants": "~57.0.2", diff --git a/samples/react-native-macos/package.json b/samples/react-native-macos/package.json index 715d654280..9991f7d815 100644 --- a/samples/react-native-macos/package.json +++ b/samples/react-native-macos/package.json @@ -1,6 +1,6 @@ { "name": "sentry-react-native-macos-sample", - "version": "8.18.0-alpha.3", + "version": "8.17.2", "private": true, "scripts": { "start": "react-native start --experimental-debugger", @@ -18,7 +18,7 @@ "@react-navigation/stack": "^6.3.20", "@sentry/core": "10.63.0", "@sentry/react": "10.63.0", - "@sentry/react-native": "8.18.0-alpha.3", + "@sentry/react-native": "8.17.2", "delay": "^6.0.0", "react": "19.1.4", "react-native": "0.81.6", diff --git a/samples/react-native/android/app/build.gradle b/samples/react-native/android/app/build.gradle index 5d507decf8..a1d8a3341f 100644 --- a/samples/react-native/android/app/build.gradle +++ b/samples/react-native/android/app/build.gradle @@ -130,8 +130,8 @@ android { applicationId "io.sentry.reactnative.sample" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 98 - versionName "8.18.0-alpha.3" + versionCode 97 + versionName "8.17.2" buildConfigField "boolean", "SENTRY_DISABLE_NATIVE_START", System.getenv('SENTRY_DISABLE_NATIVE_START') ?: String.valueOf(sentryDisableNativeStart) testBuildType System.getProperty('testBuildType', 'debug') diff --git a/samples/react-native/ios/sentryreactnativesample/Info.plist b/samples/react-native/ios/sentryreactnativesample/Info.plist index 47cdc78889..52cdbd4cfb 100644 --- a/samples/react-native/ios/sentryreactnativesample/Info.plist +++ b/samples/react-native/ios/sentryreactnativesample/Info.plist @@ -19,11 +19,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 8.18.0 + 8.17.2 CFBundleSignature ???? CFBundleVersion - 103 + 102 LSRequiresIPhoneOS NSAppTransportSecurity diff --git a/samples/react-native/ios/sentryreactnativesampleTests/Info.plist b/samples/react-native/ios/sentryreactnativesampleTests/Info.plist index fc41b29f19..4644e6ce2e 100644 --- a/samples/react-native/ios/sentryreactnativesampleTests/Info.plist +++ b/samples/react-native/ios/sentryreactnativesampleTests/Info.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 8.18.0 + 8.17.2 CFBundleSignature ???? CFBundleVersion - 103 + 102 diff --git a/samples/react-native/package.json b/samples/react-native/package.json index d501071444..92cea904d2 100644 --- a/samples/react-native/package.json +++ b/samples/react-native/package.json @@ -1,6 +1,6 @@ { "name": "sentry-react-native-sample", - "version": "8.18.0-alpha.3", + "version": "8.17.2", "private": true, "scripts": { "android": "react-native run-android", @@ -49,7 +49,7 @@ "@reduxjs/toolkit": "^2.8.2", "@sentry/core": "10.63.0", "@sentry/react": "10.63.0", - "@sentry/react-native": "8.18.0-alpha.3", + "@sentry/react-native": "8.17.2", "@shopify/flash-list": "^2.0.2", "delay": "^6.0.0", "react": "19.2.3", diff --git a/scripts/clang-format.sh b/scripts/clang-format.sh index b9e94c77d1..6a642f4215 100755 --- a/scripts/clang-format.sh +++ b/scripts/clang-format.sh @@ -64,7 +64,6 @@ cmd="find . -type f \( \ -path \"**android/build/**\" -or \ -path \"**.cxx/**\" -or \ -path \"**build/generated/**\" -or \ - -path \"**/DerivedData/**\" -or \ -path \"**/Carthage/Checkouts/*\" -or \ -path \"**/libs/**\" -or \ -path \"**/.yalc/**\" -or \ diff --git a/scripts/update-cocoa.sh b/scripts/update-cocoa.sh index 352f28c658..ed6f2e2919 100755 --- a/scripts/update-cocoa.sh +++ b/scripts/update-cocoa.sh @@ -1,60 +1,24 @@ #!/usr/bin/env bash set -euo pipefail -script_dir="$(cd "$(dirname "$0")" && pwd)" -podspec="$script_dir/../packages/core/RNSentry.podspec" -utils="$script_dir/../packages/core/scripts/sentry_utils.rb" - -content=$(cat "$podspec") +file="$(dirname "$0")/../packages/core/RNSentry.podspec" +content=$(cat $file) regex="(sentry_cocoa_version *= *)'([0-9\.]+)'" if ! [[ $content =~ $regex ]]; then - echo "Failed to find the plugin version in $podspec" + echo "Failed to find the plugin version in $file" exit 1 fi case $1 in get-version) - echo "${BASH_REMATCH[2]}" + echo ${BASH_REMATCH[2]} ;; get-repo) echo "https://github.com/getsentry/sentry-cocoa.git" ;; set-version) - new_version="$2" - - # 1. Update `sentry_cocoa_version` in the podspec. - newValue="${BASH_REMATCH[1]}'$new_version'" - printf '%s\n' "${content/${BASH_REMATCH[0]}/$newValue}" >"$podspec" - - # 2. Refresh the `Sentry.xcframework.zip` SHA256 checksum in - # `sentry_utils.rb`. The checksum table has a single version key - # that we rewrite in place — download the new archive, compute - # its SHA256, then patch the version key and the `'Sentry'` line. - # `pod install` verifies against this checksum on every fresh - # install so a stale value here breaks every user's build with a - # loud mismatch error rather than a silent corruption. - zip_url="https://github.com/getsentry/sentry-cocoa/releases/download/${new_version}/Sentry.xcframework.zip" - tmp_dir=$(mktemp -d) - trap 'rm -rf "$tmp_dir"' EXIT - echo "Fetching ${zip_url}..." - curl -fsSL --retry 3 -o "$tmp_dir/Sentry.xcframework.zip" "$zip_url" - new_sha=$(shasum -a 256 "$tmp_dir/Sentry.xcframework.zip" | awk '{print $1}') - echo "Sentry.xcframework.zip SHA256: ${new_sha}" - - # Update the version key (any semver-shaped key opening the hash). - perl -i -pe "s|'\\d+\\.\\d+\\.\\d+' => \\{|'${new_version}' => {|" "$utils" - # Update the `Sentry` checksum (a 64-char lowercase hex string). - perl -i -pe "s|'Sentry' => '[a-f0-9]{64}'|'Sentry' => '${new_sha}'|" "$utils" - - # Sanity-check: both lines got rewritten with the new values. - if ! grep -q "'${new_version}' =>" "$utils"; then - echo "Failed to rewrite the checksum version key in $utils" - exit 1 - fi - if ! grep -q "'Sentry' => '${new_sha}'" "$utils"; then - echo "Failed to rewrite the Sentry checksum in $utils" - exit 1 - fi + newValue="${BASH_REMATCH[1]}'$2'" + echo "${content/${BASH_REMATCH[0]}/$newValue}" >$file ;; *) echo "Unknown argument $1" diff --git a/yarn.lock b/yarn.lock index 75b5cf8797..b6c6a37e5a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9954,7 +9954,7 @@ __metadata: languageName: node linkType: hard -"@sentry/react-native@8.18.0-alpha.3, @sentry/react-native@workspace:packages/core": +"@sentry/react-native@8.17.2, @sentry/react-native@workspace:packages/core": version: 0.0.0-use.local resolution: "@sentry/react-native@workspace:packages/core" dependencies: @@ -11273,7 +11273,7 @@ __metadata: "@react-native/metro-config": 0.86.0 "@react-native/new-app-screen": 0.86.0 "@react-native/typescript-config": 0.86.0 - "@sentry/react-native": 8.18.0-alpha.3 + "@sentry/react-native": 8.17.2 "@types/jest": ^29.5.13 "@types/react": ^19.1.1 "@types/react-test-renderer": ^19.1.0 @@ -27278,7 +27278,7 @@ __metadata: "@babel/preset-env": ^7.25.3 "@babel/preset-typescript": ^7.18.6 "@sentry/core": 10.63.0 - "@sentry/react-native": 8.18.0-alpha.3 + "@sentry/react-native": 8.17.2 "@types/node": ^20.9.3 "@types/react": ^19.1.4 appium: 3.2.2 @@ -27308,7 +27308,7 @@ __metadata: "@babel/preset-env": ^7.26.0 "@sentry/babel-plugin-component-annotate": 5.3.0 "@sentry/core": 10.63.0 - "@sentry/react-native": 8.18.0-alpha.3 + "@sentry/react-native": 8.17.2 "@types/node": 20.10.4 "@types/react": ~19.2.10 expo: ^57.0.0 @@ -27350,7 +27350,7 @@ __metadata: "@react-navigation/stack": ^6.3.20 "@sentry/core": 10.63.0 "@sentry/react": 10.63.0 - "@sentry/react-native": 8.18.0-alpha.3 + "@sentry/react-native": 8.17.2 "@types/react": ^19.1.4 "@types/react-native-vector-icons": ^6.4.18 babel-plugin-module-resolver: ^5.0.0 @@ -27396,7 +27396,7 @@ __metadata: "@sentry/babel-plugin-component-annotate": 5.3.0 "@sentry/core": 10.63.0 "@sentry/react": 10.63.0 - "@sentry/react-native": 8.18.0-alpha.3 + "@sentry/react-native": 8.17.2 "@shopify/flash-list": ^2.0.2 "@testing-library/react-native": ^13.2.2 "@types/jest": ^29.5.14