Repository navigation
Conversation
The package ships net11.0-ios27.2 and net11.0-android37.0, but Sentry.MauiTrimTest only targeted net10. Add both TFMs and a publish step for each to the trim-analysis job. The .NET 11 iOS SDK rejects the 2024 MAUI template, so the app follows a fresh dotnet new maui: a scene delegate and UIApplicationSceneManifest (MT7199), no Frame and ListView styles (CS0618) and a nullable sender in MainPage (CS8622). Android on .NET 11 needs API 24. Only the net10 iOS publish still skips the Xcode version check, because the net11 pack accepts Xcode 27.2. Refs #3852 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Good to approve, with optional comments
Adds net11.0-ios27.2 and net11.0-android37.0 to Sentry.MauiTrimTest and publishes both in the trim-analysis job, so the .NET 11 targets the package ships get the same trim/AOT analysis as .NET 10. No linked issue; this is the .NET 11 follow-up noted in #5961.
- Optional:
.github/workflows/build.yml, "Publish Test app (Android, net11.0)": like the existing .NET 10 Android step, this only proves the app builds until the full-trimming follow-up lands, because partial trimming hides the trim warnings. A short comment on the Android steps would stop anyone from reading a green run as a trim-clean result. - Optional:
test/Sentry.MauiTrimTest/Sentry.MauiTrimTest.csprojhardcodes the TFMs and the Android 24.0 minimum, which duplicatesLatestAndroidTfm/LatestIosTfmand the minimums in the rootDirectory.Build.props. The isolation comment explains why, but the next TFM bump has to update both places. A line in the CONTRIBUTING.md ".NET major version" checklist would help. - Optional: the new publish steps haven't reported in CI on this PR yet. Wait for a green
Trim analysisjob on the runner image before merging, since the local run is the only one so far.
This is an automated preliminary review.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## ci/ios-trim-analysis #5962 +/- ##
=====================================================
Coverage 77.70% 77.70%
=====================================================
Files 535 535
Lines 19731 19731
Branches 3934 3934
=====================================================
Hits 15332 15332
Misses 3544 3544
Partials 855 855 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The Android SDK defaults release builds to partial trimming, and with it sets SuppressTrimAnalysisWarnings, so the Android publishes of Sentry.MauiTrimTest never reported a trim warning. Full trimming turns the analysis back on. Both Android publishes stay clean, and both now fail with IL2057 when Android code uses [SuppressMessage] where it needs [UnconditionalSuppressMessage]. Refs #3852 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The trim apps keep literal TFMs, so a .NET major bump has to update them, the Android and iOS minimum versions in Sentry.MauiTrimTest and the trim-analysis publish steps by hand. Refs #3852 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| </PropertyGroup> | ||
|
|
||
| <PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'"> | ||
| <!-- The Android SDK defaults to partial trimming, and then suppresses all trim analysis warnings --> |
Collaborator
There was a problem hiding this comment.
Suggested change
| <!-- The Android SDK defaults to partial trimming, and then suppresses all trim analysis warnings --> | |
| <!-- The Android SDK defaults to partial trimming --> |
Since nothing in the code touches warnings, it's confusing to mention them
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #5961, so that one goes first.
The package ships
net11.0-ios27.2andnet11.0-android37.0, but the MAUI trim app only targeted .NET 10. I added both .NET 11 target frameworks toSentry.MauiTrimTest, and a publish step for each to thetrim-analysisjob.The .NET 11 iOS SDK rejected the 2024 MAUI template, so I brought the app in line with a fresh
dotnet new maui. It now has a scene delegate and aUIApplicationSceneManifest, which fixes MT7199. I also dropped the obsoleteFrameandListViewstyles and madesendernullable inMainPage, because MAUI 11 turns both into build errors. Android on .NET 11 needs API 24, so the app uses 24 there, like our rootDirectory.Build.propsdoes.The
net11.0-ios27.2pack accepts the runner's Xcode 27.2, so only the .NET 10 iOS publish still skips the Xcode version check.Until now the Android steps couldn't catch a trim warning. The Android SDK defaults to partial trimming and then suppresses every trim analysis warning, so the app now uses full trimming on Android. Both Android publishes stay clean with it.
I kept the .NET 10 iOS publish. The Sentry code is the same for both target frameworks, but the toolchains differ. .NET 10 runs ILLink before the AOT compiler, while .NET 11 skips ILLink and runs a new assembly preparer, which is the path #5855 was reported on. Both versions ship, so both get checked.
I checked it locally with Xcode 27.2. Both iOS publishes fail when Cocoa code suppresses a trim warning with
[SuppressMessage]instead of[UnconditionalSuppressMessage], and whenSentry.Bindings.CocoalosesIsTrimmable. Both Android publishes now fail on the same[SuppressMessage]mistake in Android code, which they let through before. On the first CI run the two new steps added about 6 minutes to the trim job, which still finishes well before the macOS build.#skip-changelog