-
Notifications
You must be signed in to change notification settings - Fork 526
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
[net6] Strip framework native libraries #5637
[net6] Strip framework native libraries #5637
Conversation
...d.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets
Show resolved
Hide resolved
This change shouldn't be limited to just .NET 6 support. This change should also remove all of the
We should likewise ensure that all Related: it looks like we didn't % cp /Library/Frameworks/Xamarin.Android.framework/Versions/Current//lib/xamarin.android/xbuild/Xamarin/Android/lib/x86_64/libmono-android.release.so
% cp libmono-android.release.so libmono-android.release.so.bk
% $HOME/android-toolchain/ndk/toolchains/x86_64-4.9/prebuilt/darwin-x86_64/bin/x86_64-linux-android-strip libmono-android.release.so
% ls -l libmono-android.release.so*
-rwxr-xr-x 1 jon staff 227488 Feb 18 21:06 libmono-android.release.so
-rwxr-xr-x 1 jon staff 273520 Feb 18 21:06 libmono-android.release.so.bk Unless we're already |
Here I want to fix it just for NET6, so that we don't have big apks in net6 preview builds. For complete overhaul of it I think we will need broader discussion. There are question like whether we want to have just single library with debug information. Usually the debug and release use also different optimization options. Or whether we could have the debug information in separate file(s).
It looks to me as we are already stripping debug information ( |
...d.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets
Outdated
Show resolved
Hide resolved
Please also add a unit test/update an existing test. |
0e2914d
to
8ff1530
Compare
I have updated the apk size reference files. That should catch the case when we don't strip the native libs. |
...d.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets
Outdated
Show resolved
Hide resolved
...d.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets
Outdated
Show resolved
Hide resolved
...d.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.AssemblyResolution.targets
Outdated
Show resolved
Hide resolved
* `@(_StrippedFrameworkNativeLibrary)` now uses -> operator so it has all metadata * We now have `SourceFiles` and `DestinationFiles` passed into the `<StripNativeLibraries/>` task * Fixed spelling, I think it should be: tripple -> triple * Updated a test so it check for stripped files on disk
This can be a ToolTask that runs itself N times. This way MSBuild can parse error/warning messages for us.
This reverts commit 404ce95.
Context: #5558
Context: dotnet/runtime#45013
Due to runtime issue #45013 we are producing large packages
for
Release
configurations, where native libraries contain debuginformation.
So we will strip framework native libs for now. Added new target
and task to call ndk's strip tool with
--strip-debug
option.The target should work partially.
The apk sizes differences, before/after BuildReleaseArm64False/net6:
Interestingly, the size of
libxa-internal-api.so
increases, only marginally though.That get us back to much better ratio between apk sizes of legacy and net6 (BuildReleaseArm64False):
and apk sizes for legacy/net6 (BuildReleaseArm64True):