Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/10.0.1xx-preview1] Update dependencies from dotnet/sdk #9771

Draft
wants to merge 10 commits into
base: release/10.0.1xx-preview1
Choose a base branch
from

Conversation

dotnet-maestro[bot]
Copy link
Contributor

@dotnet-maestro dotnet-maestro bot commented Feb 8, 2025

This pull request updates the following dependencies

From https://github.com/dotnet/sdk

  • Subscription: 06198954-d94f-4aaf-b610-2a26227fa36b
  • Build: 20250210.21
  • Date Produced: February 11, 2025 6:51:46 AM UTC
  • Commit: d1382d9b07310de51feef4b00ab46e9648cb9919
  • Branch: refs/heads/release/10.0.1xx-preview1

Microsoft.NET.Sdk
 From Version 10.0.100-preview.1.25106.28 -> To Version 10.0.100-preview.1.25107.22
dotnet-maestro bot and others added 2 commits February 11, 2025 05:02
Microsoft.NET.Sdk
 From Version 10.0.100-preview.1.25106.28 -> To Version 10.0.100-preview.1.25110.2
Context: NuGet/NuGet.Client#6239

.NET 10 Preview 1 enables `$(RestoreEnablePackagePruning)=true` by default.

This produces multiple warnings as errors in dotnet/android:

    src\Xamarin.Android.Build.Tasks\Tests\Xamarin.ProjectTools\Xamarin.ProjectTools.csproj : warning NU1510: PackageReference System.Formats.Asn1 will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.
    src\Xamarin.Android.Build.Tasks\Tests\Xamarin.ProjectTools\Xamarin.ProjectTools.csproj : warning NU1510: PackageReference Microsoft.Win32.Registry will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.
    src\Xamarin.Android.Build.Tasks\Tests\Xamarin.Android.Build.Tests\Xamarin.Android.Build.Tests.csproj : warning NU1510: PackageReference System.Formats.Asn1 will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.
    external\debugger-libs\Mono.Debugging\Mono.Debugging.csproj : warning NU1510: PackageReference System.Buffers will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.
    external\debugger-libs\Mono.Debugging\Mono.Debugging.csproj : warning NU1510: PackageReference System.Collections.Immutable will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.
    external\debugger-libs\Mono.Debugger.Soft\Mono.Debugger.Soft.csproj : warning NU1510: PackageReference System.Runtime will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.
    external\debugger-libs\Mono.Debugger.Soft\Mono.Debugger.Soft.csproj : warning NU1510: PackageReference System.Reflection.Metadata will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.
    tests\MSBuildDeviceIntegration\MSBuildDeviceIntegration.csproj : warning NU1510: PackageReference System.Formats.Asn1 will not be pruned. Consider removing this package from your dependencies, as it is likely unnecessary.
@dellis1972
Copy link
Contributor

Why do we need RestoreEnablePackagePruning?

@jonathanpeppers
Copy link
Member

jonathanpeppers commented Feb 11, 2025

@dellis1972 it's some new default they turned on...

It looks like I might need to go fix it in other repos, I did this one so far:

@jonathanpeppers jonathanpeppers marked this pull request as draft February 11, 2025 17:06
jonathanpeppers and others added 3 commits February 11, 2025 15:06
Changes: dotnet/java-interop@6bc87e8...57f7bc8

  * dotnet/java-interop@57f7bc84: [generator] Avoid non-blittable types in native callback methods (dotnet/java-interop#1296)
  * dotnet/java-interop@9369d4fd: [tests] fix `NU1510` warning as error (dotnet/java-interop#1306)

Context: dotnet/java-interop@57f7bc8
Context: dotnet/java-interop#1027

dotnet/java-interop@57f7bc84 updated
`generator --codegen-target=XAJavaInterop1` marshal methods to
contain only blittable types in parameter and return types.
Instead of `bool`, use `sbyte`; instead of `char`, use `ushort`.

This change causes warnings when `MarshalMethodsClassifier` verifies
that the marshal types match the native types:

	…/Xamarin.Android.Common.targets(1502,3): Method 'System.SByte Java.Lang.Object::n_Equals_Ljava_lang_Object_(System.IntPtr,System.IntPtr,System.IntPtr)' doesn't match native callback signature (invalid return type: expected 'System.Boolean', found 'System.SByte')
	…/Xamarin.Android.Common.targets(1502,3): Unable to find native callback method 'n_Equals_Ljava_lang_Object_' in type 'Java.Lang.Object', matching the 'System.Boolean Java.Lang.Object::Equals(Java.Lang.Object)' signature (jniName: 'equals') [Arch: X86_64; Assembly: obj/Release/android-x64/linked/Mono.Android.dll]
	…/Xamarin.Android.Common.targets(1502,3): Method 'System.Boolean Java.Lang.Object::Equals(Java.Lang.Object)' will be registered dynamically [Arch: X86_64; Assembly: obj/Release/android-x64/linked/Mono.Android.dll]
	…/Xamarin.Android.Common.targets(1502,3): Method 'System.SByte Java.Lang.Object::n_Equals_Ljava_lang_Object_(System.IntPtr,System.IntPtr,System.IntPtr)' doesn't match native callback signature (invalid return type: expected 'System.Boolean', found 'System.SByte')
	…/Xamarin.Android.Common.targets(1502,3): Unable to find native callback method 'n_Equals_Ljava_lang_Object_' in type 'Java.Lang.Object', matching the 'System.Boolean Java.Lang.Object::Equals(Java.Lang.Object)' signature (jniName: 'equals') [Arch: Arm64; Assembly: obj/Release/android-arm64/linked/Mono.Android.dll]
	…/Xamarin.Android.Common.targets(1502,3): Method 'System.Boolean Java.Lang.Object::Equals(Java.Lang.Object)' will be registered dynamically [Arch: Arm64; Assembly: obj/Release/android-arm64/linked/Mono.Android.dll]
	…/Xamarin.Android.Common.targets(1502,3): Type 'Android.Runtime.JavaObject, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' will register some of its Java override methods dynamically. This may adversely affect runtime performance. See preceding warnings for names of dynamically registered methods.
	…/Xamarin.Android.Common.targets(1502,3): [Arm64] Number of methods in the project that will be registered dynamically: 1
	…/Xamarin.Android.Common.targets(1502,3): [X86_64] Number of methods in the project that will be registered dynamically: 1

These warnings occur because the marshal method signature now differs
from the public API signature.  Consider:

	namespace Java.Lang;

	partial class Object {
	    static sbyte n_Equals_Ljava_lang_Object_ (IntPtr jnienv, IntPtr native__this, IntPtr native_obj) => …

	    [Register ("equals", "(Ljava/lang/Object;)Z", "GetEquals_Ljava_lang_Object_Handler")]
	    public virtual unsafe bool Equals (Java.Lang.Object? obj) => …
	}

`MarshalMethodsClassifier` uses the 3rd `connector` parameter to
`RegisterAttribute` to determine the name of the marshal method --
string processing `GetEquals_Ljava_lang_Object_Handler` to obtain
`n_Equals_Ljava_lang_Object_` -- and then checks that the parameter
and return types match between the two methods.

Now that we're emitting blittable types, they *don't* match, thus the
warning.

Fix this by treating our blittable types as equivalent to their
native types in `MarshalMethodsClassifier`.

Additionally, `Mono.Android` has "built-in delegates" that marshal
`bool` types, e.g. `_JniMarshal_PP_Z`.  Because `generator` no longer
creates these delegates -- it will now create `_JniMarshal_PP_B`
instead -- we need to add them manually.
@jonathanpeppers jonathanpeppers added the do-not-merge PR should not be merged. label Feb 12, 2025
dotnet-maestro bot and others added 2 commits February 12, 2025 05:01
Microsoft.NET.Sdk
 From Version 10.0.100-preview.1.25106.28 -> To Version 10.0.100-preview.1.25110.21
Copy link
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

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

FYI we'll probably never merge this, but use it to test any new .NET 10 Preview 1 builds that come in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge PR should not be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants