Skip to content

Self contained publish on linux includes .a files #3447

@peterhuene

Description

@peterhuene

@vitek-karas commented on Wed Feb 06 2019

Using relatively new 3.0 SDK

mkdir ca1
cd ca1
dotnet new console
dotnet publish --self-contained -r linux-x64

In the publish directory there are 6 .a files which don't seem to have any purpose. Basically for every native library (.so) coming from CoreFx, there's a corresponding .a as well:

-rwxrw-rw- 1 vitek vitek 2836614 Feb  5 04:05 System.IO.Compression.Native.a
-rwxrw-rw- 1 vitek vitek   27254 Feb  5 04:05 System.IO.Ports.Native.a
-rwxrw-rw- 1 vitek vitek  396432 Feb  5 04:05 System.Native.a
-rwxrw-rw- 1 vitek vitek   79868 Feb  5 04:05 System.Net.Http.Native.a
-rwxrw-rw- 1 vitek vitek   29400 Feb  5 04:05 System.Net.Security.Native.a
-rwxrw-rw- 1 vitek vitek  906184 Feb  5 04:05 System.Security.Cryptography.Native.OpenSsl.a

I don't think these files are needed for anything.
Per customer report this also reproes on MacOS, but I didn't verify.


@livarcocc commented on Wed Feb 06 2019

@peterhuene can you take a look?


@peterhuene commented on Wed Feb 06 2019

We should only be copying what's in the native assets directory, so if present it gets copied (hence why you get the .txt file too). Did something change in what gets packaged into Microsoft.NETCore.App?

I'll investigate.


@peterhuene commented on Wed Feb 06 2019

I can reproduce this on the current shipping 2.2.103 SDK.

It appears the runtime.$RID.microsoft.netcore.app packages (where $RID is not a Windows-based RID) does indeed contain the static library files in their native assets. As a result, they get treated like native assets like any other files and copied for the publish.

I think this is a core-setup issue. These files should not be packaged for Microsoft.NETCore.App packages on non-Windows platforms.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions