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

[API Compat] Not targeting .NET 8 framework in versions 8.* #43801

Open
dosper7 opened this issue Oct 1, 2024 · 6 comments
Open

[API Compat] Not targeting .NET 8 framework in versions 8.* #43801

dosper7 opened this issue Oct 1, 2024 · 6 comments
Labels
Area-ApiCompat untriaged Request triage from a team member

Comments

@dosper7
Copy link

dosper7 commented Oct 1, 2024

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.

apicompat --version
8.0.401+41b13414c4a35aac269719f7281cf74c9c9aae31

Installing the .NET 6 runtime makes the tool work (version 6.0.33):

    wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
    chmod +x dotnet-install.sh
    ./dotnet-install.sh --runtime dotnet --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:
image

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:
image

I realize I might be missing something, but I would like to understand the rationale or reasons behind this discrepancy. Can you help?

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-ApiCompat untriaged Request triage from a team member labels Oct 1, 2024
Copy link
Contributor

@dotnet/area-infrastructure-libraries a new issue has been filed in the ApiCompat area, please triage

@KalleOlaviNiemitalo
Copy link

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

@dosper7
Copy link
Author

dosper7 commented Oct 2, 2024

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?

@KalleOlaviNiemitalo
Copy link

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.

@KalleOlaviNiemitalo
Copy link

The dotnet tool install --allow-roll-forward feature was #37231 and it's in .NET SDK 8.0.300.

For older SDKs, you can use the DOTNET_ROLL_FORWARD environment variable.

@KalleOlaviNiemitalo
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-ApiCompat untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

2 participants