Skip to content

Commit

Permalink
Merge branch 'refs/heads/master' into abseil
Browse files Browse the repository at this point in the history
Signed-off-by: Alyssa Wilk <[email protected]>
  • Loading branch information
alyssawilk committed Nov 9, 2017
2 parents 7428aa2 + 3213ef0 commit a156653
Show file tree
Hide file tree
Showing 232 changed files with 5,823 additions and 1,416 deletions.
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version: 2
jobs:
release:
docker:
- image: lyft/envoy-build:114e24c6fd05fc026492e9d2ca5608694e5ea59d
- image: envoyproxy/envoy-build:516cdcd55326648978f8db1fe3a774ec759f5a13
resource_class: xlarge
working_directory: /source
steps:
Expand All @@ -16,23 +16,23 @@ jobs:
- run: ci/docker_tag.sh
asan:
docker:
- image: lyft/envoy-build:114e24c6fd05fc026492e9d2ca5608694e5ea59d
- image: envoyproxy/envoy-build:516cdcd55326648978f8db1fe3a774ec759f5a13
resource_class: xlarge
working_directory: /source
steps:
- checkout
- run: ci/do_circle_ci.sh bazel.asan
tsan:
docker:
- image: lyft/envoy-build:114e24c6fd05fc026492e9d2ca5608694e5ea59d
- image: envoyproxy/envoy-build:516cdcd55326648978f8db1fe3a774ec759f5a13
resource_class: xlarge
working_directory: /source
steps:
- checkout
- run: ci/do_circle_ci.sh bazel.tsan
coverage:
docker:
- image: lyft/envoy-build:114e24c6fd05fc026492e9d2ca5608694e5ea59d
- image: envoyproxy/envoy-build:516cdcd55326648978f8db1fe3a774ec759f5a13
resource_class: xlarge
working_directory: /source
steps:
Expand All @@ -43,7 +43,7 @@ jobs:
path: /build/envoy/generated/coverage
format:
docker:
- image: lyft/envoy-build:114e24c6fd05fc026492e9d2ca5608694e5ea59d
- image: envoyproxy/envoy-build:516cdcd55326648978f8db1fe3a774ec759f5a13
resource_class: small
working_directory: /source
steps:
Expand Down
6 changes: 3 additions & 3 deletions bazel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ unprefixed, e.g. `as` instead of `x86_64-linux-gnu-as`.

## Supported compiler versions

Though Envoy has been run in production compiled with GCC 4.9 extensively, we now strongly
recommend GCC >= 5 due to known issues with std::string thread safety. Clang >= 4.0 is also known
to work.
Though Envoy has been run in production compiled with GCC 4.9 extensively, we now require
GCC >= 5 due to known issues with std::string thread safety and C++14 support. Clang >= 4.0 is also
known to work.

## Clang STL debug symbols

Expand Down
7 changes: 4 additions & 3 deletions bazel/envoy_build_system.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def envoy_copts(repository, test = False):
"-Wnon-virtual-dtor",
"-Woverloaded-virtual",
"-Wold-style-cast",
"-std=c++0x",
"-std=c++14",
] + select({
# Bazel adds an implicit -DNDEBUG for opt.
repository + "//bazel:opt_build": [] if test else ["-ggdb3"],
Expand Down Expand Up @@ -170,7 +170,8 @@ def envoy_cc_binary(name,
visibility = None,
repository = "",
stamped = False,
deps = []):
deps = [],
linkopts = envoy_linkopts()):
# Implicit .stamped targets to obtain builds with the (truncated) git SHA1.
if stamped:
_git_stamped_genrule(repository, name)
Expand All @@ -180,7 +181,7 @@ def envoy_cc_binary(name,
srcs = srcs,
data = data,
copts = envoy_copts(repository),
linkopts = envoy_linkopts(),
linkopts = linkopts,
testonly = testonly,
linkstatic = 1,
visibility = visibility,
Expand Down
1 change: 1 addition & 0 deletions bazel/external/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ cc_library(
srcs = [":empty.cc"],
deps = [
"@com_github_lightstep_lightstep_tracer_cpp//:lightstep",
"@com_google_googletest//:gtest",
],
)

Expand Down
6 changes: 6 additions & 0 deletions bazel/external/backward.BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cc_library(
name = "backward",
hdrs = ["backward.hpp"],
includes = ["."],
visibility = ["//visibility:public"],
)
21 changes: 21 additions & 0 deletions bazel/external/gcovr.BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
load("@subpar//:subpar.bzl", "par_binary")

# gcovr is difficult to run from a CI environment because it has hard
# assumptions about its local working directory, which interact poorly
# with `bazel run`. To make gcovr more mobile, we package it into a
# .par file (a mostly-hermetic "Python binary").
par_binary(
name = "gcovr",
srcs = [":renamed_gcovr.py"],
main = ":renamed_gcovr.py",
visibility = ["//visibility:public"],
)

# par_binary expects its `srcs` to contain only *.py files, but gcovr is
# distributed as a script with no filename extension. Rename it here.
genrule(
name = "gcovr_to_exec_py",
srcs = ["scripts/gcovr"],
outs = ["renamed_gcovr.py"],
cmd = "cat $(location scripts/gcovr) > $(location renamed_gcovr.py)",
)
7 changes: 7 additions & 0 deletions bazel/external/http-parser.BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cc_library(
name = "http_parser",
srcs = ["http_parser.c", "http_parser.h"],
hdrs = ["http_parser.h"],
includes = ["."],
visibility = ["//visibility:public"],
)
6 changes: 6 additions & 0 deletions bazel/external/rapidjson.BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cc_library(
name = "rapidjson",
hdrs = glob(["include/rapidjson/**/*.h"]),
includes = ["include"],
visibility = ["//visibility:public"],
)
6 changes: 6 additions & 0 deletions bazel/external/tclap.BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cc_library(
name = "tclap",
hdrs = glob(["include/tclap/*.h"]),
includes = ["include"],
visibility = ["//visibility:public"],
)
6 changes: 6 additions & 0 deletions bazel/external/xxhash.BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cc_library(
name = "xxhash",
srcs = ["xxhash.c"],
hdrs = ["xxhash.h"],
visibility = ["//visibility:public"],
)
123 changes: 116 additions & 7 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ def envoy_api_deps(skip_targets):
if 'envoy_api' not in skip_targets:
native.git_repository(
name = "envoy_api",
remote = REPO_LOCATIONS["envoy_api"],
commit = "6e3e1a784cc583f1fe1a7fd3ed109a8f54e0b1b4",
remote = REPO_LOCATIONS["data-plane-api"],
commit = "4d18e6d236a6476782076b217cd62d43c30a7dfe",
)

api_bind_targets = [
Expand Down Expand Up @@ -145,14 +145,15 @@ def envoy_api_deps(skip_targets):
actual = "@envoy_api//api/filter:" + t + "_cc",
)
http_filter_bind_targets = [
"buffer",
"fault",
"health_check",
"http_connection_manager",
"ip_tagging",
"lua",
"rate_limit",
"router",
"buffer",
"transcoder",
"rate_limit",
"ip_tagging",
"health_check",
"fault",
]
for t in http_filter_bind_targets:
native.bind(
Expand Down Expand Up @@ -230,14 +231,30 @@ def envoy_dependencies(path = "@envoy_deps//", skip_com_google_protobuf = False,
# semi-standard in the Bazel community, intended to avoid both duplicate
# dependencies and name conflicts.
existing_rule_keys = native.existing_rules().keys()
if not ("backward" in skip_targets or "com_github_bombela_backward" in existing_rule_keys):
com_github_bombela_backward(repository)
if not ("xxhash" in skip_targets or "com_github_cyan4973_xxhash" in existing_rule_keys):
com_github_cyan4973_xxhash(repository)
if not ("tclap" in skip_targets or "com_github_eile_tclap" in existing_rule_keys):
com_github_eile_tclap(repository)
if not ("fmtlib" in skip_targets or "com_github_fmtlib_fmt" in existing_rule_keys):
com_github_fmtlib_fmt(repository)
if not ("spdlog" in skip_targets or "com_github_gabime_spdlog" in existing_rule_keys):
com_github_gabime_spdlog(repository)
if not ("gcovr" in skip_targets or "com_github_gcovr_gcovr" in existing_rule_keys):
com_github_gcovr_gcovr(repository)
if not ("lightstep" in skip_targets or "com_github_lightstep_lightstep_tracer_cpp" in existing_rule_keys):
com_github_lightstep_lightstep_tracer_cpp(repository)
if not ("http_parser" in skip_targets or "com_github_nodejs_http_parser" in existing_rule_keys):
com_github_nodejs_http_parser(repository)
if not ("rapidjson" in skip_targets or "com_github_tencent_rapidjson" in existing_rule_keys):
com_github_tencent_rapidjson(repository)
if not ("googletest" in skip_targets or "com_google_googletest" in existing_rule_keys):
com_google_googletest()
if not (skip_com_google_protobuf or "com_google_protobuf" in existing_rule_keys):
com_google_protobuf()
if not ("subpar" in existing_rule_keys):
subpar()

for t in TARGET_RECIPES:
if t not in skip_targets:
Expand All @@ -252,6 +269,42 @@ def envoy_dependencies(path = "@envoy_deps//", skip_com_google_protobuf = False,
envoy_api_deps(skip_targets)
abseil_deps(skip_targets)

def com_github_bombela_backward(repository = ""):
native.new_git_repository(
name = "com_github_bombela_backward",
remote = "https://github.com/bombela/backward-cpp",
commit = "cd1c4bd9e48afe812a0e996d335298c455afcd92", # v1.3
build_file = repository + "//bazel/external:backward.BUILD",
)
native.bind(
name = "backward",
actual = "@com_github_bombela_backward//:backward",
)

def com_github_cyan4973_xxhash(repository = ""):
native.new_git_repository(
name = "com_github_cyan4973_xxhash",
remote = "https://github.com/Cyan4973/xxHash",
commit = "50a564c33c36b3f0c83f027dd21c25cba2967c72", # v0.6.3
build_file = repository + "//bazel/external:xxhash.BUILD",
)
native.bind(
name = "xxhash",
actual = "@com_github_cyan4973_xxhash//:xxhash",
)

def com_github_eile_tclap(repository = ""):
native.new_git_repository(
name = "com_github_eile_tclap",
remote = "https://github.com/eile/tclap",
commit = "3627d9402e529770df9b0edf2aa8c0e0d6c6bb41", # tclap-1-2-1-release-final
build_file = repository + "//bazel/external:tclap.BUILD",
)
native.bind(
name = "tclap",
actual = "@com_github_eile_tclap//:tclap",
)

def com_github_fmtlib_fmt(repository = ""):
native.new_http_archive(
name = "com_github_fmtlib_fmt",
Expand Down Expand Up @@ -282,6 +335,18 @@ def com_github_gabime_spdlog(repository = ""):
actual="@com_github_gabime_spdlog//:spdlog",
)

def com_github_gcovr_gcovr(repository = ""):
native.new_git_repository(
name = "com_github_gcovr_gcovr",
remote = "https://github.com/gcovr/gcovr",
commit = "c0d77201039c7b119b18bc7fb991564c602dd75d",
build_file = repository + "//bazel/external:gcovr.BUILD",
)
native.bind(
name = "gcovr",
actual = "@com_github_gcovr_gcovr//:gcovr",
)

def com_github_lightstep_lightstep_tracer_cpp(repository = ""):
genrule_repository(
name = "com_github_lightstep_lightstep_tracer_cpp",
Expand All @@ -301,6 +366,41 @@ def com_github_lightstep_lightstep_tracer_cpp(repository = ""):
actual="@com_github_lightstep_lightstep_tracer_cpp//:lightstep",
)

def com_github_tencent_rapidjson(repository = ""):
native.new_git_repository(
name = "com_github_tencent_rapidjson",
remote = "https://github.com/tencent/rapidjson",
commit = "f54b0e47a08782a6131cc3d60f94d038fa6e0a51", # v1.1.0
build_file = repository + "//bazel/external:rapidjson.BUILD",
)
native.bind(
name = "rapidjson",
actual = "@com_github_tencent_rapidjson//:rapidjson",
)

def com_github_nodejs_http_parser(repository = ""):
native.new_git_repository(
name = "com_github_nodejs_http_parser",
remote = "https://github.com/nodejs/http-parser",
commit = "feae95a3a69f111bc1897b9048d9acbc290992f9", # v2.7.1
build_file = repository + "//bazel/external:http-parser.BUILD",
)
native.bind(
name = "http_parser",
actual = "@com_github_nodejs_http_parser//:http_parser",
)

def com_google_googletest():
native.git_repository(
name = "com_google_googletest",
remote = "https://github.com/google/googletest",
commit = "43863938377a9ea1399c0596269e0890b5c5515a",
)
native.bind(
name = "googletest",
actual = "@com_google_googletest//:gtest",
)

def com_google_protobuf():
# TODO(htuch): This can switch back to a point release http_archive at the next
# release (> 3.4.1), we need HEAD proto_library support and
Expand Down Expand Up @@ -328,3 +428,12 @@ def com_google_protobuf():
name = "protoc",
actual = "@com_google_protobuf_cc//:protoc",
)

def subpar():
# I'd love to name this `com_github_google_subpar`, but something in the Subpar
# code assumes its repository name is just `subpar`.
native.git_repository(
name = "subpar",
remote = "https://github.com/google/subpar",
commit = "eb23aa7a5361cabc02464476dd080389340a5522", # HEAD
)
2 changes: 1 addition & 1 deletion bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
REPO_LOCATIONS = {
"jinja2": "https://github.com/pallets/jinja.git",
"grpc_transcoding": "https://github.com/grpc-ecosystem/grpc-httpjson-transcoding.git",
"envoy_api": "https://github.com/envoyproxy/data-plane-api.git",
"data-plane-api": "https://github.com/envoyproxy/data-plane-api.git",
"markupsafe": "https://github.com/pallets/markupsafe.git",
"abseil_cpp": "https://github.com/abseil/abseil-cpp",
}
9 changes: 0 additions & 9 deletions bazel/target_recipes.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,12 @@
# ci/build_container/build_recipes.
TARGET_RECIPES = {
"ares": "cares",
"backward": "backward",
"event": "libevent",
"event_pthreads": "libevent",
# TODO(htuch): This shouldn't be a build recipe, it's a tooling dependency
# that is external to Bazel.
"gcovr": "gcovr",
"googletest": "googletest",
"tcmalloc_and_profiler": "gperftools",
"http_parser": "http-parser",
"luajit": "luajit",
"nghttp2": "nghttp2",
"rapidjson": "rapidjson",
"ssl": "boringssl",
"tclap": "tclap",
"xxhash": "xxhash",
"yaml_cpp": "yaml-cpp",
"zlib": "zlib",
}
Loading

0 comments on commit a156653

Please sign in to comment.