镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Restore fixes lost by nightly-fix-finder - #13559

Open
jonathanpeppers wants to merge 7 commits into
mainfrom
jonathanpeppers-restore-lost-fix-finder-fixes
Open

jonathanpeppers wants to merge 7 commits into
mainfrom
jonathanpeppers-restore-lost-fix-finder-fixes

Conversation

@jonathanpeppers

Copy link
Copy Markdown
Member

The nightly-fix-finder workflow found these fixes, but ./build.sh Prepare failed in the sandbox, so it opened no PR. This PR makes the fixes again by hand.

Testing:

  • New on-device test JavaAnnotation_LongValueOutsideIntRange_UsesJavaLongLiteral. A Java peer has a runtime annotation with long.MaxValue, and the test reads the value back through reflection. Without the fix, the test app does not build (javac: "integer number too large").
  • Mono.Android.NET-Tests, Release, API 36 emulator: 1056 passed, 8 skipped, 0 failed.
  • generator-Tests: 478 passed.
  • Microsoft.Android.Build.Tasks.Tests with filter TrimmableTypeMap: 102 passed, 8 skipped.
  • Xamarin.Android.Build.Tasks.csproj builds.

jonathanpeppers and others added 7 commits November 13, 2026 12:12
Annotation values of type long were written without the Java L suffix.
Values outside the 32-bit int range were then invalid Java literals and
broke compilation of the generated Java callable wrappers.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
ColorSymbol had an #if false block that duplicated the ISymbol members
that SimpleSymbol already implements. The block was never compiled and
was not valid C#.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…y warning

The warning that XAAssemblyResolver logs when it cannot read an assembly
with its debugging symbols was a hardcoded string. Move it to
Resources.resx as XA4332, log it with LogCodedWarning, and document it.
The retry behavior and the exception details warning do not change.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
CustomAttributeTypeProvider reports Int64, not System.Int64.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
#13069 removed the last caller of MonoAndroidHelper.MakeResolver, which
was the only code that created XAAssemblyResolver. Remove both.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
#12931 moved generated-code coverage for the trimmable typemap to
on-device tests. Replace the host-side JavaAnnotationParserTests with an
on-device test: a Java peer has a runtime annotation with a long value
outside the int range. Without the L suffix fix, javac fails to compile
the generated Java callable wrapper. The test also reads the value back
through Java reflection. ManagedValueToJavaSource is private again.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 13, 2026 19:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block approval of the annotation-literal fix and unused-code cleanup.

No open issues 🎉

What changed in this PR

Restores the applicable fixes identified by nightly-fix-finder: correct Java generation for long annotation values and removal of unused code from the Android build tools and binding generator.

Changes:

  • Adds the Java L suffix to generated long literals, preventing compilation failures for values outside the int range.
  • Adds an on-device regression test with a runtime annotation and preservation rules.
  • Removes the unused assembly resolver, its factory method, and disabled ColorSymbol code.
File Description
tests/​Mono.Android-Tests/​Mono.Android-Tests/​proguard.cfg Preserves runtime annotations and the new annotation type.
tests/​Mono.Android-Tests/​Mono.Android-Tests/​Java.Interop/​TrimmableTypeMapRuntimeCoverageTests.cs Tests that a generated annotation retains long.MaxValue.
tests/​Mono.Android-Tests/​Mono.Android-Test.Library/​java/​net/​dot/​android/​test/​LongValueAnnotation.java Defines the runtime annotation used by the regression test.
src/​Xamarin.Android.Build.Tasks/​Utilities/​XAAssemblyResolver.cs Deletes the unused assembly resolver.
src/​Xamarin.Android.Build.Tasks/​Utilities/​MonoAndroidHelper.cs Removes the unused resolver factory.
src/​Microsoft.Android.Sdk.TrimmableTypeMap/​Scanner/​JavaAnnotationParser.cs Emits Java long literals with the L suffix.
src/​generator/​Java.Interop.Tools.Generator.ObjectModel/​Symbols/​ColorSymbol.cs Removes disabled, redundant code.

Review effort: Balanced

This branch has not been deployed

No deployments
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.

2 participants