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

React to breaking RID change in .NET 8 Preview 6 #543

Closed
halter73 opened this issue Jun 22, 2023 · 8 comments
Closed

React to breaking RID change in .NET 8 Preview 6 #543

halter73 opened this issue Jun 22, 2023 · 8 comments

Comments

@halter73
Copy link

There's a breaking change to the .NET SDK coming in .NET 8 Preview 6 (Not preview 5 like the docs indicate @gewarren) that makes any app depending on SQLitePCLRaw.core to output a warning like the following at runtime:

You need to install the latest preview 6 SDK which isn't yet released to repo. In the meantime, you can install the nightlies from https://github.com/dotnet/installer#table

Once you do, you can create a basic console app using something like dotnet new console, make sure you're using a preview6 SDK with a global.json, replace the csproj with:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="SQLitePCLRaw.lib.e_sqlite3" Version="2.1.5" />
  </ItemGroup>

</Project>

If you run or publish the app, you see the following warning. Fortunately, this does not stop the app from running successfully, but it adds noise to the output of any app depending on the package directly or transitively.

> dotnet run
D:\dev\.dotnet\sdk\8.0.100-preview.6.23315.26\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.target
s(267,5): warning NETSDK1206: Found version-specific or distribution-specific runtime identifier(s): alpine-arm, alpine
-arm64, alpine-x64, browser-wasm, maccatalyst-arm64, maccatalyst-x64. Affected libraries: SQLitePCLRaw.lib.e_sqlite3. I
n .NET 8.0 and higher, assets for version-specific and distribution-specific runtime identifiers will not be found by d
efault. See https://aka.ms/dotnet/rid-usage for details. [D:\dev\manual-tests-issue-2163\manual-tests-issue-21
63.csproj]
Hello, World!

My understanding is that RIDs like alpine-arm should be replaced with just linux-musl-arm which already exists. Similarly, browser-wasm should be replaced with just wasm. I'm not sure about the maccatalyst targets. I assume the osx binaries are incompatible since they come from a different build artifact in the nuspec.

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

@gewarren @elinor-fung @richlander I think the breaking change announcement might need to go into a lot more detail about what's allowed. It wasn't clear to me that wasm is probably the intended replacement for browser-wasm until looking at dotnet/runtime#83246. WASM isn't mentioned anywhere in the breaking change announcement. Neither are the full list of OS's, libc versions, and processor architectures.

@davidortinau Do you know what the plan is for libraries that target maui-supported RIDs like maccatalys, android and ios?

@roji Heads up in case you start seeing this in Microsoft.Data.Sqlite.Core

@roji
Copy link

roji commented Jun 22, 2023

Thanks @halter73, /cc @bricelam

@elinor-fung
Copy link

Similarly, browser-wasm should be replaced with just wasm. I'm not sure about the maccatalyst targets.

This is actually a bug in the warning. It should not be flagging those two. dotnet/sdk#33584 should be fixing it.

@elinor-fung
Copy link

My understanding is that RIDs like alpine-arm should be replaced with just linux-musl-arm which already exists.

It seems to be a direct copy. I think alpine-* should just go away:

// TODO seems sad to put two copies of each musl, one for linux-musl- RID and one for alpine- RID
write_nuspec_file_entry_native_linux(lib, "musl-x64", "linux-musl-x64", f);
write_nuspec_file_entry_native_linux(lib, "musl-armhf", "linux-musl-arm", f);
write_nuspec_file_entry_native_linux(lib, "musl-arm64", "linux-musl-arm64", f);
// TODO seems sad to put two copies of each musl, one for linux-musl- RID and one for alpine- RID
write_nuspec_file_entry_native_linux(lib, "musl-x64", "alpine-x64", f);
write_nuspec_file_entry_native_linux(lib, "musl-armhf", "alpine-arm", f);
write_nuspec_file_entry_native_linux(lib, "musl-arm64", "alpine-arm64", f);

@ericsink
Copy link
Owner

So the musl part of this change looks straightforward. I just need to delete those alpine RIDs.

The change from browser-wasm to wasm would be straightforward as well, if in fact that is the needed change. I'm not clear on that.

And I'm even less clear about whether any other changes are needed w.r.t. MAUI stuff.

But none of this is difficult once I'm sure I'm doing it right. :-)

@elinor-fung
Copy link

The only change needed should be removing the alpine RIDs.

The other ones that were flagged (brower, maccatalyst) were flagged incorrectly - it was a bug in the warning itself.

@bricelam
Copy link
Contributor

bricelam commented Aug 10, 2023

@elinor-fung The Alpine RIDs were removed from the package, but we're still getting an error in dotnet/efcore:

D:\source\efcore.dotnet\sdk\8.0.100-rc.1.23407.2\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(267,5): er
ror NETSDK1206: Found version-specific or distribution-specific runtime identifier(s): browser, browser-wasm, linux-arm
, linux-arm64, linux-armel, linux-mips64, linux-musl-arm, linux-musl-arm64, linux-musl-x64, linux-ppc64le, linux-s390x,
linux-x64, linux-x86, maccatalyst-arm64, maccatalyst-x64, osx-arm64, osx-x64, win-arm, win-arm64, win-x64, win-x86. Af
fected libraries: SQLitePCLRaw.lib.e_sqlite3, System.Text.Encodings.Web. In .NET 8.0 and higher, assets for version-spe
cific and distribution-specific runtime identifiers will not be found by default. See https://aka.ms/dotnet/rid-usage f
or details. [D:\source\efcore\src\EFCore.Sqlite\EFCore.Sqlite.csproj]

We're using a very recent build of the SDK:

.NET SDK:
 Version:   8.0.100-rc.1.23407.2
 Commit:    c7045b1a4a

The SQLitePCLRaw.lib.e_sqlite3 package now has the following:

  • runtimes/
    • browser-wasm/
    • linux-arm/
    • linux-arm64/
    • linux-armel/
    • linux-mips64/
    • linux-musl-arm/
    • linux-musl-arm64/
    • linux-musl-x64/
    • linux-ppc64le/
    • linux-s390x/
    • linux-x64/
    • linux-x86/
    • maccatalyst-arm64/
    • maccatalyst-x64/
    • osx-arm64/
    • osx-x64/
    • win-arm/
    • win-arm64/
    • win-x64/
    • win-x86/
    • win10-arm/
      • nativeassets/
        • uap10.0/
    • win10-arm64/
      • nativeassets/
        • uap10.0/
    • win10-x64/
      • nativeassets/
        • uap10.0/
    • win10-x86/
      • nativeassets/
        • uap10.0/

@elinor-fung
Copy link

That looks like dotnet/sdk#34003 (based on logs from https://dev.azure.com/dnceng-public/public/_build/results?buildId=369044&view=results).

@groogiam
Copy link

groogiam commented May 8, 2024

@ericsink I am getting this error when compiling a class library with SDK 8.0.204. which references Microsoft.EntityFrameworkCore.Sqlite.Core 8.0.4

Severity	Code	Description	Project	File	Line	Suppression State
Warning	NETSDK1206	Found version-specific or distribution-specific runtime identifier(s): alpine-x64. Affected libraries: SQLitePCLRaw.lib.e_sqlite3. 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.	AppPotion.Sandbox	C:\Program Files\dotnet\sdk\8.0.204\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets	284

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

6 participants