-
Notifications
You must be signed in to change notification settings - Fork 537
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
Improve XA0141 warning #9544
Comments
I think @dellis1972 looked into it sometime ago and determined that the information isn't available for transient packages. I'll see to adding arch information, but I can't do much about getting better nuget info. I'll leave that to @dellis1972 and @jonathanpeppers :) |
Partial fix for #9544 to make the warning more informative. Architecture information is necessary as the nuget in question might have the same library for various architectures.
Partial fix: #9547 |
Partial fix for #9544 to make the warning more informative. Architecture information is necessary as the nuget in question might have the same library for various architectures.
This is going to require a fair bit of "plumbing" that I don't currently understand. Working backwards:
How do we provide enough information/metadata/etc. for |
Nuget information can be propagated to the |
Partial fix for #9544 to make the warning more informative. Architecture information is necessary as the nuget in question might have the same library for various architectures.
Partial fix for #9544 to make the warning more informative. Architecture information is necessary as the nuget in question might have the same library for various architectures.
See also: #9559 |
Partial fix for #9544 to make the warning more informative. Architecture information is necessary as the nuget in question might have the same library for various architectures.
Fixes: #9544 Context: 64bb147 [Google announced][0] that future versions of Android would require that native libraries use 16 KB page sizes on arm64. At present, the timeline for *when* 16 KB page sizes will be required is unknown, though we assume it will be with Android 16 or later. In order to get ahead of this, .NET 9 added an XA0141 warning in 64bb147. The problem is, this warning is not entirely actionable: dotnet new android dotnet add package Xamarin.GooglePlayServices.Vision.Face.Contour.Internal --version 116.1.0.19 dotnet build -c Release results in: warning XA0141: NuGet package '<unknown>' version '<unknown>' contains a shared library 'libface_detector_v2_jni.so' which is not correctly aligned. See https://developer.android.com/guide/practices/page-sizes for more details warning XA0141: NuGet package '<unknown>' version '<unknown>' contains a shared library 'libface_detector_v2_jni.so' which is not correctly aligned. See https://developer.android.com/guide/practices/page-sizes for more details What are customers supposed to *do* with this? The original assumption was that the NuGet package and Version would be available as metadata items on the MSBuild Items. Unfortunately that was not the case, so the data the user gets is empty. Add the required metadata to all NuGet Package references resolved by the project. This will allow us to propagate that data throughout the build Items as they are transformed. This means we can provide a decent error message to the user: warning XA0141: Android 16 will require 16 KB page sizes, shared library 'libface_detector_v2_jni.so' does not have a 16 KB page size. Please inform the authors of the NuGet package 'Xamarin.GooglePlayServices.Vision.Face.Contour.Internal' version '116.1.0.19' which contains 'lib/net8.0-android34.0/play-services-vision-face-contour-internal.aar'. See https://developer.android.com/guide/practices/page-sizes for more details. [0]: https://android-developers.googleblog.com/2024/08/adding-16-kb-page-size-to-android.html
Fixes: #9544 Context: 64bb147 [Google announced][0] that future versions of Android would require that native libraries use 16 KB page sizes on arm64. At present, the timeline for *when* 16 KB page sizes will be required is unknown, though we assume it will be with Android 16 or later. In order to get ahead of this, .NET 9 added an XA0141 warning in 64bb147. The problem is, this warning is not entirely actionable: dotnet new android dotnet add package Xamarin.GooglePlayServices.Vision.Face.Contour.Internal --version 116.1.0.19 dotnet build -c Release results in: warning XA0141: NuGet package '<unknown>' version '<unknown>' contains a shared library 'libface_detector_v2_jni.so' which is not correctly aligned. See https://developer.android.com/guide/practices/page-sizes for more details warning XA0141: NuGet package '<unknown>' version '<unknown>' contains a shared library 'libface_detector_v2_jni.so' which is not correctly aligned. See https://developer.android.com/guide/practices/page-sizes for more details What are customers supposed to *do* with this? The original assumption was that the NuGet package and Version would be available as metadata items on the MSBuild Items. Unfortunately that was not the case, so the data the user gets is empty. Add the required metadata to all NuGet Package references resolved by the project. This will allow us to propagate that data throughout the build Items as they are transformed. This means we can provide a decent error message to the user: warning XA0141: Android 16 will require 16 KB page sizes, shared library 'libface_detector_v2_jni.so' does not have a 16 KB page size. Please inform the authors of the NuGet package 'Xamarin.GooglePlayServices.Vision.Face.Contour.Internal' version '116.1.0.19' which contains 'lib/net8.0-android34.0/play-services-vision-face-contour-internal.aar'. See https://developer.android.com/guide/practices/page-sizes for more details. [0]: https://android-developers.googleblog.com/2024/08/adding-16-kb-page-size-to-android.html
.NET 9.0.100
The NuGet package information in the
XA0141
warning seems helpful, but it doesn't appear to actually work.Repro:
results in:
We should:
arm64-v8a/libface_detector_v2_jni.so
), as each package will likely contain many versions with the same file name.An updated example:
The text was updated successfully, but these errors were encountered: