From b6d7b9c5558fc89151bf8fa0e4e96b46c74c7a59 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Mon, 24 Jun 2019 16:52:47 -0700 Subject: [PATCH 01/13] bazel: Update to 0.27.0 Signed-off-by: Keith Smiley --- .azure-pipelines/linux.yml | 2 +- .circleci/config.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/linux.yml b/.azure-pipelines/linux.yml index 844e75387ccc..5b942f53ed8f 100644 --- a/.azure-pipelines/linux.yml +++ b/.azure-pipelines/linux.yml @@ -1,7 +1,7 @@ resources: containers: - container: envoy-build - image: envoyproxy/envoy-build:ec38ecb88fd1abe55ab1daa2f6bd239ffccc9d98 + image: envoyproxy/envoy-build:d0cefa7f071dbd4ef24399c2db8656c3a5d8c3ef jobs: - job: BuildEnvoy diff --git a/.circleci/config.yml b/.circleci/config.yml index 76df3f26138f..d3458d108886 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ executors: ubuntu-build: description: "A regular build executor based on ubuntu image" docker: - - image: envoyproxy/envoy-build:ec38ecb88fd1abe55ab1daa2f6bd239ffccc9d98 + - image: envoyproxy/envoy-build:d0cefa7f071dbd4ef24399c2db8656c3a5d8c3ef resource_class: xlarge working_directory: /source From dc2a2042150d2b0f580b1db34970ced865327ec0 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Mon, 24 Jun 2019 17:24:11 -0700 Subject: [PATCH 02/13] Force some tools to run with python 2 Signed-off-by: Keith Smiley --- api/tools/BUILD | 1 + tools/protodoc/BUILD | 1 + 2 files changed, 2 insertions(+) diff --git a/api/tools/BUILD b/api/tools/BUILD index b2848aee130d..06037f69b57f 100644 --- a/api/tools/BUILD +++ b/api/tools/BUILD @@ -4,6 +4,7 @@ py_binary( name = "tap2pcap", srcs = ["tap2pcap.py"], licenses = ["notice"], # Apache 2 + python_version = "PY2", visibility = ["//visibility:public"], deps = [ "//envoy/data/tap/v2alpha:wrapper_py", diff --git a/tools/protodoc/BUILD b/tools/protodoc/BUILD index 55a5fd529f9d..8e428b5d24fd 100644 --- a/tools/protodoc/BUILD +++ b/tools/protodoc/BUILD @@ -3,6 +3,7 @@ licenses(["notice"]) # Apache 2 py_binary( name = "protodoc", srcs = ["protodoc.py"], + python_version = "PY2", visibility = ["//visibility:public"], deps = [ "@com_envoyproxy_protoc_gen_validate//validate:validate_py", From 09cf0c671f8b6a4132c1a4d3cfa85719ac7607bd Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Mon, 24 Jun 2019 11:00:53 -0700 Subject: [PATCH 03/13] test: update socket_passing.py to python3 This script is used for the hotrestart_test target, this makes it run with python3 instead of python2 Signed-off-by: Keith Smiley --- tools/socket_passing.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/socket_passing.py b/tools/socket_passing.py index 22f57cf59aeb..ee30db34ad01 100755 --- a/tools/socket_passing.py +++ b/tools/socket_passing.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2.7 +#!/usr/bin/env python3 # This tool is a helper script that queries the admin address for all listener # addresses after envoy startup. (The admin address is written out to a file by @@ -10,7 +10,7 @@ from collections import OrderedDict import argparse -import httplib +import http.client import json import os.path import re @@ -29,12 +29,12 @@ def GenerateNewConfig(original_yaml, admin_address, updated_json): with open(original_yaml, 'r') as original_file: sys.stdout.write('Admin address is ' + admin_address + '\n') try: - admin_conn = httplib.HTTPConnection(admin_address) + admin_conn = http.client.HTTPConnection(admin_address) admin_conn.request('GET', '/listeners?format=json') admin_response = admin_conn.getresponse() if not admin_response.status == 200: return False - discovered_listeners = json.loads(admin_response.read()) + discovered_listeners = json.loads(admin_response.read().decode('utf-8')) except Exception as e: sys.stderr.write('Cannot connect to admin: %s\n' % e) return False From 097f439d4768909e6b3af2f222c82af52163b4ab Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Mon, 24 Jun 2019 17:30:37 -0700 Subject: [PATCH 04/13] Add python_version to tap2pcap_test Signed-off-by: Keith Smiley --- api/tools/BUILD | 1 + 1 file changed, 1 insertion(+) diff --git a/api/tools/BUILD b/api/tools/BUILD index 06037f69b57f..e90cfa0eef29 100644 --- a/api/tools/BUILD +++ b/api/tools/BUILD @@ -18,6 +18,7 @@ py_test( "data/tap2pcap_h2_ipv4.pb_text", "data/tap2pcap_h2_ipv4.txt", ], + python_version = "PY2", # Don't run this by default, since we don't want to force local dependency on Wireshark/tshark, # will explicitly invoke in CI. tags = ["manual"], From c7d192c3d707c251329b499b388724ba5eb6625d Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Tue, 25 Jun 2019 11:27:56 -0700 Subject: [PATCH 05/13] Update gcovr for Python 3.5+ support Signed-off-by: Keith Smiley --- bazel/repository_locations.bzl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index 9960796a9b88..8c418038fb49 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -63,9 +63,9 @@ REPOSITORY_LOCATIONS = dict( urls = ["https://github.com/gabime/spdlog/archive/v1.3.1.tar.gz"], ), com_github_gcovr_gcovr = dict( - sha256 = "8a60ba6242d67a58320e9e16630d80448ef6d5284fda5fb3eff927b63c8b04a2", - strip_prefix = "gcovr-3.3", - urls = ["https://github.com/gcovr/gcovr/archive/3.3.tar.gz"], + sha256 = "1ad8042fd4dc4c355fd7e605d395eefa2a59b1677dfdc308e0ef00083e8b37ee", + strip_prefix = "gcovr-4.1", + urls = ["https://github.com/gcovr/gcovr/archive/4.1.tar.gz"], ), com_github_google_libprotobuf_mutator = dict( sha256 = "97b3639630040f41c45f45838ab00b78909e6b4cb69c8028e01302bea5b79495", From c0aecb691bdae36c129f7330bf9dfb131955f4a6 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Tue, 25 Jun 2019 11:29:25 -0700 Subject: [PATCH 06/13] Temporarily change compilation database URL Signed-off-by: Keith Smiley --- bazel/gen_compilation_database.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bazel/gen_compilation_database.sh b/bazel/gen_compilation_database.sh index 29afd5aba8f1..0336ab67104c 100755 --- a/bazel/gen_compilation_database.sh +++ b/bazel/gen_compilation_database.sh @@ -1,10 +1,11 @@ #!/bin/bash #TODO(lizan): revert to released version once new version is released -RELEASE_VERSION=d5a0ee259aa356886618eafae17ca05ebf79d6c2 +#TODO(keith): revert after https://github.com/grailbio/bazel-compilation-database/pull/30 is resolved +RELEASE_VERSION=078319b6a2ed88915d817d4a4142e1adfb77d727 if [[ ! -d bazel-compilation-database-${RELEASE_VERSION} ]]; then - curl -L https://github.com/grailbio/bazel-compilation-database/archive/${RELEASE_VERSION}.tar.gz | tar -xz + curl -L https://github.com/keith/bazel-compilation-database/archive/${RELEASE_VERSION}.tar.gz | tar -xz fi bazel-compilation-database-${RELEASE_VERSION}/generate.sh $@ From 8a577ea237427f85981d4add854ce31de6b5763b Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Tue, 25 Jun 2019 11:51:40 -0700 Subject: [PATCH 07/13] Downgrade gcovr because of breaking changes Signed-off-by: Keith Smiley --- bazel/repository_locations.bzl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index 8c418038fb49..5818d9108a59 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -63,9 +63,9 @@ REPOSITORY_LOCATIONS = dict( urls = ["https://github.com/gabime/spdlog/archive/v1.3.1.tar.gz"], ), com_github_gcovr_gcovr = dict( - sha256 = "1ad8042fd4dc4c355fd7e605d395eefa2a59b1677dfdc308e0ef00083e8b37ee", - strip_prefix = "gcovr-4.1", - urls = ["https://github.com/gcovr/gcovr/archive/4.1.tar.gz"], + sha256 = "1c52a71f245adfe1b45e30fbe5015337fe66546f17f40038b3969b7b42acceed", + strip_prefix = "gcovr-3.4", + urls = ["https://github.com/gcovr/gcovr/archive/3.4.tar.gz"], ), com_github_google_libprotobuf_mutator = dict( sha256 = "97b3639630040f41c45f45838ab00b78909e6b4cb69c8028e01302bea5b79495", From c89d0b121b0d6aed534b321fd40c91a3f6d342ee Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Tue, 25 Jun 2019 13:29:00 -0700 Subject: [PATCH 08/13] Update version Signed-off-by: Keith Smiley --- bazel/gen_compilation_database.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bazel/gen_compilation_database.sh b/bazel/gen_compilation_database.sh index 0336ab67104c..c1a76fb9fc8d 100755 --- a/bazel/gen_compilation_database.sh +++ b/bazel/gen_compilation_database.sh @@ -2,7 +2,7 @@ #TODO(lizan): revert to released version once new version is released #TODO(keith): revert after https://github.com/grailbio/bazel-compilation-database/pull/30 is resolved -RELEASE_VERSION=078319b6a2ed88915d817d4a4142e1adfb77d727 +RELEASE_VERSION=436399bfe9dbd6455d029722bff2948f2d7a1f04 if [[ ! -d bazel-compilation-database-${RELEASE_VERSION} ]]; then curl -L https://github.com/keith/bazel-compilation-database/archive/${RELEASE_VERSION}.tar.gz | tar -xz From 62f777503e9ad46e21f54e132ee42b12b84e8e19 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Tue, 25 Jun 2019 14:01:15 -0700 Subject: [PATCH 09/13] Update bazel-compilation-database again Signed-off-by: Keith Smiley --- bazel/gen_compilation_database.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bazel/gen_compilation_database.sh b/bazel/gen_compilation_database.sh index c1a76fb9fc8d..e3008a13d5b1 100755 --- a/bazel/gen_compilation_database.sh +++ b/bazel/gen_compilation_database.sh @@ -2,7 +2,7 @@ #TODO(lizan): revert to released version once new version is released #TODO(keith): revert after https://github.com/grailbio/bazel-compilation-database/pull/30 is resolved -RELEASE_VERSION=436399bfe9dbd6455d029722bff2948f2d7a1f04 +RELEASE_VERSION=e65a17bef735ef64457221800207f6c295a6c8aa if [[ ! -d bazel-compilation-database-${RELEASE_VERSION} ]]; then curl -L https://github.com/keith/bazel-compilation-database/archive/${RELEASE_VERSION}.tar.gz | tar -xz From 269d4ade25c5ffc8997bf8946e137a933169886d Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Tue, 25 Jun 2019 16:36:05 -0700 Subject: [PATCH 10/13] Go back to upstream version with merged PR Signed-off-by: Keith Smiley --- bazel/gen_compilation_database.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bazel/gen_compilation_database.sh b/bazel/gen_compilation_database.sh index e3008a13d5b1..0533fba8a818 100755 --- a/bazel/gen_compilation_database.sh +++ b/bazel/gen_compilation_database.sh @@ -1,11 +1,10 @@ #!/bin/bash #TODO(lizan): revert to released version once new version is released -#TODO(keith): revert after https://github.com/grailbio/bazel-compilation-database/pull/30 is resolved -RELEASE_VERSION=e65a17bef735ef64457221800207f6c295a6c8aa +RELEASE_VERSION=fd92bf39666596cab609edf7b8e221307d6d325a if [[ ! -d bazel-compilation-database-${RELEASE_VERSION} ]]; then - curl -L https://github.com/keith/bazel-compilation-database/archive/${RELEASE_VERSION}.tar.gz | tar -xz + curl -L https://github.com/grailbio/bazel-compilation-database/archive/${RELEASE_VERSION}.tar.gz | tar -xz fi bazel-compilation-database-${RELEASE_VERSION}/generate.sh $@ From 953284d56f42dbe9fe89805441f9b0fc7479e362 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Tue, 25 Jun 2019 17:15:51 -0700 Subject: [PATCH 11/13] Go back to tags Signed-off-by: Keith Smiley --- bazel/gen_compilation_database.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bazel/gen_compilation_database.sh b/bazel/gen_compilation_database.sh index 0533fba8a818..d642ddfd285d 100755 --- a/bazel/gen_compilation_database.sh +++ b/bazel/gen_compilation_database.sh @@ -1,7 +1,6 @@ #!/bin/bash -#TODO(lizan): revert to released version once new version is released -RELEASE_VERSION=fd92bf39666596cab609edf7b8e221307d6d325a +RELEASE_VERSION=0.3.5 if [[ ! -d bazel-compilation-database-${RELEASE_VERSION} ]]; then curl -L https://github.com/grailbio/bazel-compilation-database/archive/${RELEASE_VERSION}.tar.gz | tar -xz From c2f0a2b479afda8237b2ea97cf82e1fd1bc9929d Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Tue, 25 Jun 2019 22:47:55 -0700 Subject: [PATCH 12/13] Default gcovr to PY2 Signed-off-by: Keith Smiley --- bazel/external/gcovr.BUILD | 1 + 1 file changed, 1 insertion(+) diff --git a/bazel/external/gcovr.BUILD b/bazel/external/gcovr.BUILD index 57ee8e7fb971..3ec787b0e7b2 100644 --- a/bazel/external/gcovr.BUILD +++ b/bazel/external/gcovr.BUILD @@ -9,6 +9,7 @@ load("@subpar//:subpar.bzl", "par_binary") par_binary( name = "gcovr", srcs = [":renamed_gcovr.py"], + default_python_version = "PY2", main = ":renamed_gcovr.py", visibility = ["//visibility:public"], ) From d04a8daf7cc8328dfd13051dad553186987df6bc Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Tue, 25 Jun 2019 23:20:44 -0700 Subject: [PATCH 13/13] Force py2 for gcovr Without both of these subpar thinks the main and src files don't match because the generated files end up in different subpaths of bazel-out because of the differences in toolchains Signed-off-by: Keith Smiley --- bazel/external/gcovr.BUILD | 2 +- ci/do_ci.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bazel/external/gcovr.BUILD b/bazel/external/gcovr.BUILD index 3ec787b0e7b2..0215a25da848 100644 --- a/bazel/external/gcovr.BUILD +++ b/bazel/external/gcovr.BUILD @@ -9,8 +9,8 @@ load("@subpar//:subpar.bzl", "par_binary") par_binary( name = "gcovr", srcs = [":renamed_gcovr.py"], - default_python_version = "PY2", main = ":renamed_gcovr.py", + python_version = "PY2", visibility = ["//visibility:public"], ) diff --git a/ci/do_ci.sh b/ci/do_ci.sh index d55381c86de0..e048a8abe920 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -246,7 +246,7 @@ elif [[ "$CI_TARGET" == "bazel.coverage" ]]; then # gcovr is a pain to run with `bazel run`, so package it up into a # relocatable and hermetic-ish .par file. - bazel build @com_github_gcovr_gcovr//:gcovr.par + bazel build --python_version=PY2 @com_github_gcovr_gcovr//:gcovr.par export GCOVR="/tmp/gcovr.par" cp -f "${ENVOY_SRCDIR}/bazel-bin/external/com_github_gcovr_gcovr/gcovr.par" ${GCOVR}