-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Host packages should not use runtime.json restore infrastructure #49137
Comments
Tagging subscribers to this area: @vitek-karas, @agocke Issue DetailsThe host packages still use There are alternatives to runtime.json, i.e.:
cc @agocke @vitek-karas @ericstj
|
The single-package option will require us to add another “join” job like the CrossOS DAC job to get all the artifacts in one place. |
IMHO we should just deprecate the runtime.json and make the only method of consumption be SDK and have it work the same way as runtime packs.
Is this just the internal repo transport or does it show up in the actual product? |
It's not exposed in the product, it's just on the consumption side: https://github.com/dotnet/sdk/blob/0d50c13812b626999aef1853bf23295f38287807/src/Resolvers/Microsoft.DotNet.MSBuildSdkResolver/Microsoft.DotNet.MSBuildSdkResolver.csproj#L58. Some tests as well in the sdk repo. |
Can you please share some more information on the work necessary for that? |
This stuff: https://github.com/dotnet/installer/blob/944ec2eb293e807d5235439ca0186d9725856beb/src/redist/targets/GenerateBundledVersions.targets#L100-L120 Essentially what you said above: For any internal consumption we might need to see what the usage is to find a suitable replacement. Might be leveraging those targets in the SDK which compute the right RID-specific package. Might be just referencing everything and let nuget choose. The host isn't so big, so referencing everything isn't such a huge burden.
Another alternative to this is meta-package with normal references that apply exclusively (see runtime.native.System.IO.Ports). |
I prefer any option that doesn't require a join job (as Jeremy commented above #49137 (comment)).
Ok that needs closer inspection. If we add Known items to the defaultversions generated file, doesn't that mean, that the packages will always be downloaded? Anyway, someone will need to take a look and make a switch. |
When doing that it would also be good to apply two code clean-ups:
|
Not suggesting a join. Suggesting meta-package that "knows" the id's and versions of child packages. Essentially same as we do today but put the dependencies in nuspec instead of runtime.json. |
cc @tmds |
@ericstj Is there a way to specify RID-specific dependencies in nuspec, to get the same download optimizations that are possible with runtime.json? |
No, it's not possible. NuGet/Home#1660 dotnet/sdk#4552 |
It is unfortunately not possible to conditionally reference native assets depending on the installed tool's runtime platform. This means we need to assume the dependency will be restored at the project level and look it up via the project.assets.json, rather than the runtime deps. See - How a tool project is installed/restored: https://github.com/dotnet/sdk/blob/main/src/Cli/dotnet/ToolPackage/ToolPackageInstaller.cs - Native files not being automatically added to the runtime deps.json: dotnet/sdk#11373 - How to do that via custom targets, but this wouldn't be possible on the target machine when restoring the temp project created for global tools: https://github.com/ericstj/sample-code/blob/nativeLibSample/addNative/addNative.csproj - How runtime.json might work but it's going away: dotnet/runtime#11404 - Really going away: dotnet/runtime#49137 - How it's still not solved for .net6: NuGet/Home#5862
It is unfortunately not possible to conditionally reference native assets depending on the installed tool's runtime platform. This means we need to assume the dependency will be restored at the project level and look it up via the project.assets.json, rather than the runtime deps. See - How a tool project is installed/restored: https://github.com/dotnet/sdk/blob/main/src/Cli/dotnet/ToolPackage/ToolPackageInstaller.cs - Native files not being automatically added to the runtime deps.json: dotnet/sdk#11373 - How to do that via custom targets, but this wouldn't be possible on the target machine when restoring the temp project created for global tools: https://github.com/ericstj/sample-code/blob/nativeLibSample/addNative/addNative.csproj - How runtime.json might work but it's going away: dotnet/runtime#11404 - Really going away: dotnet/runtime#49137 - How it's still not solved for .net6: NuGet/Home#5862
cc @elinor-fung, @agocke With f76045c, the remaining host package that still uses the runtime.json infrastructure is Unfortunately another package got added into the installer/pkg umbrella which depends on this infra: https://github.com/dotnet/runtime/tree/main/src/installer/pkg/projects/Microsoft.DotNet.ILCompiler. After both projects got converted to NuGet Pack task based ones, we will finally be able to delete all the ancient infrastructure around supporting runtime.json based packages under src/installer. |
Is this done? I think the |
I still see runtime.json in https://nuget.info/packages/Microsoft.DotNet.ILCompiler/9.0.0-preview.6.24327.7. What's the package you have looked at? This was recently discussed in #102908 . We have removed runtime.json from bundled source built ILCompiler packages, but kept it for regular ILCompiler package. |
I was looking at the source code and misread the change to be the other direction (we only include runtime.json in source build). OK, I'll keep this around. |
The host packages still use
runtime.json
which was the mechanism to define RID based package dependencies in the .NET Core 2.x era. That feature was never publicly exposed by NuGet and is discussed to be removed in NET 6. For more details see NuGet/Home#5862.There are alternatives to runtime.json, i.e.:
dotnet/sdk still consumes the meta package via the runtime.json mechanism which should be considered when switching to a different restore mechanism.
Host packages:
cc @agocke @vitek-karas @ericstj
The text was updated successfully, but these errors were encountered: