Skip to content

Commit

Permalink
Update Envoy to c2b0d37ca5b40b71ce48984f2cf5984297b79a71
Browse files Browse the repository at this point in the history
- Updates the extension build config to add ADDITIONAL_VISIBILITY
- Allows fixing of envoyproxy#399: use the right include path for the fault
  filter.

Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
  • Loading branch information
oschaaf committed Aug 5, 2020
1 parent 06dc01e commit 7cdda88
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 37 deletions.
4 changes: 0 additions & 4 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,7 @@ build:plain-fuzzer --define=FUZZING_ENGINE=libfuzzer
build:plain-fuzzer --define ENVOY_CONFIG_ASAN=1

# Compile database generation config
# We don't care about built binaries so always strip and use fastbuild.
build:compdb -c fastbuild
build:compdb --strip=always
build:compdb --build_tag_filters=-nocompdb
build:compdb --define=ENVOY_CONFIG_COMPILATION_DATABASE=1

# Windows build quirks
build:windows --action_env=TMPDIR
Expand Down
4 changes: 2 additions & 2 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

ENVOY_COMMIT = "a2ebf092025e64f1b452a8bdaef13795677bceef" # July 31st, 2020
ENVOY_SHA = "1fcb9ffa174e4d3d65c9c8b2805d9b4470c18051c60c0e80631d3e534ef0c6ab"
ENVOY_COMMIT = "c2b0d37ca5b40b71ce48984f2cf5984297b79a71" # August 5th, 2020
ENVOY_SHA = "4877904623560ada549b92fd117c94727b3226a5482631a16d33a20ba19d5d23"

HDR_HISTOGRAM_C_VERSION = "0.11.0" # July 14th, 2020
HDR_HISTOGRAM_C_SHA = "c00696b3d81776675aa2bc62d3642e31bd8a48cc9619c9bd7d4a78762896e353"
Expand Down
5 changes: 5 additions & 0 deletions extensions_build_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ EXTENSIONS = {
"envoy.tracers.zipkin": "//source/extensions/tracers/zipkin:config",
"envoy.transport_sockets.raw_buffer": "//source/extensions/transport_sockets/raw_buffer:config",
}

# This can be used to extend the visibility rules for Envoy extensions
# (//:extension_config and //:extension_library in //BUILD)
# if downstream Envoy builds need to directly reference envoy extensions.
ADDITIONAL_VISIBILITY = []
2 changes: 1 addition & 1 deletion source/server/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ envoy_cc_library(
":well_known_headers_lib",
"//api/server:response_options_proto_cc_proto",
"@envoy//source/exe:envoy_common_lib_with_external_headers",
"@envoy//source/extensions/filters/http/fault:fault_filter_lib",
"@envoy//source/extensions/filters/http/fault:fault_filter_lib_with_external_headers",
],
)

Expand Down
2 changes: 1 addition & 1 deletion source/server/http_dynamic_delay_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "api/server/response_options.pb.h"

#include "extensions/filters/http/fault/fault_filter.h"
#include "external/envoy/source/extensions/filters/http/fault/fault_filter.h"

namespace Nighthawk {
namespace Server {
Expand Down
3 changes: 0 additions & 3 deletions tools/check_envoy_includes.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ def _inspect_line(bazel_output_base, file_path, line):
alternative_found = os.path.isfile(potential_envoy_path)

if alternative_found:
# TODO(#399): remove after extension includes are available at the proper location.
if "extensions/filters/http/fault/fault_filter.h" == path:
return True
sys.stderr.writelines("Bad include in file " + str(file_path) + ": " + path)
sys.stderr.writelines(" (Possible fixed path: %s" %
potential_envoy_path[len(bazel_output_base) + 1:] + ")\n")
Expand Down
30 changes: 4 additions & 26 deletions tools/gen_compilation_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,6 @@
from pathlib import Path


def runBazelBuildForCompilationDatabase(bazel_options, bazel_targets):
query_targets = ' union '.join(bazel_targets)
query = ' union '.join(
q.format(query_targets) for q in [
'attr(include_prefix, ".+", kind(cc_library, deps({})))',
'attr(strip_include_prefix, ".+", kind(cc_library, deps({})))',
'attr(generator_function, ".*proto_library", kind(cc_.*, deps({})))',
])
build_targets = subprocess.check_output(["bazel", "query", "--notool_deps",
query]).decode().splitlines()
subprocess.check_call(["bazel", "build"] + bazel_options + build_targets)


# This method is equivalent to https://github.com/grailbio/bazel-compilation-database/blob/master/generate.sh
def generateCompilationDatabase(args):
# We need to download all remote outputs for generated source code. This option lives here to override those
Expand All @@ -33,20 +20,10 @@ def generateCompilationDatabase(args):
"--config=compdb",
"--remote_download_outputs=all",
]
if args.keep_going:
bazel_options.append("-k")
if args.run_bazel_build:
try:
runBazelBuildForCompilationDatabase(bazel_options, args.bazel_targets)
except subprocess.CalledProcessError as e:
if not args.keep_going:
raise
else:
logging.warning("bazel build failed {}: {}".format(e.returncode, e.cmd))

subprocess.check_call(["bazel", "build"] + bazel_options + [
"--aspects=@bazel_compdb//:aspects.bzl%compilation_database_aspect",
"--output_groups=compdb_files"
"--output_groups=compdb_files,header_files"
] + args.bazel_targets)

execroot = subprocess.check_output(["bazel", "info", "execution_root"] +
Expand Down Expand Up @@ -98,6 +75,9 @@ def modifyCompileCommand(target, args):
if isHeader(target["file"]):
options += " -Wno-pragma-once-outside-header -Wno-unused-const-variable"
options += " -Wno-unused-function"
if not target["file"].startswith("external/"):
# *.h file is treated as C header by default while our headers files are all C++17.
options = "-x c++ -std=c++17 -fexceptions " + options

target["command"] = " ".join([cc, options])
return target
Expand All @@ -112,8 +92,6 @@ def fixCompilationDatabase(args, db):

if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Generate JSON compilation database')
parser.add_argument('--run_bazel_build', action='store_true')
parser.add_argument('-k', '--keep_going', action='store_true')
parser.add_argument('--include_external', action='store_true')
parser.add_argument('--include_genfiles', action='store_true')
parser.add_argument('--include_headers', action='store_true')
Expand Down

0 comments on commit 7cdda88

Please sign in to comment.