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

[One .NET] exclude libxamarin-debug-app-helper.so from Release builds #5874

Merged
merged 1 commit into from
Apr 27, 2021

Conversation

jonathanpeppers
Copy link
Member

Fixes: #5855

Currently, in .NET 6, any .so file in our runtime pack is included
in apps by default. This is the nature of how native libraries coming
from NuGet packages work. They just get added based on the file path
and $(RuntimeIdentifier) of the project.

We already have a special case for libmono-android.release.so and
libmono-android.debug.so that uses $(AndroidIncludeDebugSymbols)
as a way to know which native library is needed.

We can do the same thing here and exclude
libxamarin-debug-app-helper.so, which should only be included in
Debug builds.

This saves ~37K for all Release apps:

-37,104 lib/arm64-v8a/libxamarin-debug-app-helper.so *1

Fixes: dotnet#5855

Currently, in .NET 6, any `.so` file in our runtime pack is included
in apps by default. This is the nature of how native libraries coming
from NuGet packages work. They just get added based on the file path
and `$(RuntimeIdentifier)` of the project.

We already have a special case for `libmono-android.release.so` and
`libmono-android.debug.so` that uses `$(AndroidIncludeDebugSymbols)`
as a way to know which native library is needed.

We can do the same thing here and exclude
`libxamarin-debug-app-helper.so`, which should only be included in
`Debug` builds.

This saves ~37K for all Release apps:

    -37,104 lib/arm64-v8a/libxamarin-debug-app-helper.so *1
@jonathanpeppers
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jonathanpeppers
Copy link
Member Author

The one failure seems unrelated:

error XA0010: No available device.

@jonathanpeppers jonathanpeppers merged commit a916ee0 into dotnet:main Apr 27, 2021
@jonathanpeppers jonathanpeppers deleted the fix/5855 branch April 27, 2021 13:09
jonathanpeppers added a commit that referenced this pull request Apr 27, 2021
…#5874)

Fixes: #5855

Currently, in .NET 6, any `.so` file in our runtime pack is included
in apps by default. This is the nature of how native libraries coming
from NuGet packages work. They just get added based on the file path
and `$(RuntimeIdentifier)` of the project.

We already have a special case for `libmono-android.release.so` and
`libmono-android.debug.so` that uses `$(AndroidIncludeDebugSymbols)`
as a way to know which native library is needed.

We can do the same thing here and exclude
`libxamarin-debug-app-helper.so`, which should only be included in
`Debug` builds.

This saves ~37K for all Release apps:

    -37,104 lib/arm64-v8a/libxamarin-debug-app-helper.so *1
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[NET6] libxamarin-debug-app-helper.so should not be packaged for Release builds
2 participants