@@ -15,6 +15,10 @@ PPC_SKIP_TARGETS = {"luajit": "envoy.filters.http.lua"}
1515# go version for rules_go
1616GO_VERSION = "1.10.4"
1717
18+ # Make all contents of an external repository accessible under a filegroup. Used for external HTTP
19+ # archives, e.g. cares.
20+ BUILD_ALL_CONTENT = """filegroup(name = "all", srcs = glob(["**"]), visibility = ["//visibility:public"])"""
21+
1822def _repository_impl (name , ** kwargs ):
1923 # `existing_rule_keys` contains the names of repositories that have already
2024 # been defined in the Bazel workspace. By skipping repos with existing keys,
@@ -265,6 +269,9 @@ def envoy_dependencies(path = "@envoy_deps//", skip_targets = []):
265269 if "envoy_build_config" not in native .existing_rules ().keys ():
266270 _default_envoy_build_config (name = "envoy_build_config" )
267271
272+ # Setup rules_foreign_cc
273+ _foreign_cc_dependencies ()
274+
268275 # Binding to an alias pointing to the selected version of BoringSSL:
269276 # - BoringSSL FIPS from @boringssl_fips//:ssl,
270277 # - non-FIPS BoringSSL from @boringssl//:ssl.
@@ -281,6 +288,7 @@ def envoy_dependencies(path = "@envoy_deps//", skip_targets = []):
281288 _com_google_absl ()
282289 _com_github_bombela_backward ()
283290 _com_github_circonus_labs_libcircllhist ()
291+ _com_github_c_ares_c_ares ()
284292 _com_github_cyan4973_xxhash ()
285293 _com_github_eile_tclap ()
286294 _com_github_fmtlib_fmt ()
@@ -291,8 +299,13 @@ def envoy_dependencies(path = "@envoy_deps//", skip_targets = []):
291299 _com_lightstep_tracer_cpp ()
292300 _com_github_datadog_dd_opentracing_cpp ()
293301 _com_github_grpc_grpc ()
302+ _com_github_google_benchmark ()
294303 _com_github_google_jwt_verify ()
304+ _com_github_jbeder_yaml_cpp ()
305+ _com_github_libevent_libevent ()
306+ _com_github_madler_zlib ()
295307 _com_github_nanopb_nanopb ()
308+ _com_github_nghttp2_nghttp2 ()
296309 _com_github_nodejs_http_parser ()
297310 _com_github_tencent_rapidjson ()
298311 _com_google_googletest ()
@@ -341,6 +354,18 @@ def _com_github_circonus_labs_libcircllhist():
341354 actual = "@com_github_circonus_labs_libcircllhist//:libcircllhist" ,
342355 )
343356
357+ def _com_github_c_ares_c_ares ():
358+ location = REPOSITORY_LOCATIONS ["com_github_c_ares_c_ares" ]
359+ http_archive (
360+ name = "com_github_c_ares_c_ares" ,
361+ build_file_content = BUILD_ALL_CONTENT ,
362+ ** location
363+ )
364+ native .bind (
365+ name = "ares" ,
366+ actual = "//bazel/foreign_cc:ares" ,
367+ )
368+
344369def _com_github_cyan4973_xxhash ():
345370 _repository_impl (
346371 name = "com_github_cyan4973_xxhash" ,
@@ -401,6 +426,17 @@ def _com_github_gcovr_gcovr():
401426 actual = "@com_github_gcovr_gcovr//:gcovr" ,
402427 )
403428
429+ def _com_github_google_benchmark ():
430+ location = REPOSITORY_LOCATIONS ["com_github_google_benchmark" ]
431+ http_archive (
432+ name = "com_github_google_benchmark" ,
433+ ** location
434+ )
435+ native .bind (
436+ name = "benchmark" ,
437+ actual = "@com_github_google_benchmark//:benchmark" ,
438+ )
439+
404440def _com_github_google_libprotobuf_mutator ():
405441 _repository_impl (
406442 name = "com_github_google_libprotobuf_mutator" ,
@@ -411,6 +447,57 @@ def _com_github_google_libprotobuf_mutator():
411447 actual = "@com_github_google_libprotobuf_mutator//:libprotobuf_mutator" ,
412448 )
413449
450+ def _com_github_jbeder_yaml_cpp ():
451+ location = REPOSITORY_LOCATIONS ["com_github_jbeder_yaml_cpp" ]
452+ http_archive (
453+ name = "com_github_jbeder_yaml_cpp" ,
454+ build_file_content = BUILD_ALL_CONTENT ,
455+ ** location
456+ )
457+ native .bind (
458+ name = "yaml_cpp" ,
459+ actual = "//bazel/foreign_cc:yaml" ,
460+ )
461+
462+ def _com_github_libevent_libevent ():
463+ location = REPOSITORY_LOCATIONS ["com_github_libevent_libevent" ]
464+ http_archive (
465+ name = "com_github_libevent_libevent" ,
466+ build_file_content = BUILD_ALL_CONTENT ,
467+ ** location
468+ )
469+ native .bind (
470+ name = "event" ,
471+ actual = "//bazel/foreign_cc:event" ,
472+ )
473+
474+ def _com_github_madler_zlib ():
475+ location = REPOSITORY_LOCATIONS ["com_github_madler_zlib" ]
476+ http_archive (
477+ name = "com_github_madler_zlib" ,
478+ build_file_content = BUILD_ALL_CONTENT ,
479+ ** location
480+ )
481+ native .bind (
482+ name = "zlib" ,
483+ actual = "//bazel/foreign_cc:zlib" ,
484+ )
485+
486+ def _com_github_nghttp2_nghttp2 ():
487+ location = REPOSITORY_LOCATIONS ["com_github_nghttp2_nghttp2" ]
488+ http_archive (
489+ name = "com_github_nghttp2_nghttp2" ,
490+ build_file_content = BUILD_ALL_CONTENT ,
491+ patch_args = ["-p1" ],
492+ patch_cmds = ["find . -name '*.sh' -exec sed -i.orig '1s|#!/usr/bin/env sh\$|/bin/sh\$|' {} +" ],
493+ patches = ["//bazel/foreign_cc:nghttp2.patch" ],
494+ ** location
495+ )
496+ native .bind (
497+ name = "nghttp2" ,
498+ actual = "//bazel/foreign_cc:nghttp2" ,
499+ )
500+
414501def _io_opentracing_cpp ():
415502 _repository_impl ("io_opentracing_cpp" )
416503 native .bind (
@@ -645,6 +732,9 @@ def _com_github_google_jwt_verify():
645732 actual = "@com_github_google_jwt_verify//:jwt_verify_lib" ,
646733 )
647734
735+ def _foreign_cc_dependencies ():
736+ _repository_impl ("rules_foreign_cc" )
737+
648738def _apply_dep_blacklist (ctxt , recipes ):
649739 newlist = []
650740 skip_list = []
0 commit comments