[TrimmableTypeMap] Add CoreCLRTrimmable Mono.Android.NET-Tests lane#11091
[TrimmableTypeMap] Add CoreCLRTrimmable Mono.Android.NET-Tests lane#11091simonrozsival wants to merge 40 commits intomainfrom
Conversation
f8106b0 to
a437455
Compare
d5aefaa to
3a8d509
Compare
1814a6d to
d0e30f6
Compare
17b123b to
e2c70fd
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
e2c70fd to
87c531f
Compare
There was a problem hiding this comment.
Pull request overview
Adds CI/test-lane plumbing to run Mono.Android.NET-Tests on CoreCLR with the trimmable typemap implementation, keeping currently-unsupported test buckets explicitly excluded to maintain green coverage while follow-up runtime/generator work lands separately.
Changes:
- Adds a new
CoreCLRTrimmableAPK instrumentation lane and pins the existingCoreCLRlane tollvm-ir. - Updates
Mono.Android.NET-Tests.csprojto default to CoreCLR + exclude trimmable-specific buckets when_AndroidTypeMapImplementation=trimmable. - Centralizes additional trimmable-mode runtime test exclusions in
NUnitInstrumentation, and adjusts a few Java.Interop tests/projects to avoid unsupported coverage.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/Mono.Android-Tests/Mono.Android-Tests/Xamarin.Android.RuntimeTests/NUnitInstrumentation.cs | Adds runtime-switch-driven exclusions for categories and specific Java.Interop test names under trimmable typemap. |
| tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj | Sets defaults/exclusions for trimmable typemap runs (incl. CoreCLRTrimmable flavor). |
| tests/Mono.Android-Tests/Mono.Android-Tests/Java.Interop/JnienvTest.cs | Marks specific tests as TrimmableIgnore. |
| tests/Mono.Android-Tests/Mono.Android-Tests/Java.Interop/JavaObjectExtensionsTests.cs | Marks a specific test as TrimmableIgnore (and normalizes file header). |
| tests/Mono.Android-Tests/Java.Interop-Tests/Java.Interop-Tests.NET.csproj | Removes JniTypeUtf8Test.cs from compilation due to unsupported APIs in the product assembly. |
| build-tools/automation/yaml-templates/stage-package-tests.yaml | Updates CoreCLR lane args and adds the new CoreCLRTrimmable lane. |
simonrozsival
left a comment
There was a problem hiding this comment.
🤖 AI Review Summary
Verdict: ✅ LGTM
Found 1 suggestion:
- 💡 Code organization — the trimmable category filtering is now split between
Mono.Android.NET-Tests.csprojandNUnitInstrumentation.cs(NUnitInstrumentation.cs:29). Keeping one source of truth would make the temporary exclusions easier to retire.
The lane wiring itself looks good, and I like that the unsupported cases stay explicit instead of being hidden behind runtime fallback behavior.
Review generated by android-reviewer from review guidelines.
02780bb to
c3a7ebc
Compare
619991d to
6a0644f
Compare
19ec2fa to
e084238
Compare
During the CoreCLRTrimmable investigation, several speculative changes were added that turned out not to be needed once the real root cause (missing self-application attribute on generated JavaPeerProxy types) was fixed: - src/native/: revert the 'registerNativesFn' callback, deferred-class queue, and JNI export symbol. Verified via unconditional logging during a full device test run that Java_mono_android_Runtime_registerNatives is never called when the managed TrimmableTypeMap.OnRegisterNatives handler is wired via JniEnvironment.Types.RegisterNatives. - src/Mono.Android/Android.Runtime/JNIEnvInit.cs: drop the now-unused registerNativesFn assignment. - src/Mono.Android/Microsoft.Android.Runtime/TrimmableTypeMap.cs: restore the 'u8' optimized JNI type name literal 'mono/android/Runtime'u8. All 794 CoreCLRTrimmable device tests still pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
e02ec3c to
4abdc1e
Compare
|
Splitting this PR into focused, reviewable pieces so each fix gets the attention it deserves. This PR will stay open and become a thin, clean addition to CI configuration once all the children land on Child PRs
Once the children merge, this PR will be rebased to include only:
Follow-ups (issues)
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Filter stale ApplicationRegistration entries, count generated typemap assemblies in native config, and avoid stale logcat false positives in test harness. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add discovery-only dry runs and explicit exclusion auditing for the CoreCLR trimmable test lane, replace obsolete [Preserve] usage with trimmer roots, and narrow the SSL crash handling to targeted named exclusions so the suite completes and reports real XML results. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the trimmable typemap PR focused on the CoreCLRTrimmable lane and its targeted test-side plumbing. Move the generic NUnit runner and logcat auditing work to PR #11162, and drop the leftover Preserve-related noise. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the trimmable-specific explanations in NUnitInstrumentation.cs, including the AndroidMessageHandlerTests certificate-callback SIGSEGV note, while keeping SSL narrowed to the individual crashing tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the existing LinqExpressionTest preserve attribute, remove the temporary TrimmableIgnore category usage in favor of explicit ExcludedTestNames, and move the NativeTypeMap exclusion into the test project configuration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
simonrozsival
left a comment
There was a problem hiding this comment.
Nice split between the trimmable typemap/product work here and the generic harness changes in #11162 — that makes this PR much easier to reason about. I left one inline suggestion on the new regression tests.
CI note: the public checks look good, but the internal Xamarin.Android-PR pipeline is still pending, so this is not merge-ready quite yet.
Strengthen the trimmable typemap build tests so they exercise the Release CoreCLRTrimmable scenario and assert successful builds instead of tolerating unrelated downstream failures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix _GenerateJavaStubs incrementality in the trimmable path by using the TypeMap DLL as a focused sentinel input instead of the full @(_GenerateJavaStubsInputs) which caused false cache invalidation. - Move _AdditionalNativeConfigResolvedAssemblies population to a separate _PrepareTrimmableNativeConfigAssemblies target so it runs even when _GenerateJavaStubs is skipped on incremental builds. - Skip ServerCertificateCustomValidationCallback_RejectRequest in trimmable typemap tests (IX509TrustManager lookup bug, to revisit). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Add the
CoreCLRTrimmableMono.Android.NET-Testslane and fix the Release regressions exposed by the trimmable typemap path.This PR includes
Mono.Android.NET_Tests-CoreCLRTrimmablelane while keeping the existingCoreCLRlane on the LLVM IR typemapRelease + CoreCLR + trimmableCoreCLRTrimmablescenarioTrimmerRoots.xmlAndroidMessageHandlerTestscertificate-callback methods that currently reproduce a nativeSIGSEGVSplit out of this PR
The generic Android NUnit runner work was moved to #11162:
noexclusions=trueaudit modeValidation
Local
Release + CoreCLR + trimmableruns now complete and produce a real NUnit XML instead of a synthetic crash result.Latest local device result after the current cleanup:
System.NetTests.SslTest.SslWithinTasksShouldWork, connection reset by peer)Skipped tests in the trimmable lane
The
CoreCLRTrimmablelane runs 833 of 913 tests (91%). 80 tests are excluded — broken down as follows:Java.InteropTestsDynamicRegistrationor JNI features not yet supported by the trimmable typemapAndroidMessageHandlerTestsServerCertificateCustomValidationCallback_*— nativeSIGSEGVdue toIX509TrustManagerlookup failure in trimmed typemapAndroidMessageHandlerNegotiateAuthenticationTestsJnienvArrayMarshalingGetObjectArray— dynamic registrationInetAccess:NetworkInterfaces,DotNet,DynamicRegistrationcategory exclusionsOf the 833 tests that do run, 6 are marked
[Ignore]by NUnit (pre-existing, not trimmable-specific) and 1 flaky error (SslWithinTasksShouldWork, connection reset by peer).