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

Use a native Bazel dep for Googletest. #2009

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
13 changes: 13 additions & 0 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ def envoy_dependencies(path = "@envoy_deps//", skip_com_google_protobuf = False,
com_github_gabime_spdlog(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 ("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()

Expand Down Expand Up @@ -288,6 +290,17 @@ def com_github_lightstep_lightstep_tracer_cpp(repository = ""):
actual="@com_github_lightstep_lightstep_tracer_cpp//:lightstep",
)

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
1 change: 0 additions & 1 deletion bazel/target_recipes.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ TARGET_RECIPES = {
# 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",
Expand Down
14 changes: 0 additions & 14 deletions ci/build_container/build_recipes/googletest.sh

This file was deleted.

13 changes: 0 additions & 13 deletions ci/prebuilt/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,6 @@ cc_library(
deps = [":event"],
)

cc_library(
name = "googletest",
srcs = [
"thirdparty_build/lib/libgmock.a",
"thirdparty_build/lib/libgtest.a",
],
hdrs = glob([
"thirdparty_build/include/gmock/**/*.h",
"thirdparty_build/include/gtest/**/*.h",
]),
includes = ["thirdparty_build/include"],
)

cc_library(
name = "http_parser",
srcs = ["thirdparty_build/lib/libhttp_parser.a"],
Expand Down