Repository navigation
test: Guard span data alignment in Uno assemblies - #25630
agneszitte wants to merge 1 commit into
Conversation
A post-compile rewrite of the built assembly (Mono.Cecil 0.11.4 in EmbeddedResourceInjectorTask) dropped the alignment of constant span data in Uno.UI.dll. CoreCLR only checks it when JIT optimizations are off, so 6.7 apps broke only under a debugger and no test noticed. The test reads every aligned span data field of Uno's assemblies, including fixed data in the test assembly, which goes through the same Release rewrite, and fails when one isn't aligned. It also fails when the rewrite didn't run, and is inconclusive in Debug, where nothing is rewritten. Related to #25626 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Claude finished @agneszitte's task in 15s —— View job Review summaryVerdict: ship. This is a test-only change. It's well scoped and the rationale is clear. Issues: 0 high, 0 medium, 1 minor (inline: Code review assessment (by inspection only; I did not build or run it):
Cross-cutting notes:
|
| if (!testAssembly.GetManifestResourceNames().Contains("ILLink.Substitutions.xml")) | ||
| { | ||
| #if DEBUG | ||
| Assert.Inconclusive("Only Release builds rewrite assemblies after compile; run this test in Release."); |
There was a problem hiding this comment.
The repo review rules flag Assert.Inconclusive, and in Debug this test always ends up Inconclusive, so it checks nothing there. The reasoning is sound, since Debug builds aren't rewritten and so there's nothing to verify. The author documents it in the PR description, so I'd treat this as a minor/accepted trade-off. If you'd rather not have a permanently inconclusive test, consider excluding the test with #if !DEBUG around the whole method. Otherwise keep it as is, since Release is what CI runs.
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 240699 found UI Test snapshots differences: Details
|
|
Tick the box to add this pull request to the merge queue (same as
|
GitHub Issue: Related to #25626 (this guards against it coming back; the 6.7 fix itself is the backport #25627)
PR Type:
🏗️ Build or CI related changes
What changed? 🚀
Adds a unit test that fails when constant span data in Uno's assemblies isn't aligned.
Split(':', '.')is read from static data the compiler aligns to its element size. In Release, the build rewrites the compiled assembly (EmbeddedResourceInjectorTask), and Mono.Cecil 0.11.4 dropped that alignment. CoreCLR only checks it when JIT optimizations are off, so 6.7 apps broke only under a debugger (6.7 desktop apps break under the debugger: "The field is invalid for initializing array or span" #25626). No test could see it.__StaticArrayInitTypeSize=N_Align=Mfield of Uno's assemblies throughRuntimeHelpers.CreateSpan<byte>, and fails if its address isn't a multiple ofM.ILLink.Substitutions.xml). In Debug, where nothing is rewritten, it reports Inconclusive.Reviewer's guide
src/Uno.UI.UnitTests/Assemblies/Given_StaticDataAlignment.cs.build/ci/net11/_global.json,Uno.UI-UnitTests-only.slnfbuilt in Release):src/Directory.Build.props), so third-party dependencies aren't checked.release/stable/6.7(andservicing/6.8).PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code