csharp
csharp copied to clipboard
Removing of dotnet 3.1 sdk from ci
As documented in the project readme currently .Net Core 3.1 is not supported.
This pull request removes .Net Core 3.1 from files used in the CI and test projects (KubernetesClient.Tests and E2E.Tests).
From my analysis, no project in the /src folder uses .Net Core 3.1 and can be safely removed.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: m3nax
Once this PR has been reviewed and has the lgtm label, please assign tg123 for approval by writing /assign @tg123 in a comment. For more information see:The Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
cc @tg123
This looks fine with me, but I want Boshi's input before we merge this.
Thanks for the PR the netstandard2.0/netstandard2.1 will be left uncovered if netcore3.1 was removed.
lets defer the after the removal of netstandard2.1 and should find alternative runtime to cover netstandard2.0
Why will it be left uncovered if netcoreapp3.1 has been removed?
This pull, without .NET 3.1 SDK, already build netstandard2.0 and netstandard2.1 libraries build log of pull -> https://github.com/kubernetes-client/csharp/runs/8085624502?check_suite_focus=true#step:5:39472
I have created a project and tested compilation only with .NET 6.0 SDK and everything seems to work. Project -> https://github.com/m3nax/ClassLibraryTest Build output -> https://github.com/m3nax/ClassLibraryTest/runs/8088826769?check_suite_focus=true#step:5:6
I checked if a library contains the .NET 3.1 framework target but from what I see in Nuget.org there is nothing. https://www.nuget.org/packages/KubernetesClient https://www.nuget.org/packages/KubernetesClient.Basic https://www.nuget.org/packages/KubernetesClient.Models
What is the difference of netstandard2.0 compilation between .NET 3.1 SDK and .NET 6.0 SDK?
.net will find closet library's target to the proj which depends on it for exmaple, libA(target net5 net6) when your app B (net6)->libA, the dist folder will copy dlls from libA/net/A.dll
I'm not understanding what the problem is.
From what I know and I have checked (lib version 9.0.25):
| Target Framework | Supported by project | SDKs that can compile the lib version | Shipped in KubernetesClient | Shipped inKubernetesClient.Basic | Shipped in KubernetesClient.Models | Shipped in KubernetesClient.Classic |
|---|---|---|---|---|---|---|
| netstandard2.0* | x | .NET Core 3.1/5.0/6.0 | x | x | x | |
| netstandard2.1 | x | .NET Core 3.1/5.0/6.0 | x | |||
| netcoreapp3.1 | .NET Core 3.1 | |||||
| net5.0 | x | .NET Core 5.0 | x | |||
| net6.0 | x | .NET Core 6.0 | x | |||
| net48* | x | (supported with netstandard2.0) | x |
Which lib is taken during compilation (closets to target framework) compatibility matrix
| Program A compilation framework | Lib. version taken by compiler for KubernetesClient | Lib. version taken by compiler for KubernetesClient.Basic | Lib. version taken by compiler for KubernetesClient.Models | Lib. version taken by compiler for KubernetesClient.Classic |
|---|---|---|---|---|
| >= .NetCore 2.0 | NetStandard2.0 | NetStandard2.0 | NetStandard2.0 | |
| >= .NetCore 3.1 | netstandard2.1 | NetStandard2.0 | NetStandard2.0 | NetStandard2.0 |
| >= .NetCore 5.0 | net5.0 | NetStandard2.0 | NetStandard2.0 | NetStandard2.0 |
| >= .NetCore 6.0 | net6.0 | NetStandard2.0 | NetStandard2.0 | NetStandard2.0 |
| >= .NetFramework 4.6.2 | NetStandard2.0 | NetStandard2.0 | NetStandard2.0 | |
| >= .NetFramework 4.8.0 | NetStandard2.0 | NetStandard2.0 | net48 |
Nuget KubernetesClient 9.0.25 content:

Nuget KubernetesClient.Basic 9.0.25 content:

Nuget KubernetesClient.Classic 9.0.25 content:

Nuget KubernetesClient.Models 9.0.25 content:

As you can see in the nugets packages netcoreapp3.1 target moniker is not present (missing "netcoreapp3.1" folder).
It is safe for me to remove the .Net Core 3.1 from the pipelines and the two test projects because it is not supported / present in nuget packages / used by projects in the src folder and is not required for compilation.
netcore3.1 here is to cover the code path of netstandard2.0/2.1
when you are using net6, it will link the dll in net6 folder. while netcore3.1 is not net6, the complier will pick the closest dll, netstandard2.1, to run tests
until there is a better way to cover net48 code and netsantdaed2.1 is still supported, netcore3.1 is the best solution i ever know
@m3nax: PR needs rebase.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
Blocked by #1029