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

bazel: Update to 0.27.0 #7391

Merged
merged 13 commits into from
Jun 26, 2019
2 changes: 1 addition & 1 deletion .azure-pipelines/linux.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resources:
containers:
- container: envoy-build
image: envoyproxy/envoy-build:ec38ecb88fd1abe55ab1daa2f6bd239ffccc9d98
image: envoyproxy/envoy-build:d0cefa7f071dbd4ef24399c2db8656c3a5d8c3ef

jobs:
- job: BuildEnvoy
Expand Down
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions api/tools/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -17,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"],
Expand Down
1 change: 1 addition & 0 deletions bazel/external/gcovr.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ par_binary(
name = "gcovr",
srcs = [":renamed_gcovr.py"],
main = ":renamed_gcovr.py",
python_version = "PY2",
visibility = ["//visibility:public"],
)

Expand Down
3 changes: 1 addition & 2 deletions bazel/gen_compilation_database.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

#TODO(lizan): revert to released version once new version is released
RELEASE_VERSION=d5a0ee259aa356886618eafae17ca05ebf79d6c2
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
Expand Down
6 changes: 3 additions & 3 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "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",
Expand Down
2 changes: 1 addition & 1 deletion ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, the Python version is always set by either --host_force_python (for host-configured targets) or the python_version attr of py_binary/py_test targets. If these are not explicitly specified they default to PY3.

So setting --python_version on the command line has no effect on executable Python targets. Its only use is to cause other targets (e.g. a py_library, or some non-Python rule) to have PY2 or PY3 mode for the purposes of evaluating select()s on the Python version and for deciding whether to use the -py2 output directory.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brandjon note this is required because of the genrule that outputs the source file. Without this, when forcing py2 on this par_binary target, subpar believes that the main file is not contained in the srcs because it's not nested in the -py2 output directory.

You can reproduce this by running this command with and without this flag, without it subpar fails here https://github.com/google/subpar/blob/35bb9f0092f71ea56b742a520602da9b3638a24f/subpar.bzl#L29-L30

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, thanks.

export GCOVR="/tmp/gcovr.par"
cp -f "${ENVOY_SRCDIR}/bazel-bin/external/com_github_gcovr_gcovr/gcovr.par" ${GCOVR}

Expand Down
1 change: 1 addition & 0 deletions tools/protodoc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions tools/socket_passing.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -10,7 +10,7 @@
from collections import OrderedDict

import argparse
import httplib
import http.client
import json
import os.path
import re
Expand All @@ -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
Expand Down