Skip to content

[release/5.0-rc2] Exclude .a files from the runtime native files when packaging#41986

Closed
github-actions[bot] wants to merge 1 commit intorelease/5.0-rc2from
backport/pr-41966-to-release/5.0-rc2
Closed

[release/5.0-rc2] Exclude .a files from the runtime native files when packaging#41986
github-actions[bot] wants to merge 1 commit intorelease/5.0-rc2from
backport/pr-41966-to-release/5.0-rc2

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Sep 8, 2020

Backport of #41966 to release/5.0-rc2

/cc @vitek-karas

Customer Impact

We're including static lib files (.a) with our native libraries when shipping either shared framework or runtime packs. These files are not used by the runtime in any way, so it's wasted space. This makes both shared framework and probably more importantly any self-contained app bigger.
On linux-x64 these files combined are almost 7MB in size.

Testing

Verified that the files are not packaged into the runtime packages produced by the dotnet/runtime repo build.

Risk

I think it's low - the affected libraries are all internal and we don't document their APIs. At runtime they're only used through PInvoke which doesn't use .a files for anything. The only possible break would be if somebody used the files to link against the native libraries - for which we don't document any APIs and they're considered internal implementation detail.
The affected files are:

libSystem.IO.Compression.Native.a
libSystem.Native.a
libSystem.Net.Http.Native.a
libSystem.Net.Security.Native.a
libSystem.Security.Cryptography.Native.OpenSsl.a

Note that we shipped these in 3.1 both in the shared framework as well as when publishing self-contained apps. So it's not a regression in 5.0 to keep shipping them if we decide to do so.

There's no use for the .a files in the shared framework or runtime pack, they just increase disk size.

Also not that we didn't include them in 3.1, so it's effectively a regression in 5.0.
@Dotnet-GitSync-Bot
Copy link
Copy Markdown
Collaborator

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@vitek-karas vitek-karas added this to the 5.0.0 rc2 milestone Sep 8, 2020
Copy link
Copy Markdown
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

Approved. We can take this for consideration in RC2

@jeffschwMSFT jeffschwMSFT added the Servicing-consider Issue for next servicing release review label Sep 9, 2020
@karelz karelz modified the milestones: 5.0.0 rc2, 5.0.0 Sep 9, 2020
@jeffschwMSFT jeffschwMSFT removed the Servicing-consider Issue for next servicing release review label Sep 11, 2020
@jeffschwMSFT
Copy link
Copy Markdown
Member

Reconsidered due to the potential breaking nature.

@vitek-karas vitek-karas reopened this Sep 11, 2020
@danmoseley
Copy link
Copy Markdown
Member

Just curious, for context, what is the size of a hello world self contained app, of which this 7MB is a part?

@jeffschwMSFT
Copy link
Copy Markdown
Member

We recently published numbers in our trimming blog entry (https://devblogs.microsoft.com/dotnet/app-trimming-in-net-5/). 7mb is roughly 10%

@jeffschwMSFT
Copy link
Copy Markdown
Member

Moving to .NET 6

@vitek-karas vitek-karas deleted the backport/pr-41966-to-release/5.0-rc2 branch September 15, 2020 11:08
@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants