Skip to content

Commit 13d64cf

Browse files
Merge from main (#4596)
1 parent 3fe08d5 commit 13d64cf

31 files changed

+255
-265
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
uses: ./.github/actions/environment
3636

3737
- name: Initialize CodeQL
38-
uses: github/codeql-action/init@192325c86100d080feab897ff886c34abd4c83a3 # pin@v2
38+
uses: github/codeql-action/init@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
3939
with:
4040
languages: csharp
4141

@@ -49,6 +49,6 @@ jobs:
4949
run: dotnet build Sentry-CI-CodeQL.slnf --no-restore --nologo
5050

5151
- name: Perform CodeQL Analysis
52-
uses: github/codeql-action/analyze@192325c86100d080feab897ff886c34abd4c83a3 # pin@v2
52+
uses: github/codeql-action/analyze@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5
5353
with:
5454
category: '/language:csharp'

CHANGELOG.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,30 @@
22

33
## 6.0.0-preview.1
44

5+
### BREAKING CHANGES
6+
7+
- This release adds support for .NET 10 and drops support for net8.0-android, net8.0-ios, net8.0-maccatalyst and net8.0-windows10.0.19041.0 ([#4461](https://github.com/getsentry/sentry-dotnet/pull/4461))
8+
- Added support for v3 of the Android AssemblyStore format that is used in .NET 10 and dropped support for v1 that was used in .NET 8 ([#4583](https://github.com/getsentry/sentry-dotnet/pull/4583))
9+
10+
## 5.16.0
11+
512
### Features
613

714
- Added `EnableBackpressureHandling` option for Automatic backpressure handling. When enabled this automatically reduces the sample rate when the SDK detects events being dropped. ([#4452](https://github.com/getsentry/sentry-dotnet/pull/4452))
815
- Add (experimental) _Structured Logs_ integration for `Serilog` ([#4462](https://github.com/getsentry/sentry-dotnet/pull/4462))
916

1017
### Fixes
1118

19+
- Templates are no longer sent with Structured Logs that have no parameters ([#4544](https://github.com/getsentry/sentry-dotnet/pull/4544))
20+
- Parent-Span-IDs are no longer sent with Structured Logs when recorded without an active Span ([#4565](https://github.com/getsentry/sentry-dotnet/pull/4565))
1221
- Upload linked PDBs to fix non-IL-stripped symbolication for iOS ([#4527](https://github.com/getsentry/sentry-dotnet/pull/4527))
1322
- In MAUI Android apps, generate and inject UUID to APK and upload ProGuard mapping to Sentry with the UUID ([#4532](https://github.com/getsentry/sentry-dotnet/pull/4532))
1423
- Fixed WASM0001 warning when building Blazor WebAssembly projects ([#4519](https://github.com/getsentry/sentry-dotnet/pull/4519))
1524

25+
### API Changes
26+
27+
- Remove `ExperimentalAttribute` from all _Structured Logs_ APIs, and remove `Experimental` property from `SentrySdk`, but keep `Experimental` property on `SentryOptions` ([#4567](https://github.com/getsentry/sentry-dotnet/pull/4567))
28+
1629
### Dependencies
1730

1831
- Bump Cocoa SDK from v8.56.0 to v8.56.2 ([#4555](https://github.com/getsentry/sentry-dotnet/pull/4555), [#4572](https://github.com/getsentry/sentry-dotnet/pull/4572))
@@ -27,17 +40,13 @@
2740

2841
### Dependencies
2942

43+
- Bump CLI from v2.54.0 to v2.56.0 ([#4556](https://github.com/getsentry/sentry-dotnet/pull/4556), [#4577](https://github.com/getsentry/sentry-dotnet/pull/4577))
44+
- [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2560)
45+
- [diff](https://github.com/getsentry/sentry-cli/compare/2.54.0...2.56.0)
3046
- Bump Java SDK from v8.21.1 to v8.22.0 ([#4552](https://github.com/getsentry/sentry-dotnet/pull/4552))
3147
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#8220)
3248
- [diff](https://github.com/getsentry/sentry-java/compare/8.21.1...8.22.0)
3349

34-
## Version 6.0.0
35-
36-
### BREAKING CHANGES
37-
38-
- This release adds support for .NET 10 and drops support for net8.0-android, net8.0-ios, net8.0-maccatalyst and net8.0-windows10.0.19041.0 ([#4461](https://github.com/getsentry/sentry-dotnet/pull/4461))
39-
- Added support for v3 of the Android AssemblyStore format that is used in .NET 10 and dropped support for v1 that was used in .NET 8 ([#4583](https://github.com/getsentry/sentry-dotnet/pull/4583))
40-
4150
## 5.15.1
4251

4352
### Fixes
@@ -80,8 +89,8 @@
8089
### Dependencies
8190

8291
- Bump sentry-cocoa from 8.39.0 to 8.55.1 ([#4442](https://github.com/getsentry/sentry-dotnet/pull/4442), [#4483](https://github.com/getsentry/sentry-dotnet/pull/4483), [#4485](https://github.com/getsentry/sentry-dotnet/pull/4485))
83-
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8551)
84-
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.39.0...8.55.1)
92+
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8551)
93+
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.39.0...8.55.1)
8594
- Bump Native SDK from v0.9.1 to v0.10.1 ([#4436](https://github.com/getsentry/sentry-dotnet/pull/4436), [#4492](https://github.com/getsentry/sentry-dotnet/pull/4492))
8695
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0101)
8796
- [diff](https://github.com/getsentry/sentry-native/compare/0.9.1...0.10.1)

CONTRIBUTING.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,26 @@ Once changes to Ben.Demystifier have been merged into the main branch then, the
171171
should be updated from the main branch and the `modules/make-internal.sh` script run again (if necessary). This repo
172172
should reference the most recent commit on the `internal` branch of Ben.Demystifier then (functionally identical to the
173173
main branch - the only difference being the changes to member visibility).
174+
175+
## Local Sentry Cocoa SDK checkout
176+
177+
By default, `Sentry.Bindings.Cocoa` downloads a pre-built Sentry Cocoa SDK from
178+
GitHub Releases. The version is specified in `modules/sentry-cocoa.properties`.
179+
180+
If you want to build an unreleased Sentry Cocoa SDK version from source instead,
181+
replace the pre-built SDK with [getsentry/sentry-cocoa](https://github.com/getsentry/sentry-cocoa/)
182+
by cloning it into the `modules/sentry-cocoa` directory:
183+
184+
```sh
185+
$ rm -rf modules/sentry-cocoa
186+
$ gh repo clone getsentry/sentry-cocoa modules/sentry-cocoa
187+
$ dotnet build ... # uses modules/sentry-cocoa as is
188+
```
189+
190+
To switch back to the pre-built SDK, delete the `modules/sentry-cocoa` directory
191+
and let the next build download the pre-built SDK again:
192+
193+
```sh
194+
$ rm -rf modules/sentry-cocoa
195+
$ dotnet build ... # downloads pre-built Cocoa SDK into modules/sentry-cocoa
196+
```

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103

104104
<!-- Set the version and local path for Sentry CLI (downloaded in the restore phase of Sentry.csproj) -->
105105
<PropertyGroup Condition="'$(SolutionName)' != 'Sentry.Unity'">
106-
<SentryCLIVersion>2.55.0</SentryCLIVersion>
106+
<SentryCLIVersion>2.56.0</SentryCLIVersion>
107107
<SentryCLIDirectory>$(MSBuildThisFileDirectory)tools\sentry-cli\$(SentryCLIVersion)\</SentryCLIDirectory>
108108
</PropertyGroup>
109109

samples/Sentry.Samples.Console.Basic/Program.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
// This option tells Sentry to capture 100% of traces. You still need to start transactions and spans.
3838
options.TracesSampleRate = 1.0;
3939

40-
// This option enables Sentry Logs created via SentrySdk.Experimental.Logger.
40+
// This option enables Sentry Logs created via SentrySdk.Logger.
4141
options.Experimental.EnableLogs = true;
4242
options.Experimental.SetBeforeSendLog(static log =>
4343
{
@@ -73,7 +73,7 @@ async Task FirstFunction()
7373
var httpClient = new HttpClient(messageHandler, true);
7474
var html = await httpClient.GetStringAsync("https://example.com/");
7575
WriteLine(html);
76-
SentrySdk.Experimental.Logger.LogInfo("HTTP Request completed.");
76+
SentrySdk.Logger.LogInfo("HTTP Request completed.");
7777
}
7878

7979
async Task SecondFunction()
@@ -94,7 +94,7 @@ async Task SecondFunction()
9494
SentrySdk.CaptureException(exception);
9595
span.Finish(exception);
9696

97-
SentrySdk.Experimental.Logger.LogError(static log => log.SetAttribute("method", nameof(SecondFunction)),
97+
SentrySdk.Logger.LogError(static log => log.SetAttribute("method", nameof(SecondFunction)),
9898
"Error with message: {0}", exception.Message);
9999
}
100100

@@ -109,7 +109,7 @@ async Task ThirdFunction()
109109
// Simulate doing some work
110110
await Task.Delay(100);
111111

112-
SentrySdk.Experimental.Logger.LogFatal(static log => log.SetAttribute("suppress", true),
112+
SentrySdk.Logger.LogFatal(static log => log.SetAttribute("suppress", true),
113113
"Crash imminent!");
114114

115115
// This is an example of an unhandled exception. It will be captured automatically.

scripts/build-sentry-cocoa.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ xcodebuild archive -project Sentry.xcodeproj \
2525
-archivePath ./Carthage/output-ios.xcarchive \
2626
SKIP_INSTALL=NO \
2727
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
28+
./scripts/remove-architectures.sh ./Carthage/output-ios.xcarchive arm64e
2829
xcodebuild archive -project Sentry.xcodeproj \
2930
-scheme Sentry \
3031
-configuration Release \
@@ -47,6 +48,7 @@ xcodebuild archive -project Sentry.xcodeproj \
4748
-archivePath ./Carthage/output-maccatalyst.xcarchive \
4849
SKIP_INSTALL=NO \
4950
BUILD_LIBRARY_FOR_DISTRIBUTION=YES
51+
./scripts/remove-architectures.sh ./Carthage/output-maccatalyst.xcarchive arm64e
5052
xcodebuild -create-xcframework \
5153
-framework ./Carthage/output-maccatalyst.xcarchive/Products/Library/Frameworks/Sentry.framework \
5254
-output ./Carthage/Build-maccatalyst/Sentry.xcframework
@@ -60,7 +62,7 @@ find Carthage/Build-ios/Sentry.xcframework/ios-arm64 -name '*.h' -exec cp {} Car
6062
find Carthage/Build* \( -name Headers -o -name PrivateHeaders -o -name Modules \) -exec rm -rf {} +
6163
rm -rf Carthage/output-*
6264

63-
cp ../../.git/modules/modules/sentry-cocoa/HEAD Carthage/.built-from-sha
65+
cp .git/HEAD Carthage/.built-from-sha
6466
echo ""
6567

6668
popd >/dev/null

scripts/generate-cocoa-bindings.ps1

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@ Set-StrictMode -Version Latest
44
$ErrorActionPreference = 'Stop'
55

66
$RootPath = (Get-Item $PSScriptRoot).Parent.FullName
7-
$CocoaSdkPath = "$RootPath/modules/sentry-cocoa/Sentry.framework"
7+
$CocoaSdkPath = "$RootPath/modules/sentry-cocoa"
8+
if (Test-Path "$CocoaSdkPath/.git")
9+
{
10+
# Cocoa SDK cloned to modules/sentry-cocoa for local development
11+
$HeadersPath = "$CocoaSdkPath/Carthage/Headers"
12+
$PrivateHeadersPath = "$CocoaSdkPath/Carthage/Headers"
13+
}
14+
else
15+
{
16+
# Cocoa SDK downloaded from GitHub releases and extracted into modules/sentry-cocoa
17+
$HeadersPath = "$CocoaSdkPath/Sentry.framework/Headers"
18+
$PrivateHeadersPath = "$CocoaSdkPath/Sentry.framework/PrivateHeaders"
19+
}
820
$BindingsPath = "$RootPath/src/Sentry.Bindings.Cocoa"
921
$BackupPath = "$BindingsPath/obj/_unpatched"
1022

@@ -101,7 +113,7 @@ Write-Output "iPhoneSdkVersion: $iPhoneSdkVersion"
101113
# ...instead of:
102114
# `#import "SomeHeader.h"`
103115
# This causes sharpie to fail resolve those headers
104-
$filesToPatch = Get-ChildItem -Path "$CocoaSdkPath/Headers" -Filter *.h -Recurse | Select-Object -ExpandProperty FullName
116+
$filesToPatch = Get-ChildItem -Path "$HeadersPath" -Filter *.h -Recurse | Select-Object -ExpandProperty FullName
105117
foreach ($file in $filesToPatch)
106118
{
107119
if (Test-Path $file)
@@ -116,7 +128,7 @@ foreach ($file in $filesToPatch)
116128
Write-Host "File not found: $file"
117129
}
118130
}
119-
$privateHeaderFile = "$CocoaSdkPath/PrivateHeaders/PrivatesHeader.h"
131+
$privateHeaderFile = "$PrivateHeadersPath/PrivatesHeader.h"
120132
if (Test-Path $privateHeaderFile)
121133
{
122134
$content = Get-Content -Path $privateHeaderFile -Raw
@@ -134,8 +146,8 @@ else
134146
Write-Output 'Generating bindings with Objective Sharpie.'
135147
sharpie bind -sdk $iPhoneSdkVersion `
136148
-scope "$CocoaSdkPath" `
137-
"$CocoaSdkPath/Headers/Sentry.h" `
138-
"$CocoaSdkPath/PrivateHeaders/PrivateSentrySDKOnly.h" `
149+
"$HeadersPath/Sentry.h" `
150+
"$PrivateHeadersPath/PrivateSentrySDKOnly.h" `
139151
-o $BindingsPath `
140152
-c -Wno-objc-property-no-attribute
141153

src/Sentry.Bindings.Android/Sentry.Bindings.Android.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFrameworks>$(LatestAndroidTfm);$(PreviousAndroidTfm)</TargetFrameworks>
4-
<SentryAndroidSdkVersion>8.22.0</SentryAndroidSdkVersion>
4+
<SentryAndroidSdkVersion>8.23.0</SentryAndroidSdkVersion>
55
<SentryAndroidSdkDirectory>$(BaseIntermediateOutputPath)sdks\$(TargetFramework)\Sentry\Android\$(SentryAndroidSdkVersion)\</SentryAndroidSdkDirectory>
66
<!-- This gets resolved by the DownloadSentryAndroidSdk target -->
77
<SentryNativeNdkVersion></SentryNativeNdkVersion>

src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@
1212
<SentryCocoaProperties>$([System.IO.File]::ReadAllText("$(MSBuildThisFileDirectory)../../modules/sentry-cocoa.properties"))</SentryCocoaProperties>
1313
<SentryCocoaVersion>$([System.Text.RegularExpressions.Regex]::Match($(SentryCocoaProperties), 'version\s*=\s*([^\s]+)').Groups[1].Value)</SentryCocoaVersion>
1414
<SentryCocoaFramework>$(SentryCocoaCache)Sentry-$(SentryCocoaVersion).xcframework</SentryCocoaFramework>
15+
<SentryCocoaBindingInputs>../../modules/sentry-cocoa.properties;../../scripts/generate-cocoa-bindings.ps1</SentryCocoaBindingInputs>
1516
<!-- SentrySpan.g.cs: error CS0108: 'ISentrySpan.Serialize()' hides inherited member 'ISentrySerializable.Serialize()'. Use the new keyword if hiding was intended -->
1617
<NoWarn>$(NoWarn);CS0108</NoWarn>
1718
</PropertyGroup>
1819

20+
<!-- Override values for local Cocoa SDK builds -->
21+
<PropertyGroup Condition="Exists('$(SentryCocoaCache).git')">
22+
<SentryCocoaFramework>$(SentryCocoaCache)Carthage\Build-$(TargetPlatformIdentifier)\Sentry.xcframework</SentryCocoaFramework>
23+
<SentryCocoaBindingInputs>../../scripts/generate-cocoa-bindings.ps1;../../modules/sentry-cocoa/Carthage/.built-from-sha</SentryCocoaBindingInputs>
24+
</PropertyGroup>
25+
1926
<!-- Build empty assemblies when not on macOS, to pass the solution build. -->
2027
<ItemGroup Condition="!$([MSBuild]::IsOSPlatform('OSX'))">
2128
<Compile Remove="*" />
@@ -52,8 +59,8 @@
5259
</ItemGroup>
5360

5461
<!-- Downloads and sets up the Cocoa SDK: dotnet msbuild /t:setupCocoaSDK src/Sentry.Bindings.Cocoa/Sentry.Bindings.Cocoa.csproj -->
55-
<Target Name="_SetupCocoaSDK"
56-
Condition="$([MSBuild]::IsOSPlatform('OSX')) And !Exists('$(SentryCocoaFramework)')">
62+
<Target Name="_DownloadCocoaSDK"
63+
Condition="$([MSBuild]::IsOSPlatform('OSX')) And !Exists('$(SentryCocoaCache).git') And !Exists('$(SentryCocoaFramework)')">
5764

5865
<Message Importance="High" Text="Setting up the Cocoa SDK version '$(SentryCocoaVersion)'." />
5966

@@ -84,14 +91,28 @@
8491
SkipUnchangedFiles="true" />
8592
</Target>
8693

94+
<!-- Build the Sentry Cocoa SDK from source -->
95+
<Target Name="_BuildCocoaSDK"
96+
Condition="$([MSBuild]::IsOSPlatform('OSX')) And Exists('$(SentryCocoaCache).git')"
97+
Inputs="..\..\modules\sentry-cocoa\.git\HEAD;..\..\scripts\build-sentry-cocoa.sh" Outputs="..\..\modules\sentry-cocoa\Carthage\.built-from-sha">
98+
99+
<Message Importance="High" Text="Building the Cocoa SDK from source." />
100+
<Exec Command="bash ../../scripts/build-sentry-cocoa.sh" IgnoreStandardErrorWarningFormat="true" />
101+
</Target>
102+
103+
<!-- Choose between download and build -->
104+
<Target Name="_SetupCocoaSDK"
105+
DependsOnTargets="_DownloadCocoaSDK;_BuildCocoaSDK"
106+
Condition="$([MSBuild]::IsOSPlatform('OSX'))" />
107+
87108
<!-- Setup exactly once: https://learn.microsoft.com/visualstudio/msbuild/run-target-exactly-once -->
88109
<Target Name="SetupCocoaSDKBeforeOuterBuild" DependsOnTargets="_SetupCocoaSDK"
89-
Condition="$([MSBuild]::IsOSPlatform('OSX')) And !Exists('$(SentryCocoaFramework)')"
110+
Condition="$([MSBuild]::IsOSPlatform('OSX'))"
90111
BeforeTargets="DispatchToInnerBuilds" />
91112

92113
<Target Name="SetupCocoaSDK"
93114
BeforeTargets="BeforeBuild"
94-
Condition="$([MSBuild]::IsOSPlatform('OSX')) And !Exists('$(SentryCocoaFramework)')">
115+
Condition="$([MSBuild]::IsOSPlatform('OSX'))">
95116
<!-- Setup exactly once: https://learn.microsoft.com/visualstudio/msbuild/run-target-exactly-once -->
96117
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="_SetupCocoaSDK" RemoveProperties="TargetFramework" />
97118
</Target>
@@ -102,8 +123,8 @@
102123

103124
<!-- Generate bindings -->
104125
<Target Name="_GenerateSentryCocoaBindings" AfterTargets="SetupCocoaSDK"
105-
Condition="$([MSBuild]::IsOSPlatform('OSX')) and Exists('$(SentryCocoaFrameworkHeaders)')"
106-
Inputs="../../modules/sentry-cocoa.properties;../../scripts/generate-cocoa-bindings.ps1"
126+
Condition="$([MSBuild]::IsOSPlatform('OSX'))"
127+
Inputs="$(SentryCocoaBindingInputs)"
107128
Outputs="ApiDefinitions.cs;StructsAndEnums.cs">
108129
<MSBuild Projects="$(MSBuildProjectFile)" Targets="_InnerGenerateSentryCocoaBindings" Properties="TargetFramework=once" />
109130
</Target>

0 commit comments

Comments
 (0)