Skip to content

[TrimmableTypeMap] Test plumbing and CI lane for Mono.Android.NET-Tests#11091

Draft
simonrozsival wants to merge 4 commits intodev/simonrozsival/trimmable-runtime-fixesfrom
dev/simonrozsival/trimmable-test-plumbing
Draft

[TrimmableTypeMap] Test plumbing and CI lane for Mono.Android.NET-Tests#11091
simonrozsival wants to merge 4 commits intodev/simonrozsival/trimmable-runtime-fixesfrom
dev/simonrozsival/trimmable-test-plumbing

Conversation

@simonrozsival
Copy link
Copy Markdown
Member

@simonrozsival simonrozsival commented Apr 8, 2026

4/4 — Test plumbing and CI lane

Depends on: #11090 (Runtime fixes)

Changes

  • _AndroidTypeMapImplementation=trimmable with UseMonoRuntime=false to run Mono.Android.NET-Tests with the trimmable typemap on CoreCLR
  • CoreCLRTrimmable CI lane in stage-package-tests.yaml
  • ExcludeCategories: NativeTypeMap, TrimmableIgnore, SSL for trimmable runs
  • ExcludedTestNames: Java.Interop-Tests fixtures using JavaObject types (not Java.Lang.Object) — these crash with SIGABRT because their hand-written Java helper classes (net.dot.jni.test.*) are not generated by the trimmable JCW process
  • TrimmableIgnore category on: NewOpenGenericTypeThrows, ActivatedDirectThrowableSubclassesShouldBeRegistered, JavaCast_BaseToGenericWrapper

Local usage

# Run with trimmable typemap on CoreCLR
./dotnet-local.sh build -t:RunTestApp tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj \
  -p:_AndroidTypeMapImplementation=trimmable -p:UseMonoRuntime=false

# Run with legacy (llvm-ir) typemap on CoreCLR (default)
./dotnet-local.sh build -t:RunTestApp tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj

Part of the series: PR 1 (Generator) → PR 2 (UCO) → PR 3 (Runtime) → PR 4

simonrozsival and others added 3 commits April 8, 2026 21:04
- Fix CRC64 algorithm (Jones instead of System.IO.Hashing)
- Fix inherited override detection (walk past DoNotGenerateAcw bases)
- Fix instrumentation targetPackage
- JCW lazy registerNatives for App/Instrumentation types
- Sanitize backtick in proxy names
- Manifest name promotion and deferred registration propagation
- Build targets and task updates
- Typed logger interface
- Unit test coverage

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- UCO constructors directly call activation ctor (no ActivateInstance indirection)
- WithinNewObjectScope guard prevents double peer creation
- No-op UCO for open generic type definitions
- ControlFlowBuilder support in PEAssemblyBuilder
- Remove TrimmableNativeRegistration wrapper and ActivateInstance

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- TrimmableTypeMap.TryGetType: unwrap proxy to return real managed type
- TryGetJniName: fallback chain (Register → compat → JavaNativeTypeManager)
- GetProxyForPeer: JNI class hierarchy walk with caching
- CreatePeer: IsAssignableFrom validation for JavaCast safety
- TypeManager/JNIEnv: trimmable guards for legacy APIs
- JNIEnvInit: JniRuntime.SetCurrent for background threads

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use _AndroidTypeMapImplementation=trimmable directly instead of a
MonoAndroidTypeMapFlavor wrapper property. This is consistent with
the actual build system property used by the typemap targets.

- _AndroidTypeMapImplementation=trimmable in CI yaml and test csproj
- UseMonoRuntime=false set when _AndroidTypeMapImplementation=trimmable
- TestsFlavor=CoreCLRTrimmable for result file naming
- ExcludeCategories: NativeTypeMap, TrimmableIgnore, SSL
- ExcludedTestNames for Java.Interop-Tests JavaObject-based fixtures

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@simonrozsival simonrozsival force-pushed the dev/simonrozsival/trimmable-test-plumbing branch from f8106b0 to a437455 Compare April 9, 2026 09:19
@simonrozsival simonrozsival added trimmable-type-map copilot `copilot-cli` or other AIs were used to author this labels Apr 9, 2026
@simonrozsival simonrozsival force-pushed the dev/simonrozsival/trimmable-runtime-fixes branch from d5aefaa to 3a8d509 Compare April 10, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copilot `copilot-cli` or other AIs were used to author this trimmable-type-map

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant