Repository navigation
Restore fixes lost by nightly-fix-finder - #13559
Open
jonathanpeppers wants to merge 7 commits into
Open
jonathanpeppers wants to merge 7 commits into
jonathanpeppers wants to merge 7 commits into
Conversation
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>
…bol retry warning" This reverts commit f47819e.
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>
Contributor
There was a problem hiding this comment.
🟢 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
Lsuffix to generatedlongliterals, preventing compilation failures for values outside theintrange. - Adds an on-device regression test with a runtime annotation and preservation rules.
- Removes the unused assembly resolver, its factory method, and disabled
ColorSymbolcode.
| 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
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.
The
nightly-fix-finderworkflow found these fixes, but./build.sh Preparefailed in the sandbox, so it opened no PR. This PR makes the fixes again by hand.LocalManifestProvider.cs. Not included, because [Xamarin.Installer.Build.Tasks] Use Android CLI to install SDK packages #13513 deleted the file.JavaAnnotationParserwrotelongannotation values without the JavaLsuffix. For values outside theintrange,javacfails with "integer number too large". The parser now adds the suffix.#if falseblock fromColorSymbol.cs. The block was a copy of members thatSimpleSymbolalready has, and it was not valid C#.XAAssemblyResolverretry warning intoResources.resx. But nothing has calledMonoAndroidHelper.MakeResolversince [Xamarin.Android.Build.Tasks] Remove LLVM codegen and binutils #13069, so this PR removesXAAssemblyResolverandMakeResolverinstead. An earlier commit in this PR added the warning as XA4332, and a later commit reverts it. Squash before merge.Testing:
JavaAnnotation_LongValueOutsideIntRange_UsesJavaLongLiteral. A Java peer has a runtime annotation withlong.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.Testswith filterTrimmableTypeMap: 102 passed, 8 skipped.Xamarin.Android.Build.Tasks.csprojbuilds.