Open dosper7 opened 2 days ago
@dotnet/area-infrastructure-libraries a new issue has been filed in the ApiCompat area, please triage
If I inspect a more recent version (e.g., .NET 9 RC), I notice it depends on the latest LTS version (.NET 8)
That's intentional in https://github.com/dotnet/sdk/pull/38485
If I inspect a more recent version (e.g., .NET 9 RC), I notice it depends on the latest LTS version (.NET 8)
That's intentional in #38485
That means that .NET 8 base containers can't run Api Compat without having the .NET 6 runtime installed?
Well my comment was only for the net9 rc version of the tool.
But IIRC an option was added to dotnet tool install
to allow running any tool on a higher version of .NET Runtime than it targets (major version roll-forward). I don't remember whether that is in .NET SDK 8 or only in 9. Doesn't seem to be documented at https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-tool-install yet.
The dotnet tool install --allow-roll-forward
feature was https://github.com/dotnet/sdk/pull/37231 and it's in .NET SDK 8.0.300.
For older SDKs, you can use the DOTNET_ROLL_FORWARD environment variable.
As for why Microsoft.DotNet.ApiCompat.Tool 8.0.402 targets .NET 6, I don't know the official reason but I'd guess that they wanted to have some version of the tool runnable on .NET 6 LTS until that goes out of support; no 6.* version of the tool was published; the 7.* versions of the tool were built as part of .NET SDK 7 which is already out of support; so the responsibility falls to 8.* versions of the tool. They could have made it multitarget .NET 6 and .NET 8 though.
I am building a CI/CD pipeline using a .NET 8-based container image. In this pipeline, I have a validation step where I want to check for potential breaking changes and fail if any are detected. To my surprise, when I installed the Microsoft.DotNet.ApiCompat.Tool and tried to use it, it failed because it targets the .NET 6 framework, which I do not have installed.
Installing the .NET 6 runtime makes the tool work (version 6.0.33):
Question:
Why isn't there version parity between the API Compat tool version 8.* and its dependent framework?
When I check the API Compat tool version 8.0.4 on the NuGet Package Explorer, I see it has a dependency on .NET 6:
If I inspect a more recent version (e.g., .NET 9 RC), I notice it depends on the latest LTS version (.NET 8), whereas I was expecting it to depend on .NET 9:
I realize I might be missing something, but I would like to understand the rationale or reasons behind this discrepancy. Can you help?