Skip to content

test(aot): build with (MSBuild)TreatWarningsAsErrors to catch warnings#5125

Draft
jpnurmi wants to merge 2 commits intomainfrom
jpnurmi/fix/native-aot-pdb
Draft

test(aot): build with (MSBuild)TreatWarningsAsErrors to catch warnings#5125
jpnurmi wants to merge 2 commits intomainfrom
jpnurmi/fix/native-aot-pdb

Conversation

@jpnurmi
Copy link
Copy Markdown
Collaborator

@jpnurmi jpnurmi commented Apr 9, 2026

Depends on the PDB fix coming in sentry-native 0.13.6:

This PR turns on (MSBuild)TreatWarningsAsErrors for the Native AOT integration test, to prevent such Native AOT warnings slipping in again in the future (mostly via sentry-native updates) that would make projects using (MSBuild)TreatWarningsAsErrors fail to publish.

See also: #5122

#skip-changelog

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


This PR will not appear in the changelog.


🤖 This preview updates automatically when you update the PR.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.00%. Comparing base (39ea4d8) to head (bfb5565).
⚠️ Report is 1 commits behind head on deps/modules/sentry-native.

Additional details and impacted files
@@                      Coverage Diff                       @@
##           deps/modules/sentry-native    #5125      +/-   ##
==============================================================
- Coverage                       74.12%   74.00%   -0.13%     
==============================================================
  Files                             499      499              
  Lines                           18067    18067              
  Branches                         3520     3520              
==============================================================
- Hits                            13392    13370      -22     
- Misses                           3813     3838      +25     
+ Partials                          862      859       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jpnurmi
Copy link
Copy Markdown
Collaborator Author

jpnurmi commented Apr 9, 2026

A fix is coming in sentry-native 0.13.6 - no need to change anything in sentry-dotnet.

@jpnurmi jpnurmi closed this Apr 9, 2026
@jpnurmi jpnurmi reopened this Apr 10, 2026
@jpnurmi jpnurmi changed the title fix(aot): embed debug info to avoid LNK4099 warnings test(aot): build with MSBuildTreatWarningsAsErrors to catch warnings Apr 10, 2026
Projects using MSBuildTreatWarningsAsErrors=true would fail to publish
with Native AOT due to warnings. Add a test to prevent such warnings
slipping in.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jpnurmi jpnurmi force-pushed the jpnurmi/fix/native-aot-pdb branch from fd2ff27 to 4980efa Compare April 10, 2026 08:21
@jpnurmi jpnurmi marked this pull request as draft April 10, 2026 08:27
Enable both TreatWarningsAsErrors and MSBuildTreatWarningsAsErrors in the
main Aot publish test (all platforms) and drop the separate Windows-only
MSBuildTreatWarningsAsErrors block. Portable PDBs make the original
Windows-only scoping unnecessary, and reusing the existing test avoids a
second publish while also exercising the resulting binary at runtime.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jpnurmi jpnurmi changed the title test(aot): build with MSBuildTreatWarningsAsErrors to catch warnings test(aot): build with (MSBuild)TreatWarningsAsErrors to catch warnings Apr 10, 2026
@jpnurmi jpnurmi changed the base branch from main to deps/modules/sentry-native April 10, 2026 14:51
@jpnurmi jpnurmi closed this Apr 10, 2026
@jpnurmi jpnurmi reopened this Apr 10, 2026
Base automatically changed from deps/modules/sentry-native to main April 13, 2026 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant