[TrimmableTypeMap] Remove ForceUnconditionalEntries workaround#11345
Open
simonrozsival wants to merge 1 commit into
Open
[TrimmableTypeMap] Remove ForceUnconditionalEntries workaround#11345simonrozsival wants to merge 1 commit into
simonrozsival wants to merge 1 commit into
Conversation
Restore conditional TypeMap entries for non-essential MCW bindings now that the runtime trimmer issue has been fixed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the ForceUnconditionalEntries workaround from trimmable typemap model generation, restoring conditional 3-arg TypeMapAttribute emission for non-essential MCW bindings while keeping essential runtime/user ACW entries unconditional.
Changes:
- Removes the global force-unconditional switch from
ModelBuilder. - Restores conditional target references for non-essential MCW entries.
- Updates model and PE blob tests to expect restored 3-arg behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/Microsoft.Android.Sdk.TrimmableTypeMap/Generator/ModelBuilder.cs |
Removes workaround logic and reverts unconditional decisions to IsUnconditionalEntry() plus alias-specific rules. |
tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests/Generator/TypeMapModelBuilderTests.cs |
Updates assertions and test names/comments for restored conditional MCW typemap entries. |
Comment on lines
+185
to
186
| bool aliasBaseUnconditional = EssentialRuntimeTypes.Contains (jniName) | ||
| || peersForName.Any (IsUnconditionalEntry); |
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.
Summary
ForceUnconditionalEntriesworkaround fromModelBuilderTypeMapAttributeentries for non-essential MCW bindingsValidation
dotnet test tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests.csproj --no-restore --nologo./build.sh Preparedotnet test tests/Microsoft.Android.Sdk.TrimmableTypeMap.IntegrationTests/Microsoft.Android.Sdk.TrimmableTypeMap.IntegrationTests.csproj --no-restore --nologo -p:JavaPath="$JAVA_HOME/bin/java" -p:JavaCPath="$JAVA_HOME/bin/javac" -p:JarPath="$JAVA_HOME/bin/jar"./build.sh Build && ./build.sh Pack./dotnet-local.sh workload restore tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csprojAttempted runtime/device validation with
Mono.Android.NET-Tests.csproj -t:RunTestApp -p:_AndroidTypeMapImplementation=trimmable -p:UseMonoRuntime=false; it was blocked before install/run by existingJava.Interop-Tests.NETcompile errors inexternal/Java.Interop(JniTypeUtf8Testspan/string API mismatches and missingJniNativeMethod).