Skip to content

Commit a421af5

Browse files
Address Trim warnings and prevent future regressions (#3841)
1 parent 1ecab82 commit a421af5

File tree

74 files changed

+9337
-71
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+9337
-71
lines changed

.generated.NoMobile.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.Analyzers.Tests", "t
193193
EndProject
194194
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.Samples.Console.HeapDump", "samples\Sentry.Samples.Console.HeapDump\Sentry.Samples.Console.HeapDump.csproj", "{D7DF0B26-AD43-4F8B-9BFE-C4471CCC9821}"
195195
EndProject
196+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.TrimTest", "test\Sentry.TrimTest\Sentry.TrimTest.csproj", "{6030B748-0000-43B5-B8A8-399AA42F5229}"
197+
EndProject
198+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.MauiTrimTest", "test\Sentry.MauiTrimTest\Sentry.MauiTrimTest.csproj", "{DF92E098-822C-4B94-B96B-56BFB91FBB54}"
199+
EndProject
196200
Global
197201
GlobalSection(SolutionConfigurationPlatforms) = preSolution
198202
Debug|Any CPU = Debug|Any CPU
@@ -520,6 +524,14 @@ Global
520524
{D7DF0B26-AD43-4F8B-9BFE-C4471CCC9821}.Debug|Any CPU.Build.0 = Debug|Any CPU
521525
{D7DF0B26-AD43-4F8B-9BFE-C4471CCC9821}.Release|Any CPU.ActiveCfg = Release|Any CPU
522526
{D7DF0B26-AD43-4F8B-9BFE-C4471CCC9821}.Release|Any CPU.Build.0 = Release|Any CPU
527+
{6030B748-0000-43B5-B8A8-399AA42F5229}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
528+
{6030B748-0000-43B5-B8A8-399AA42F5229}.Debug|Any CPU.Build.0 = Debug|Any CPU
529+
{6030B748-0000-43B5-B8A8-399AA42F5229}.Release|Any CPU.ActiveCfg = Release|Any CPU
530+
{6030B748-0000-43B5-B8A8-399AA42F5229}.Release|Any CPU.Build.0 = Release|Any CPU
531+
{DF92E098-822C-4B94-B96B-56BFB91FBB54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
532+
{DF92E098-822C-4B94-B96B-56BFB91FBB54}.Debug|Any CPU.Build.0 = Debug|Any CPU
533+
{DF92E098-822C-4B94-B96B-56BFB91FBB54}.Release|Any CPU.ActiveCfg = Release|Any CPU
534+
{DF92E098-822C-4B94-B96B-56BFB91FBB54}.Release|Any CPU.Build.0 = Release|Any CPU
523535
EndGlobalSection
524536
GlobalSection(SolutionProperties) = preSolution
525537
HideSolutionNode = FALSE
@@ -605,5 +617,7 @@ Global
605617
{E36C8DCA-464E-41CB-B189-F58553AAA8D4} = {230B9384-90FD-4551-A5DE-1A5C197F25B6}
606618
{5A17FEF9-07BB-47B8-9883-9C2CC93F09E8} = {6987A1CC-608E-4868-A02C-09D30C8B7B2D}
607619
{D7DF0B26-AD43-4F8B-9BFE-C4471CCC9821} = {21B42F60-5802-404E-90F0-AEBCC56760C0}
620+
{6030B748-0000-43B5-B8A8-399AA42F5229} = {6987A1CC-608E-4868-A02C-09D30C8B7B2D}
621+
{DF92E098-822C-4B94-B96B-56BFB91FBB54} = {6987A1CC-608E-4868-A02C-09D30C8B7B2D}
608622
EndGlobalSection
609623
EndGlobal

.github/actions/environment/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ runs:
1515
- name: Pin the Xcode Version
1616
if: runner.os == 'macOS'
1717
shell: bash
18-
run: sudo xcode-select --switch /Applications/Xcode_16.0.app
18+
run: sudo xcode-select --switch /Applications/Xcode_16.2.app
1919

2020
# Needed for Android SDK setup step
2121
- uses: actions/setup-java@v3

.github/workflows/build.yml

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
# Pin macos to get the version of XCode that we need: https://github.com/actions/runner-images/issues/10703
19+
# Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703
2020
os: [ubuntu-latest, windows-latest, macos-15]
2121

2222
steps:
@@ -53,7 +53,7 @@ jobs:
5353
strategy:
5454
fail-fast: false
5555
matrix:
56-
# Pin macos to get the version of XCode that we need: https://github.com/actions/runner-images/issues/10703
56+
# Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703
5757
os: [ubuntu-latest, windows-latest, macos-15]
5858

5959
steps:
@@ -154,7 +154,7 @@ jobs:
154154
strategy:
155155
fail-fast: false
156156
matrix:
157-
# Pin macos to get the version of XCode that we need: https://github.com/actions/runner-images/issues/10703
157+
# Pin macos to get the version of Xcode that we need: https://github.com/actions/runner-images/issues/10703
158158
os: [ubuntu-latest, windows-latest, macos-15]
159159

160160
steps:
@@ -187,6 +187,52 @@ jobs:
187187
with:
188188
path: integration-test
189189

190+
191+
trim-analysis:
192+
name: Trim analysis
193+
runs-on: macos-15
194+
195+
steps:
196+
- name: Checkout
197+
uses: actions/checkout@v4
198+
with:
199+
submodules: recursive
200+
fetch-depth: 2 # default is 1 and codecov needs > 1
201+
202+
# We use macOS for the final publishing build so we get all the iOS/macCatalyst targets in the packages
203+
- name: Set Environment Variables
204+
run: echo "CI_PUBLISHING_BUILD=true" >> $GITHUB_ENV
205+
206+
- name: Download sentry-native (macOS)
207+
uses: actions/cache/restore@v4
208+
with:
209+
path: src/Sentry/Platforms/Native/sentry-native
210+
key: sentry-native-macOS-${{ hashFiles('scripts/build-sentry-native.ps1') }}-${{ hashFiles('.git/modules/modules/sentry-native/HEAD') }}
211+
fail-on-cache-miss: true
212+
213+
- name: Setup Environment
214+
uses: ./.github/actions/environment
215+
216+
- name: Build Native Dependencies
217+
uses: ./.github/actions/buildnative
218+
219+
- name: Install Android SDKs
220+
if: runner.os == 'macOS'
221+
run: |
222+
dotnet build src/Sentry/Sentry.csproj -t:InstallAndroidDependencies -f:net8.0-android34.0 -p:AcceptAndroidSDKLicenses=True -p:AndroidSdkPath="/usr/local/lib/android/sdk/"
223+
224+
- name: Publish Test app (macOS)
225+
run: dotnet publish test/Sentry.TrimTest/Sentry.TrimTest.csproj -c Release -r osx-arm64
226+
227+
- name: Publish Test app (Android)
228+
run: dotnet publish test/Sentry.MauiTrimTest/Sentry.MauiTrimTest.csproj -c Release -f net9.0-android35.0 -r android-arm64
229+
230+
# We can't publish iOS applications on CI yet. We'd need a valid bundle identifier and to install the relevant
231+
# certificates/profiles on CI (presumably certs associated with the Sentry org).
232+
# See https://youtrack.jetbrains.com/issue/RIDER-17115/Could-not-find-any-available-provisioning-profiles-for-iOS
233+
# - name: Publish Test app (iOS)
234+
# run: dotnet publish test/Sentry.MauiTrimTest/Sentry.MauiTrimTest.csproj -c Release -f net9.0-ios18.0 -r ios-arm64
235+
190236
test-solution-filters:
191237
runs-on: ubuntu-latest
192238
if: ${{ !startsWith(github.ref_name, 'release/') }}

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- Fixed JNI Error when accessing Android device data from multiple threads ([#3802](https://github.com/getsentry/sentry-dotnet/pull/3802))
1212
- Android - fix bug that prevents logcat.log from getting attached to unhandled events (SIGSEGV Segfault) ([#3694](https://github.com/getsentry/sentry-dotnet/pull/3694))
1313
- Fix "System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'idData')" error propagating OpenTelemetry span ids ([#3850](https://github.com/getsentry/sentry-dotnet/pull/3850))
14+
- Address Trim warnings so that MAUI applications can be compiled AOT ([#3841](https://github.com/getsentry/sentry-dotnet/pull/3841))
1415

1516
### Dependencies
1617

Sentry-CI-Build-Linux.slnf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"test\\Sentry.AspNet.Tests\\Sentry.AspNet.Tests.csproj",
5656
"test\\Sentry.AspNetCore.Grpc.Tests\\Sentry.AspNetCore.Grpc.Tests.csproj",
5757
"test\\Sentry.AspNetCore.Tests\\Sentry.AspNetCore.Tests.csproj",
58+
"test\\Sentry.AspNetCore.TestUtils\\Sentry.AspNetCore.TestUtils.csproj",
5859
"test\\Sentry.Azure.Functions.Worker.Tests\\Sentry.Azure.Functions.Worker.Tests.csproj",
5960
"test\\Sentry.DiagnosticSource.IntegrationTests\\Sentry.DiagnosticSource.IntegrationTests.csproj",
6061
"test\\Sentry.DiagnosticSource.Tests\\Sentry.DiagnosticSource.Tests.csproj",

Sentry.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.Analyzers.Tests", "t
193193
EndProject
194194
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.Samples.Console.HeapDump", "samples\Sentry.Samples.Console.HeapDump\Sentry.Samples.Console.HeapDump.csproj", "{D7DF0B26-AD43-4F8B-9BFE-C4471CCC9821}"
195195
EndProject
196+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.TrimTest", "test\Sentry.TrimTest\Sentry.TrimTest.csproj", "{6030B748-0000-43B5-B8A8-399AA42F5229}"
197+
EndProject
198+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sentry.MauiTrimTest", "test\Sentry.MauiTrimTest\Sentry.MauiTrimTest.csproj", "{DF92E098-822C-4B94-B96B-56BFB91FBB54}"
199+
EndProject
196200
Global
197201
GlobalSection(SolutionConfigurationPlatforms) = preSolution
198202
Debug|Any CPU = Debug|Any CPU
@@ -520,6 +524,14 @@ Global
520524
{D7DF0B26-AD43-4F8B-9BFE-C4471CCC9821}.Debug|Any CPU.Build.0 = Debug|Any CPU
521525
{D7DF0B26-AD43-4F8B-9BFE-C4471CCC9821}.Release|Any CPU.ActiveCfg = Release|Any CPU
522526
{D7DF0B26-AD43-4F8B-9BFE-C4471CCC9821}.Release|Any CPU.Build.0 = Release|Any CPU
527+
{6030B748-0000-43B5-B8A8-399AA42F5229}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
528+
{6030B748-0000-43B5-B8A8-399AA42F5229}.Debug|Any CPU.Build.0 = Debug|Any CPU
529+
{6030B748-0000-43B5-B8A8-399AA42F5229}.Release|Any CPU.ActiveCfg = Release|Any CPU
530+
{6030B748-0000-43B5-B8A8-399AA42F5229}.Release|Any CPU.Build.0 = Release|Any CPU
531+
{DF92E098-822C-4B94-B96B-56BFB91FBB54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
532+
{DF92E098-822C-4B94-B96B-56BFB91FBB54}.Debug|Any CPU.Build.0 = Debug|Any CPU
533+
{DF92E098-822C-4B94-B96B-56BFB91FBB54}.Release|Any CPU.ActiveCfg = Release|Any CPU
534+
{DF92E098-822C-4B94-B96B-56BFB91FBB54}.Release|Any CPU.Build.0 = Release|Any CPU
523535
EndGlobalSection
524536
GlobalSection(SolutionProperties) = preSolution
525537
HideSolutionNode = FALSE
@@ -605,5 +617,7 @@ Global
605617
{E36C8DCA-464E-41CB-B189-F58553AAA8D4} = {230B9384-90FD-4551-A5DE-1A5C197F25B6}
606618
{5A17FEF9-07BB-47B8-9883-9C2CC93F09E8} = {6987A1CC-608E-4868-A02C-09D30C8B7B2D}
607619
{D7DF0B26-AD43-4F8B-9BFE-C4471CCC9821} = {21B42F60-5802-404E-90F0-AEBCC56760C0}
620+
{6030B748-0000-43B5-B8A8-399AA42F5229} = {6987A1CC-608E-4868-A02C-09D30C8B7B2D}
621+
{DF92E098-822C-4B94-B96B-56BFB91FBB54} = {6987A1CC-608E-4868-A02C-09D30C8B7B2D}
608622
EndGlobalSection
609623
EndGlobal

scripts/generate-solution-filters-config.yaml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ groupConfigs:
2424
windowsOnly:
2525
# .NET Framework projects
2626
- "**/*.AspNet.csproj"
27+
artefacts:
28+
# Any projects in the obj or bin directories
29+
- "**/obj/**/*.csproj"
30+
- "**/bin/**/*.csproj"
31+
trimTests:
32+
- "**/Sentry.TrimTest.csproj"
33+
- "**/Sentry.MauiTrimTest.csproj"
2734

2835
filterConfigs:
2936

@@ -35,12 +42,13 @@ filterConfigs:
3542
groups:
3643
- "macOnly"
3744
- "windowsOnly"
45+
- "artefacts"
46+
- "trimTests"
3847
patterns:
3948
- "**/*AndroidTestApp.csproj"
4049
- "**/*DeviceTests*.csproj"
4150
- "**/*Maui.Device.TestApp.csproj"
4251
- "**/*SourceGen.csproj"
43-
- "**/*TestUtils*.csproj"
4452

4553
- outputPath: Sentry-CI-Build-macOS.slnf
4654
include:
@@ -50,6 +58,9 @@ filterConfigs:
5058
- "modules/perfview/**/TraceEvent.csproj"
5159
- "modules/perfview/**/FastSerialization.csproj"
5260
exclude:
61+
groups:
62+
- "artefacts"
63+
- "trimTests"
5364
patterns:
5465
- "**/*AndroidTestApp.csproj"
5566
- "**/*DeviceTests*.csproj"
@@ -65,6 +76,8 @@ filterConfigs:
6576
exclude:
6677
groups:
6778
- "macOnly"
79+
- "artefacts"
80+
- "trimTests"
6881
patterns:
6982
- "**/*AndroidTestApp.csproj"
7083
- "**/*DeviceTests*.csproj"
@@ -78,6 +91,8 @@ filterConfigs:
7891
groups:
7992
- "allProjects"
8093
exclude:
94+
groups:
95+
- "artefacts"
8196
patterns:
8297
- "**/Sentry.Bindings*.csproj"
8398
- "benchmarks/**/*.csproj"
@@ -115,6 +130,9 @@ filterConfigs:
115130
- "**/Sentry.Testing.CrashableApp.csproj"
116131
- "**/Sentry.Tests.csproj"
117132
- "**/Sentry.Analyzers.Tests.csproj"
133+
exclude:
134+
groups:
135+
- "artefacts"
118136

119137
- outputPath: SentryCore.slnf
120138
solution: .generated.NoMobile.sln
@@ -173,6 +191,9 @@ filterConfigs:
173191
groups:
174192
- "allProjects"
175193
exclude:
194+
groups:
195+
- "artefacts"
196+
- "trimTests"
176197
patterns:
177198
- "**/*Bindings*.csproj"
178199
- "**/*Android*.csproj"
@@ -184,6 +205,8 @@ filterConfigs:
184205
groups:
185206
- "allProjects"
186207
exclude:
208+
groups:
209+
- "trimTests"
187210
patterns:
188211
- "samples/**/*"
189212
- "**/*Bindings*"

src/Sentry.AspNetCore.Grpc/Sentry.AspNetCore.Grpc.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</ItemGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Google.Protobuf" Version="3.19.1" />
14+
<PackageReference Include="Google.Protobuf" Version="3.22.5" />
1515
<PackageReference Include="Grpc.AspNetCore.Server" Version="2.40.0" />
1616
</ItemGroup>
1717

src/Sentry.AspNetCore/Sentry.AspNetCore.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
2020
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.0" />
2121
</ItemGroup>
22+
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
23+
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.0" />
24+
</ItemGroup>
2225

2326
<ItemGroup>
2427
<InternalsVisibleTo Include="Sentry.AspNetCore.Tests" PublicKey="$(SentryPublicKey)" />

0 commit comments

Comments
 (0)