From ec7702c8f96b6cc498ccef34b60e15672e684757 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Wed, 10 Apr 2024 14:50:11 +0200 Subject: [PATCH 1/4] fix bindings --- scripts/generate-cocoa-bindings.ps1 | 12 ++++++++++-- src/Sentry.Bindings.Cocoa/ApiDefinitions.cs | 14 -------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/scripts/generate-cocoa-bindings.ps1 b/scripts/generate-cocoa-bindings.ps1 index a49124802f..1c48fde4af 100644 --- a/scripts/generate-cocoa-bindings.ps1 +++ b/scripts/generate-cocoa-bindings.ps1 @@ -38,7 +38,8 @@ if (!(Test-Path '/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/ } # Get iPhone SDK version -$iPhoneSdkVersion = sharpie xcode -sdks | grep -o -m 1 'iphoneos\S*' +# $iPhoneSdkVersion = sharpie xcode -sdks | grep -o -m 1 'iphoneos\S*' +$iPhoneSdkVersion = "iphoneos17.2" Write-Output "iPhoneSdkVersion: $iPhoneSdkVersion" # Generate bindings @@ -139,17 +140,24 @@ $Text = $Text -replace '(?ms)@protocol (SentrySerializable|SentrySpan).+?\[Proto $Text = $Text -replace 'interface SentrySpan\b', "[BaseType (typeof(NSObject))]`n`$&" # Fix string constants -$Text = $Text -replace 'byte\[\] SentryVersionString', "[PlainString]`n NSString SentryVersionString" $Text = $Text -replace '(?m)(.*\n){2}^\s{4}NSString k.+?\n\n?', '' $Text = $Text -replace '(?m)(.*\n){4}^partial interface Constants\n{\n}\n', '' $Text = $Text -replace '\[Verify \(ConstantsInterfaceAssociation\)\]\n', '' +# Remove SentryVersionNumber +$Text = $Text -replace '.*SentryVersionNumber.*\n?', '' + +# Remove SentryVersionString +$Text = $Text -replace '.*SentryVersionString.*\n?', '' + # Remove duplicate attributes $s = 'partial interface Constants' $t = $Text -split $s, 2 $t[1] = $t[1] -replace "\[Static\]\n\[Internal\]\n$s", $s $Text = $t -join $s +$Text = $Text -replace '\[Static\]\s*\[Internal\]\s*partial\s+interface\s+Constants\s\{[\s\n]*\}\n\n', '' + # Update MethodToProperty translations $Text = $Text -replace '(Export \("get\w+"\)\]\n)\s*\[Verify \(MethodToProperty\)\]\n(.+ \{ get; \})', '$1$2' $Text = $Text -replace '\[Verify \(MethodToProperty\)\]\n\s*(.+ (?:Hash|Value|DefaultIntegrations) \{ get; \})', '$1' diff --git a/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs b/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs index 924cb19a46..6cc492a195 100644 --- a/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs +++ b/src/Sentry.Bindings.Cocoa/ApiDefinitions.cs @@ -10,20 +10,6 @@ namespace Sentry.CocoaSdk; -[Static] -[Internal] -partial interface Constants -{ - // extern double SentryVersionNumber; - [Field ("SentryVersionNumber", "__Internal")] - double SentryVersionNumber { get; } - - // extern const unsigned char[] SentryVersionString; - [Field ("SentryVersionString", "__Internal")] - [PlainString] - NSString SentryVersionString { get; } -} - // typedef void (^SentryRequestFinished)(NSError * _Nullable); [Internal] delegate void SentryRequestFinished ([NullAllowed] NSError error); From 6969263e439f80a479dd64770cf682ccd139c1ad Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Wed, 10 Apr 2024 14:53:29 +0200 Subject: [PATCH 2/4] added comment --- scripts/generate-cocoa-bindings.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/generate-cocoa-bindings.ps1 b/scripts/generate-cocoa-bindings.ps1 index 1c48fde4af..86be049965 100644 --- a/scripts/generate-cocoa-bindings.ps1 +++ b/scripts/generate-cocoa-bindings.ps1 @@ -156,6 +156,7 @@ $t = $Text -split $s, 2 $t[1] = $t[1] -replace "\[Static\]\n\[Internal\]\n$s", $s $Text = $t -join $s +# Remove empty Constants block $Text = $Text -replace '\[Static\]\s*\[Internal\]\s*partial\s+interface\s+Constants\s\{[\s\n]*\}\n\n', '' # Update MethodToProperty translations From 4970574c00834d016cd213f2571a8397a9fc5502 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Wed, 10 Apr 2024 15:02:06 +0200 Subject: [PATCH 3/4] revert iOS sdk pin --- scripts/generate-cocoa-bindings.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/generate-cocoa-bindings.ps1 b/scripts/generate-cocoa-bindings.ps1 index 86be049965..2e37a8926c 100644 --- a/scripts/generate-cocoa-bindings.ps1 +++ b/scripts/generate-cocoa-bindings.ps1 @@ -38,8 +38,7 @@ if (!(Test-Path '/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/ } # Get iPhone SDK version -# $iPhoneSdkVersion = sharpie xcode -sdks | grep -o -m 1 'iphoneos\S*' -$iPhoneSdkVersion = "iphoneos17.2" +$iPhoneSdkVersion = sharpie xcode -sdks | grep -o -m 1 'iphoneos\S*' Write-Output "iPhoneSdkVersion: $iPhoneSdkVersion" # Generate bindings From f87ffd10ba1ceb7e46f79f9f36ba0379d2ea41d2 Mon Sep 17 00:00:00 2001 From: bitsandfoxes Date: Wed, 10 Apr 2024 15:05:17 +0200 Subject: [PATCH 4/4] Upladed Sentry SDK --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e0aab881b..4436f1bd6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Fix missing exception StackTraces in some situations ([#3215](https://github.com/getsentry/sentry-dotnet/pull/3215)) - Scopes now get applied to OTEL spans in ASP.NET Core ([#3221](https://github.com/getsentry/sentry-dotnet/pull/3221)) - Fixed InvalidCastException when setting the SampleRate on Android ([#3258](https://github.com/getsentry/sentry-dotnet/pull/3258)) +- Fixed MAUI iOS build issue related to `SentryVersionNumber` and `SentryVersionString` ([#3278](https://github.com/getsentry/sentry-dotnet/pull/3278)) ### API changes