From d96bec2a0b670b774714b54edb09792b7cb58552 Mon Sep 17 00:00:00 2001 From: Sydney Acksman Date: Tue, 5 Mar 2019 17:54:59 -0600 Subject: [PATCH 01/12] Bump target frameworks from netcoreapp1.0 to netcoreapp2.2. Move global.json up to root of repo, change SDK ver to 2.2.100 Change .net core sdk in dockerfile for kokoro to ver 2.2.100 --- Makefile.am | 2 +- .../src/Google.Protobuf.Test/Google.Protobuf.Test.csproj | 4 ++-- csharp/global.json | 5 ----- csharp/src/AddressBook/AddressBook.csproj | 2 +- .../Google.Protobuf.Conformance.csproj | 2 +- .../Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.csproj | 2 +- csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj | 4 ++-- global.json | 5 +++++ kokoro/linux/64-bit/Dockerfile | 3 +-- 9 files changed, 14 insertions(+), 15 deletions(-) delete mode 100644 csharp/global.json create mode 100644 global.json diff --git a/Makefile.am b/Makefile.am index 589b2a9aa563..c97d854a209f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -49,6 +49,7 @@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = protobuf.pc protobuf-lite.pc csharp_EXTRA_DIST= \ + global.json \ csharp/.gitignore \ csharp/CHANGES.txt \ csharp/Google.Protobuf.Tools.targets \ @@ -58,7 +59,6 @@ csharp_EXTRA_DIST= \ csharp/build_tools.sh \ csharp/buildall.sh \ csharp/generate_protos.sh \ - csharp/global.json \ csharp/keys/Google.Protobuf.public.snk \ csharp/keys/Google.Protobuf.snk \ csharp/keys/README.md \ diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj index 6bc1e0ca4d4a..59fbdc8c0e26 100644 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj +++ b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj @@ -2,7 +2,7 @@ Exe - net451;netcoreapp1.0 + net451;netcoreapp2.2 ../../keys/Google.Protobuf.snk true true @@ -24,7 +24,7 @@ - Visual Studio. --> - netcoreapp1.0 + netcoreapp2.2 diff --git a/csharp/global.json b/csharp/global.json deleted file mode 100644 index 080dcb94038b..000000000000 --- a/csharp/global.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "sdk": { - "version": "2.1.3" - } -} diff --git a/csharp/src/AddressBook/AddressBook.csproj b/csharp/src/AddressBook/AddressBook.csproj index 6edfdcabb39b..cb2dd8c84cca 100644 --- a/csharp/src/AddressBook/AddressBook.csproj +++ b/csharp/src/AddressBook/AddressBook.csproj @@ -1,7 +1,7 @@  - netcoreapp1.0 + netcoreapp2.2 Exe Google.Protobuf.Examples.AddressBook.Program False diff --git a/csharp/src/Google.Protobuf.Conformance/Google.Protobuf.Conformance.csproj b/csharp/src/Google.Protobuf.Conformance/Google.Protobuf.Conformance.csproj index b654c0b2cfdf..81bfaf9c892d 100644 --- a/csharp/src/Google.Protobuf.Conformance/Google.Protobuf.Conformance.csproj +++ b/csharp/src/Google.Protobuf.Conformance/Google.Protobuf.Conformance.csproj @@ -1,7 +1,7 @@  - netcoreapp1.0 + netcoreapp2.2 Exe False diff --git a/csharp/src/Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.csproj b/csharp/src/Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.csproj index 4eda641ad67b..173142a05e05 100644 --- a/csharp/src/Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.csproj +++ b/csharp/src/Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.csproj @@ -1,7 +1,7 @@  - netcoreapp1.0 + netcoreapp2.2 Exe False diff --git a/csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj b/csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj index 11adb11faa15..8d7b30fb2761 100644 --- a/csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj +++ b/csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj @@ -1,7 +1,7 @@  - net451;netcoreapp1.0 + net451;netcoreapp2.2 ../../keys/Google.Protobuf.snk true true @@ -24,7 +24,7 @@ - Visual Studio. --> - netcoreapp1.0 + netcoreapp2.2 diff --git a/global.json b/global.json new file mode 100644 index 000000000000..fd60d7372d50 --- /dev/null +++ b/global.json @@ -0,0 +1,5 @@ +{ + "sdk": { + "version": "2.2.100" + } +} diff --git a/kokoro/linux/64-bit/Dockerfile b/kokoro/linux/64-bit/Dockerfile index 3a279e660249..6728f169db47 100644 --- a/kokoro/linux/64-bit/Dockerfile +++ b/kokoro/linux/64-bit/Dockerfile @@ -29,8 +29,7 @@ RUN echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu trusty main" | tee /etc # Install dotnet SDK based on https://www.microsoft.com/net/core#debian # (Ubuntu instructions need apt to support https) -RUN apt-get update && apt-get install -y --force-yes curl libunwind8 gettext && \ - curl -sSL -o dotnet.tar.gz https://go.microsoft.com/fwlink/?LinkID=847105 && \ +RUN curl -sSL -o dotnet.tar.gz https://download.visualstudio.microsoft.com/download/pr/519eac6e-f2c9-49dd-a60d-02072ed8e5b3/aed96c5eee6a74a5cde2e3f1ad4c7121/dotnet-sdk-2.2.100-linux-x64.tar.gz && \ mkdir -p /opt/dotnet && tar zxf dotnet.tar.gz -C /opt/dotnet && \ ln -s /opt/dotnet/dotnet /usr/local/bin From 5808f0066ace9bc33b0f44d99a093155de503baf Mon Sep 17 00:00:00 2001 From: Sydney Acksman Date: Tue, 5 Mar 2019 18:10:04 -0600 Subject: [PATCH 02/12] Re-add curl install --- kokoro/linux/64-bit/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kokoro/linux/64-bit/Dockerfile b/kokoro/linux/64-bit/Dockerfile index 6728f169db47..024681ea2d9f 100644 --- a/kokoro/linux/64-bit/Dockerfile +++ b/kokoro/linux/64-bit/Dockerfile @@ -29,7 +29,8 @@ RUN echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu trusty main" | tee /etc # Install dotnet SDK based on https://www.microsoft.com/net/core#debian # (Ubuntu instructions need apt to support https) -RUN curl -sSL -o dotnet.tar.gz https://download.visualstudio.microsoft.com/download/pr/519eac6e-f2c9-49dd-a60d-02072ed8e5b3/aed96c5eee6a74a5cde2e3f1ad4c7121/dotnet-sdk-2.2.100-linux-x64.tar.gz && \ +RUN apt-get update && apt-get install -y --force-yes curl && \ + curl -sSL -o dotnet.tar.gz https://download.visualstudio.microsoft.com/download/pr/519eac6e-f2c9-49dd-a60d-02072ed8e5b3/aed96c5eee6a74a5cde2e3f1ad4c7121/dotnet-sdk-2.2.100-linux-x64.tar.gz && \ mkdir -p /opt/dotnet && tar zxf dotnet.tar.gz -C /opt/dotnet && \ ln -s /opt/dotnet/dotnet /usr/local/bin From ad286225c7549aed5fff0b442b77d8144d9379d2 Mon Sep 17 00:00:00 2001 From: Sydney Acksman Date: Wed, 6 Mar 2019 05:02:25 -0600 Subject: [PATCH 03/12] Change all exe target to 2.1 --- .../src/Google.Protobuf.Test/Google.Protobuf.Test.csproj | 4 ++-- csharp/src/AddressBook/AddressBook.csproj | 2 +- .../Google.Protobuf.Conformance.csproj | 2 +- .../Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.csproj | 2 +- csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj index 59fbdc8c0e26..1ef5bf8637ad 100644 --- a/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj +++ b/csharp/compatibility_tests/v3.0.0/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj @@ -2,7 +2,7 @@ Exe - net451;netcoreapp2.2 + net451;netcoreapp2.1 ../../keys/Google.Protobuf.snk true true @@ -24,7 +24,7 @@ - Visual Studio. --> - netcoreapp2.2 + netcoreapp2.1 diff --git a/csharp/src/AddressBook/AddressBook.csproj b/csharp/src/AddressBook/AddressBook.csproj index cb2dd8c84cca..f3268c0acf3e 100644 --- a/csharp/src/AddressBook/AddressBook.csproj +++ b/csharp/src/AddressBook/AddressBook.csproj @@ -1,7 +1,7 @@  - netcoreapp2.2 + netcoreapp2.1 Exe Google.Protobuf.Examples.AddressBook.Program False diff --git a/csharp/src/Google.Protobuf.Conformance/Google.Protobuf.Conformance.csproj b/csharp/src/Google.Protobuf.Conformance/Google.Protobuf.Conformance.csproj index 81bfaf9c892d..ec8fb9138947 100644 --- a/csharp/src/Google.Protobuf.Conformance/Google.Protobuf.Conformance.csproj +++ b/csharp/src/Google.Protobuf.Conformance/Google.Protobuf.Conformance.csproj @@ -1,7 +1,7 @@  - netcoreapp2.2 + netcoreapp2.1 Exe False diff --git a/csharp/src/Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.csproj b/csharp/src/Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.csproj index 173142a05e05..fee35be9910d 100644 --- a/csharp/src/Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.csproj +++ b/csharp/src/Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.csproj @@ -1,7 +1,7 @@  - netcoreapp2.2 + netcoreapp2.1 Exe False diff --git a/csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj b/csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj index 8d7b30fb2761..32bb26c99050 100644 --- a/csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj +++ b/csharp/src/Google.Protobuf.Test/Google.Protobuf.Test.csproj @@ -1,7 +1,7 @@  - net451;netcoreapp2.2 + net451;netcoreapp2.1 ../../keys/Google.Protobuf.snk true true @@ -24,7 +24,7 @@ - Visual Studio. --> - netcoreapp2.2 + netcoreapp2.1 From afae499d111339ecf9d3877d749e2efb995bc50b Mon Sep 17 00:00:00 2001 From: Sydney Acksman Date: Wed, 6 Mar 2019 05:15:31 -0600 Subject: [PATCH 04/12] Fix incorrect versions in global.json and Dockerfile --- global.json | 2 +- kokoro/linux/64-bit/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/global.json b/global.json index fd60d7372d50..9fb49112259d 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "2.2.100" + "version": "2.2.104" } } diff --git a/kokoro/linux/64-bit/Dockerfile b/kokoro/linux/64-bit/Dockerfile index 024681ea2d9f..c8c36ae87085 100644 --- a/kokoro/linux/64-bit/Dockerfile +++ b/kokoro/linux/64-bit/Dockerfile @@ -30,7 +30,7 @@ RUN echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu trusty main" | tee /etc # Install dotnet SDK based on https://www.microsoft.com/net/core#debian # (Ubuntu instructions need apt to support https) RUN apt-get update && apt-get install -y --force-yes curl && \ - curl -sSL -o dotnet.tar.gz https://download.visualstudio.microsoft.com/download/pr/519eac6e-f2c9-49dd-a60d-02072ed8e5b3/aed96c5eee6a74a5cde2e3f1ad4c7121/dotnet-sdk-2.2.100-linux-x64.tar.gz && \ + curl -sSL -o dotnet.tar.gz https://download.visualstudio.microsoft.com/download/pr/69937b49-a877-4ced-81e6-286620b390ab/8ab938cf6f5e83b2221630354160ef21/dotnet-sdk-2.2.104-linux-x64.tar.gz && \ mkdir -p /opt/dotnet && tar zxf dotnet.tar.gz -C /opt/dotnet && \ ln -s /opt/dotnet/dotnet /usr/local/bin From e4dc27dc244d0d4a2cac1c981f879a5ca1fb6339 Mon Sep 17 00:00:00 2001 From: Sydney Acksman Date: Wed, 6 Mar 2019 05:39:59 -0600 Subject: [PATCH 05/12] Downgrade version to 2.1 to match exe targets --- global.json | 2 +- kokoro/linux/64-bit/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/global.json b/global.json index 9fb49112259d..0c7cc9f180ce 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "2.2.104" + "version": "2.1.504" } } diff --git a/kokoro/linux/64-bit/Dockerfile b/kokoro/linux/64-bit/Dockerfile index c8c36ae87085..440d8ca66193 100644 --- a/kokoro/linux/64-bit/Dockerfile +++ b/kokoro/linux/64-bit/Dockerfile @@ -30,7 +30,7 @@ RUN echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu trusty main" | tee /etc # Install dotnet SDK based on https://www.microsoft.com/net/core#debian # (Ubuntu instructions need apt to support https) RUN apt-get update && apt-get install -y --force-yes curl && \ - curl -sSL -o dotnet.tar.gz https://download.visualstudio.microsoft.com/download/pr/69937b49-a877-4ced-81e6-286620b390ab/8ab938cf6f5e83b2221630354160ef21/dotnet-sdk-2.2.104-linux-x64.tar.gz && \ + curl -sSL -o dotnet.tar.gz https://download.visualstudio.microsoft.com/download/pr/b35cf035-09d9-444a-8f62-c972fd6f2be0/4068a391164715232bbf4477b349643f/dotnet-sdk-2.1.504-linux-x64.tar.gz && \ mkdir -p /opt/dotnet && tar zxf dotnet.tar.gz -C /opt/dotnet && \ ln -s /opt/dotnet/dotnet /usr/local/bin From c24ec68d592ebba6747d21dc7d10ee0041e3c589 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 6 Mar 2019 09:28:53 -0500 Subject: [PATCH 06/12] introduce separate testing Dockerfile for C# --- .../linux/dockerfile/test/csharp/Dockerfile | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 kokoro/linux/dockerfile/test/csharp/Dockerfile diff --git a/kokoro/linux/dockerfile/test/csharp/Dockerfile b/kokoro/linux/dockerfile/test/csharp/Dockerfile new file mode 100644 index 000000000000..2073057bc0ce --- /dev/null +++ b/kokoro/linux/dockerfile/test/csharp/Dockerfile @@ -0,0 +1,36 @@ +FROM debian:stretch + +# Install dependencies. We start with the basic ones require to build protoc +# and the C++ build +RUN apt-get update && apt-get install -y \ + autoconf \ + autotools-dev \ + build-essential \ + bzip2 \ + ccache \ + curl \ + gcc \ + git \ + libc6 \ + libc6-dbg \ + libc6-dev \ + libgtest-dev \ + libtool \ + make \ + parallel \ + time \ + wget \ + && apt-get clean + +# dotnet SDK prerequisites +RUN apt-get update && apt-get install -y libunwind8 libicu57 && apt-get clean + +# Install dotnet SDK via install script +RUN wget -q https://dot.net/v1/dotnet-install.sh && \ + chmod u+x dotnet-install.sh && \ + ./dotnet-install.sh --version 2.1.504 && \ + ln -s /root/.dotnet/dotnet /usr/local/bin + +RUN wget -q www.nuget.org/NuGet.exe -O /usr/local/bin/nuget.exe + +ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE true From 7d246f6dfa086bfeacedb481b93283d74a16ca41 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 6 Mar 2019 09:31:20 -0500 Subject: [PATCH 07/12] revert changes to the shared Dockerfile --- kokoro/linux/64-bit/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kokoro/linux/64-bit/Dockerfile b/kokoro/linux/64-bit/Dockerfile index 440d8ca66193..3a279e660249 100644 --- a/kokoro/linux/64-bit/Dockerfile +++ b/kokoro/linux/64-bit/Dockerfile @@ -29,8 +29,8 @@ RUN echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu trusty main" | tee /etc # Install dotnet SDK based on https://www.microsoft.com/net/core#debian # (Ubuntu instructions need apt to support https) -RUN apt-get update && apt-get install -y --force-yes curl && \ - curl -sSL -o dotnet.tar.gz https://download.visualstudio.microsoft.com/download/pr/b35cf035-09d9-444a-8f62-c972fd6f2be0/4068a391164715232bbf4477b349643f/dotnet-sdk-2.1.504-linux-x64.tar.gz && \ +RUN apt-get update && apt-get install -y --force-yes curl libunwind8 gettext && \ + curl -sSL -o dotnet.tar.gz https://go.microsoft.com/fwlink/?LinkID=847105 && \ mkdir -p /opt/dotnet && tar zxf dotnet.tar.gz -C /opt/dotnet && \ ln -s /opt/dotnet/dotnet /usr/local/bin From b2e8f9720cebfc6ace05bbda64d1140f35339516 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 6 Mar 2019 09:34:17 -0500 Subject: [PATCH 08/12] use netcoreapp2.1 for C# conformance tests --- conformance/Makefile.am | 2 +- csharp/compatibility_tests/v3.0.0/test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conformance/Makefile.am b/conformance/Makefile.am index 18ac673369cb..f2337df2ad3a 100644 --- a/conformance/Makefile.am +++ b/conformance/Makefile.am @@ -316,7 +316,7 @@ conformance-java-lite: javac_middleman_lite conformance-csharp: $(other_language_protoc_outputs) @echo "Writing shortcut script conformance-csharp..." @echo '#! /bin/sh' > conformance-csharp - @echo 'dotnet ../csharp/src/Google.Protobuf.Conformance/bin/Release/netcoreapp1.0/Google.Protobuf.Conformance.dll "$$@"' >> conformance-csharp + @echo 'dotnet ../csharp/src/Google.Protobuf.Conformance/bin/Release/netcoreapp2.1/Google.Protobuf.Conformance.dll "$$@"' >> conformance-csharp @chmod +x conformance-csharp conformance-php: diff --git a/csharp/compatibility_tests/v3.0.0/test.sh b/csharp/compatibility_tests/v3.0.0/test.sh index 54d28dfc2608..b9a73f169d9d 100755 --- a/csharp/compatibility_tests/v3.0.0/test.sh +++ b/csharp/compatibility_tests/v3.0.0/test.sh @@ -22,7 +22,7 @@ function run_test() { dotnet restore src/Google.Protobuf.Test/Google.Protobuf.Test.csproj dotnet build -c Release src/Google.Protobuf/Google.Protobuf.csproj dotnet build -c Release src/Google.Protobuf.Test/Google.Protobuf.Test.csproj - dotnet run -c Release -f netcoreapp1.0 -p src/Google.Protobuf.Test/Google.Protobuf.Test.csproj + dotnet run -c Release -f netcoreapp2.1 -p src/Google.Protobuf.Test/Google.Protobuf.Test.csproj } set -ex From dfb873abdd6e026c87bc01dbf8c0b18f87152b70 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 6 Mar 2019 10:10:30 -0500 Subject: [PATCH 09/12] use language specific dockerfile for testing C# --- kokoro/linux/csharp/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kokoro/linux/csharp/build.sh b/kokoro/linux/csharp/build.sh index 27cb549dac00..9a2eb48621a8 100755 --- a/kokoro/linux/csharp/build.sh +++ b/kokoro/linux/csharp/build.sh @@ -10,7 +10,8 @@ # Change to repo root cd $(dirname $0)/../../.. -export DOCKERFILE_DIR=kokoro/linux/64-bit +export DOCKERHUB_ORGANIZATION=protobuftesting +export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/csharp export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh export OUTPUT_DIR=testoutput export TEST_SET="csharp" From 0efbd9afd41a2ed6be2dea12e0c7ee1b19dbadff Mon Sep 17 00:00:00 2001 From: Sydney Acksman Date: Thu, 7 Mar 2019 18:18:46 -0600 Subject: [PATCH 10/12] Edit compatibility tests script to use parameters instead of file copies --- csharp/compatibility_tests/v3.0.0/test.sh | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/csharp/compatibility_tests/v3.0.0/test.sh b/csharp/compatibility_tests/v3.0.0/test.sh index b9a73f169d9d..9fcf406c25f8 100755 --- a/csharp/compatibility_tests/v3.0.0/test.sh +++ b/csharp/compatibility_tests/v3.0.0/test.sh @@ -2,17 +2,17 @@ function run_test() { # Generate test proto files. - ./protoc_1 -Iprotos/src -I../../../src/ --csharp_out=src/Google.Protobuf.Test \ + $1 -Iprotos/src -I../../../src/ --csharp_out=src/Google.Protobuf.Test \ --csharp_opt=base_namespace=Google.Protobuf \ protos/src/google/protobuf/unittest_import_proto3.proto \ protos/src/google/protobuf/unittest_import_public_proto3.proto \ protos/src/google/protobuf/unittest_well_known_types.proto - ./protoc_1 -Iprotos/csharp --csharp_out=src/Google.Protobuf.Test \ + $1 -Iprotos/csharp --csharp_out=src/Google.Protobuf.Test \ --csharp_opt=base_namespace=UnitTest.Issues \ protos/csharp/protos/unittest_issues.proto - ./protoc_2 -Iprotos/src --csharp_out=src/Google.Protobuf.Test \ + $2 -Iprotos/src --csharp_out=src/Google.Protobuf.Test \ --csharp_opt=base_namespace=Google.Protobuf \ protos/src/google/protobuf/unittest_proto3.proto \ protos/src/google/protobuf/map_unittest_proto3.proto @@ -79,26 +79,18 @@ cp ../../keys . -r # Test A.1: # proto set 1: use old version # proto set 2 which may import protos in set 1: use old version -cp old_protoc protoc_1 -cp old_protoc protoc_2 -run_test +run_test "./old_protoc" "./old_protoc" # Test A.2: # proto set 1: use new version # proto set 2 which may import protos in set 1: use old version -cp ../../../src/protoc protoc_1 -cp old_protoc protoc_2 -run_test +run_test "../../../src/protoc" "./old_protoc" # Test A.3: # proto set 1: use old version # proto set 2 which may import protos in set 1: use new version -cp old_protoc protoc_1 -cp ../../../src/protoc protoc_2 -run_test +run_test "./old_protoc" "../../../src/protoc" -rm protoc_1 -rm protoc_2 rm old_protoc rm keys -r rm src/Google.Protobuf -r From 5e3e9fbd5d11c09804156f3689ff2201b1c46df6 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 11 Mar 2019 03:28:10 -0400 Subject: [PATCH 11/12] install dotnet SDK on windows before running the tests --- csharp/install_dotnet_sdk.ps1 | 21 +++++++++++++++++++ kokoro/release/csharp/windows/build_nuget.bat | 5 +++++ 2 files changed, 26 insertions(+) create mode 100644 csharp/install_dotnet_sdk.ps1 diff --git a/csharp/install_dotnet_sdk.ps1 b/csharp/install_dotnet_sdk.ps1 new file mode 100644 index 000000000000..b4132ab31fec --- /dev/null +++ b/csharp/install_dotnet_sdk.ps1 @@ -0,0 +1,21 @@ +#!/usr/bin/env powershell +# Install dotnet SDK based on the SDK version from global.json + +Set-StrictMode -Version 2 +$ErrorActionPreference = 'Stop' + +# avoid "Unknown error on a send" in Invoke-WebRequest +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + +$InstallScriptUrl = 'https://dot.net/v1/dotnet-install.ps1' +$InstallScriptPath = Join-Path "$env:TEMP" 'dotnet-install.ps1' +$GlobalJsonPath = Join-Path $PSScriptRoot '..' | Join-Path -ChildPath 'global.json' + +# Resolve SDK version from global.json file +$GlobalJson = Get-Content -Raw $GlobalJsonPath | ConvertFrom-Json +$SDKVersion = $GlobalJson.sdk.version + +# Download install script +Write-Host "Downloading install script: $InstallScriptUrl => $InstallScriptPath" +Invoke-WebRequest -Uri $InstallScriptUrl -OutFile $InstallScriptPath +&$InstallScriptPath -Version $SDKVersion diff --git a/kokoro/release/csharp/windows/build_nuget.bat b/kokoro/release/csharp/windows/build_nuget.bat index 5da1e1360268..fdb02b06853c 100644 --- a/kokoro/release/csharp/windows/build_nuget.bat +++ b/kokoro/release/csharp/windows/build_nuget.bat @@ -2,4 +2,9 @@ cd /d %~dp0\..\..\..\.. cd csharp + +@rem Install dotnet SDK +powershell -File install_dotnet_sdk.ps1 +set PATH=%LOCALAPPDATA%\Microsoft\dotnet;%PATH% + call build_packages.bat From da2db2ab5bec985c8e9e8ad378bdf45cd7a0e225 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 11 Mar 2019 14:37:26 -0400 Subject: [PATCH 12/12] update csharp_EXTRA_DIST --- Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.am b/Makefile.am index c97d854a209f..c0f06154381e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -59,6 +59,7 @@ csharp_EXTRA_DIST= \ csharp/build_tools.sh \ csharp/buildall.sh \ csharp/generate_protos.sh \ + csharp/install_dotnet_sdk.ps1 \ csharp/keys/Google.Protobuf.public.snk \ csharp/keys/Google.Protobuf.snk \ csharp/keys/README.md \