Yubico/Yubico.NET.SDK

Remove Yubico.NativeShims distribution specific runtime identifiers

SheepReaper opened this issue · 5 comments

When building an application that targets .NET8, the compiler emits a warning:

/home/bryan/.dotnet/sdk/8.0.100-preview.7.23376.3/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(267,5): warning NETSDK1206: Found version-specific or distribution-specific runtime identifier(s): ubuntu-arm64, ubuntu-x64, ubuntu-x86. Affected libraries: Yubico.NativeShims. In .NET 8.0 and higher, assets for version-specific and distribution-specific runtime identifiers will not be found by default. See https://aka.ms/dotnet/rid-usage for details. [/home/bryan/src/yk-csr-generator/src/yk-csr-cli/GenerateYKCSR.csproj]

The issue as I understand it is that MS is trying to stop updating the RID graph. They suggest switching to portable RIDs such as linux-arm64, linux-x64, and linux-x86

Ref: https://learn.microsoft.com/en-us/dotnet/core/compatibility/deployment/8.0/rid-asset-list

Workaround:
I have to add the following to my project to revert the legacy behavior:

  <ItemGroup>
    <RuntimeHostConfigurationOption Include="System.Runtime.Loader.UseRidGraph" Value="true" />
  </ItemGroup>

I believe your build system is inferring the RID from the host that's running the build command. You don't need to change the build host, just specify the RID explicitly on the build command. Or use another option besides -r | --runtime idr, but there's two other options that let you specify the os and arch separately if you need to magic one or both of those.

Interesting - thank you for alerting me to this breaking change on MS's part. I will need some time to look into this. But it sounds like we should address this.

Most of the team is away on work conference and/or holiday. It may be another week or two before we can really look into this. But I wanted to at least acknowledge the issue. Thanks for reporting it!

This is getting adressed in the next release. Will keep this issue open until then. Again, thanks for reporting !

@SheepReaper Hi! This was adressed in out 1.10 release. Can you confirm that you're not seeing the build warning any longer?

Looks great, no warning.