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

dotnet cli self-contained publish does not use the native library #1

Open
Liriel opened this issue Jan 29, 2020 · 3 comments
Open

dotnet cli self-contained publish does not use the native library #1

Liriel opened this issue Jan 29, 2020 · 3 comments

Comments

@Liriel
Copy link

Liriel commented Jan 29, 2020

Hi erikest!
thanks for all the research and for providing the nuget packge. It seems though that adding the package does not automatically copy the correct library when pubilshing.

steps to reproduce:

create a new project and add the packages

dotnet new console -o grpcTest
dotnet add package Grpc.Core
dotnet add package Grpc.Net.Client
dotnet add package Grpc.Tools
dotnet add package libgrpc_csharp_ext.arm7 --version 1.1.0

publish to arm
dotnet publish -r linux-arm --self-contained

checking the hashes I get the pc one:

md5sum bin/Debug/netcoreapp3.1/linux-arm/libgrpc_csharp_ext.x86.so
00d9eba5e8ae5fd3da05df17699ce16b  bin/Debug/netcoreapp3.1/linux-arm/libgrpc_csharp_ext.x86.so

should be 46a8d1fe8e97b9578148443c886f41eb (fron the latest nuget package)

any Idea what's goning on?

@erikest
Copy link
Owner

erikest commented Jan 29, 2020

I don't yet know what the underlying reason is, but I've filed this issue on the CLI github to seek help.

Something appears to have changed in the package selection process between .net core 3.0 preview and 3.1. If you publish verbose, you'll see a line where it has a conflict between the libraries in the linux-arm/ folder and the x86 compiled version in the linux/ folder. These two libraries share a name for reasons I outlined in the article, but it seems that the package selection process is finding both and choosing the the other 'arbitrarily'. The behavior used to be that it would look for a library in the specific rid folder, i.e. linux-arm, and choose that, and then if it did not find the specific rid, fallback to the next available one based on the rid graph (see: [RID graph](https://docs.microsoft.com/en-us/dotnet/core/rid-catalog and linux-arm rid).

So it appears to be a regression in the behavior on the CLI side as there should be no name conflict issue when a specific / exists.

dotnet/sdk#4195

@erikest
Copy link
Owner

erikest commented Jan 29, 2020

I updated the other issue with better description and your succinct repro steps, thanks!

@Liriel
Copy link
Author

Liriel commented Jan 30, 2020

it appears the bug made it into the 3.0 release as well (downgrading to 3.0.100 did not change the behavior for me)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants