Update csharp SDK to LTS versions (#27966)

* update C# SDK

* regenerate dockerfiles

* install .NET6 and .NET Core 3.1

* regenerate dockerfiles

* change netcoreapp2.1 targets to netcoreapp3.1

* update installed SDKs in aarch64 C# job

* update run_tests scripts to use netcoreapp3.1 for C#
pull/28117/head
Jan Tattermusch 3 years ago committed by GitHub
parent 7910c5f8ae
commit 79b58431ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/csharp/Grpc.Core.Tests/AppDomainUnloadTest.cs
  2. 2
      src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj
  3. 2
      src/csharp/Grpc.Core.Tests/SanityTest.cs
  4. 2
      src/csharp/Grpc.Examples.MathClient/Grpc.Examples.MathClient.csproj
  5. 2
      src/csharp/Grpc.Examples.MathServer/Grpc.Examples.MathServer.csproj
  6. 2
      src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj
  7. 2
      src/csharp/Grpc.Examples/Grpc.Examples.csproj
  8. 4
      src/csharp/Grpc.HealthCheck.Tests/Grpc.HealthCheck.Tests.csproj
  9. 2
      src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj
  10. 2
      src/csharp/Grpc.IntegrationTesting.QpsWorker/Grpc.IntegrationTesting.QpsWorker.csproj
  11. 2
      src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj
  12. 2
      src/csharp/Grpc.IntegrationTesting.StressClient/Grpc.IntegrationTesting.StressClient.csproj
  13. 2
      src/csharp/Grpc.IntegrationTesting.XdsClient/Grpc.IntegrationTesting.XdsClient.csproj
  14. 2
      src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj
  15. 2
      src/csharp/Grpc.Microbenchmarks/Grpc.Microbenchmarks.csproj
  16. 2
      src/csharp/Grpc.Reflection.Tests/Grpc.Reflection.Tests.csproj
  17. 2
      src/csharp/Grpc.Tools.Tests/Grpc.Tools.Tests.csproj
  18. 3
      src/csharp/install_dotnet_sdk.ps1
  19. 17
      templates/tools/dockerfile/csharp_dotnetcli_deps.include
  20. 17
      tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile
  21. 17
      tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile
  22. 17
      tools/dockerfile/test/csharp_buster_x64/Dockerfile
  23. 8
      tools/internal_ci/helper_scripts/prepare_build_macos_rc
  24. 6
      tools/internal_ci/linux/aws/grpc_run_basictests_csharp_aarch64.sh
  25. 2
      tools/run_tests/performance/run_worker_csharp.sh
  26. 4
      tools/run_tests/run_interop_tests.py
  27. 2
      tools/run_tests/run_tests.py

@ -25,7 +25,7 @@ namespace Grpc.Core.Tests
{
public class AppDomainUnloadTest
{
#if NETCOREAPP1_1 || NETCOREAPP2_1
#if NETCOREAPP
[Test]
[Ignore("Not supported for CoreCLR")]
public void AppDomainUnloadHookCanCleanupAbandonedCall()

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net45;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
<OutputType>Exe</OutputType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

@ -31,7 +31,7 @@ namespace Grpc.Core.Tests
public class SanityTest
{
// TODO: make sanity test work for CoreCLR as well
#if !NETCOREAPP1_1 && !NETCOREAPP2_1
#if !NETCOREAPP
/// <summary>
/// Because we depend on a native library, sometimes when things go wrong, the
/// entire NUnit test process crashes. To be able to track down problems better,

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net45;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
<OutputType>Exe</OutputType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net45;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
<OutputType>Exe</OutputType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net45;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
<OutputType>Exe</OutputType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net45;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net45;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
<OutputType>Exe</OutputType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
<DefineConstants>$(DefineConstants);GRPC_SUPPORT_WATCH;</DefineConstants>
</PropertyGroup>

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net45;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
<OutputType>Exe</OutputType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net45;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
<OutputType>Exe</OutputType>
<ServerGarbageCollection>true</ServerGarbageCollection>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net45;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
<OutputType>Exe</OutputType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net45;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
<OutputType>Exe</OutputType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net45;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
<OutputType>Exe</OutputType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net45;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
<OutputType>Exe</OutputType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net461;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net461;netcoreapp3.1</TargetFrameworks>
<OutputType>Exe</OutputType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net45;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
<OutputType>Exe</OutputType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TargetFrameworks>net45;netcoreapp2.1</TargetFrameworks>
<TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
<OutputType>Exe</OutputType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

@ -22,4 +22,5 @@ Invoke-WebRequest -Uri $InstallScriptUrl -OutFile $InstallScriptPath
# Installed versions should be kept in sync with
# templates/tools/dockerfile/csharp_dotnetcli_deps.include
&$InstallScriptPath -Version 2.1.816
&$InstallScriptPath -Version 3.1.415
&$InstallScriptPath -Version 6.0.100

@ -1,10 +1,17 @@
# Install dotnet SDK
ENV DOTNET_SDK_VERSION 2.1.816
RUN curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz ${'\\'}
# Install .NET Core 3.1 (to be able to run the netcoreapp3.1 targets)
RUN curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/3.1.415/dotnet-sdk-3.1.415-linux-x64.tar.gz ${'\\'}
&& mkdir -p /usr/share/dotnet ${'\\'}
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet ${'\\'}
&& rm dotnet.tar.gz ${'\\'}
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
&& rm dotnet.tar.gz
# Install .NET 6
RUN curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100/dotnet-sdk-6.0.100-linux-x64.tar.gz ${'\\'}
&& mkdir -p /usr/share/dotnet ${'\\'}
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet ${'\\'}
&& rm dotnet.tar.gz
# Make sure "dotnet" is on PATH
RUN ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
# Trigger the population of the local package cache
ENV NUGET_XMLDOC_MODE skip

@ -81,13 +81,20 @@ RUN apt-get update && apt-get install -y \
nuget \
&& apt-get clean
# Install dotnet SDK
ENV DOTNET_SDK_VERSION 2.1.816
RUN curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz \
# Install .NET Core 3.1 (to be able to run the netcoreapp3.1 targets)
RUN curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/3.1.415/dotnet-sdk-3.1.415-linux-x64.tar.gz \
&& mkdir -p /usr/share/dotnet \
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
&& rm dotnet.tar.gz \
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
&& rm dotnet.tar.gz
# Install .NET 6
RUN curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100/dotnet-sdk-6.0.100-linux-x64.tar.gz \
&& mkdir -p /usr/share/dotnet \
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
&& rm dotnet.tar.gz
# Make sure "dotnet" is on PATH
RUN ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
# Trigger the population of the local package cache
ENV NUGET_XMLDOC_MODE skip

@ -81,13 +81,20 @@ RUN apt-get update && apt-get install -y \
nuget \
&& apt-get clean
# Install dotnet SDK
ENV DOTNET_SDK_VERSION 2.1.816
RUN curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz \
# Install .NET Core 3.1 (to be able to run the netcoreapp3.1 targets)
RUN curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/3.1.415/dotnet-sdk-3.1.415-linux-x64.tar.gz \
&& mkdir -p /usr/share/dotnet \
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
&& rm dotnet.tar.gz \
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
&& rm dotnet.tar.gz
# Install .NET 6
RUN curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100/dotnet-sdk-6.0.100-linux-x64.tar.gz \
&& mkdir -p /usr/share/dotnet \
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
&& rm dotnet.tar.gz
# Make sure "dotnet" is on PATH
RUN ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
# Trigger the population of the local package cache
ENV NUGET_XMLDOC_MODE skip

@ -84,13 +84,20 @@ RUN apt-get update && apt-get install -y \
nuget \
&& apt-get clean
# Install dotnet SDK
ENV DOTNET_SDK_VERSION 2.1.816
RUN curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz \
# Install .NET Core 3.1 (to be able to run the netcoreapp3.1 targets)
RUN curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/3.1.415/dotnet-sdk-3.1.415-linux-x64.tar.gz \
&& mkdir -p /usr/share/dotnet \
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
&& rm dotnet.tar.gz \
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
&& rm dotnet.tar.gz
# Install .NET 6
RUN curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100/dotnet-sdk-6.0.100-linux-x64.tar.gz \
&& mkdir -p /usr/share/dotnet \
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
&& rm dotnet.tar.gz
# Make sure "dotnet" is on PATH
RUN ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
# Trigger the population of the local package cache
ENV NUGET_XMLDOC_MODE skip

@ -164,6 +164,14 @@ then
export NUGET_XMLDOC_MODE=skip
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true
export DOTNET_CLI_TELEMETRY_OPTOUT=true
# Installed versions should be kept in sync with
# templates/tools/dockerfile/csharp_dotnetcli_deps.include
time curl -O https://download.visualstudio.microsoft.com/download/pr/e0fe8c99-e33c-4d75-bd4e-2478ed3ee35a/ff06e47afc7c13bdbbaa50a9713ac772/dotnet-sdk-3.1.415-osx-x64.pkg
time sudo installer -pkg ./dotnet-sdk-3.1.415-osx-x64.pkg -target /
time curl -O https://download.visualstudio.microsoft.com/download/pr/14a45451-4cc9-48e1-af69-0aff75891d09/ff6e83986a2a9a535015fb3104a90a1b/dotnet-sdk-6.0.100-osx-x64.pkg
time sudo installer -pkg ./dotnet-sdk-6.0.100-osx-x64.pkg -target /
fi
if [ "${PREPARE_BUILD_INSTALL_DEPS_PHP}" == "true" ]

@ -23,8 +23,10 @@ sudo pip install six
# install gRPC C# pre-requisites
curl -sSL -o dotnet-install.sh https://dot.net/v1/dotnet-install.sh
chmod u+x dotnet-install.sh
./dotnet-install.sh --channel 2.1 # needed for the netcoreapp2.1 targets
./dotnet-install.sh --channel 5.0
# Installed .NET versions should be kept in sync with
# templates/tools/dockerfile/csharp_dotnetcli_deps.include
./dotnet-install.sh --channel 3.1
./dotnet-install.sh --channel 6.0
export PATH="$HOME/.dotnet:$PATH"
# Disable some unwanted dotnet options

@ -18,6 +18,6 @@ set -ex
cd "$(dirname "$0")/../../.."
# needed to correctly locate testca
cd src/csharp/Grpc.IntegrationTesting.QpsWorker/bin/Release/netcoreapp2.1
cd src/csharp/Grpc.IntegrationTesting.QpsWorker/bin/Release/netcoreapp3.1
dotnet exec Grpc.IntegrationTesting.QpsWorker.dll "$@"

@ -160,8 +160,8 @@ class CSharpLanguage:
class CSharpCoreCLRLanguage:
def __init__(self):
self.client_cwd = 'src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp2.1'
self.server_cwd = 'src/csharp/Grpc.IntegrationTesting.Server/bin/Debug/netcoreapp2.1'
self.client_cwd = 'src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/netcoreapp3.1'
self.server_cwd = 'src/csharp/Grpc.IntegrationTesting.Server/bin/Debug/netcoreapp3.1'
self.safename = str(self)
def client_cmd(self, args):

@ -901,7 +901,7 @@ class CSharpLanguage(object):
assembly_extension = '.exe'
if self.args.compiler == 'coreclr':
assembly_subdir += '/netcoreapp2.1'
assembly_subdir += '/netcoreapp3.1'
runtime_cmd = ['dotnet', 'exec']
assembly_extension = '.dll'
else:

Loading…
Cancel
Save