Skip to content

Commit

Permalink
Update envoy and add c-ares (envoyproxy#107)
Browse files Browse the repository at this point in the history
* Update envoy and add c-ares depedencies

* Update release script with debug and normal binary

* remove debug ls

* formatting
  • Loading branch information
kyessenov committed Feb 22, 2017
1 parent 0804a07 commit 7444da1
Show file tree
Hide file tree
Showing 2 changed files with 137 additions and 2 deletions.
14 changes: 13 additions & 1 deletion script/release-binary
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,19 @@ gsutil stat "${DST}/${BINARY_NAME}" \
&& { echo 'Binary already exists'; exit 0; } \
|| echo 'Building a new binary.'

# Build the binary
# Build the release binary
bazel build --config=release //src/envoy/mixer:envoy_tar
BAZEL_TARGET="bazel-bin/src/envoy/mixer/envoy_tar.tar.gz"
cp -f "${BAZEL_TARGET}" "${BINARY_NAME}"
sha256sum "${BINARY_NAME}" > "${SHA256_NAME}"

# Copy it to the bucket.
echo "Copying ${BINARY_NAME} ${SHA256_NAME} to ${DST}/"
gsutil cp "${BINARY_NAME}" "${SHA256_NAME}" "${DST}/"

# Build the debug binary
BINARY_NAME="envoy-debug-${SHA}.tar.gz"
SHA256_NAME="envoy-debug-${SHA}.sha256"
bazel build -c dbg //src/envoy/mixer:envoy_tar
BAZEL_TARGET="bazel-bin/src/envoy/mixer/envoy_tar.tar.gz"
cp -f "${BAZEL_TARGET}" "${BINARY_NAME}"
Expand Down
125 changes: 124 additions & 1 deletion src/envoy/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,127 @@ cc_library(
actual = "@nghttp2_tar//:nghttp2",
)

def ares_repositories(bind=True):
BUILD = """
cc_library(
name = "ares",
srcs = [
"ares__close_sockets.c",
"ares__get_hostent.c",
"ares__read_line.c",
"ares__timeval.c",
"ares_cancel.c",
"ares_create_query.c",
"ares_data.c",
"ares_destroy.c",
"ares_expand_name.c",
"ares_expand_string.c",
"ares_fds.c",
"ares_free_hostent.c",
"ares_free_string.c",
"ares_getenv.c",
"ares_gethostbyaddr.c",
"ares_gethostbyname.c",
"ares_getnameinfo.c",
"ares_getopt.c",
"ares_getsock.c",
"ares_init.c",
"ares_library_init.c",
"ares_llist.c",
"ares_mkquery.c",
"ares_nowarn.c",
"ares_options.c",
"ares_parse_a_reply.c",
"ares_parse_aaaa_reply.c",
"ares_parse_mx_reply.c",
"ares_parse_naptr_reply.c",
"ares_parse_ns_reply.c",
"ares_parse_ptr_reply.c",
"ares_parse_soa_reply.c",
"ares_parse_srv_reply.c",
"ares_parse_txt_reply.c",
"ares_platform.c",
"ares_process.c",
"ares_query.c",
"ares_search.c",
"ares_send.c",
"ares_strcasecmp.c",
"ares_strdup.c",
"ares_strerror.c",
"ares_timeout.c",
"ares_version.c",
"ares_writev.c",
"bitncmp.c",
"inet_net_pton.c",
"inet_ntop.c",
"windows_port.c",
],
hdrs = [
"ares_config.h",
"ares.h",
"ares_build.h",
"ares_data.h",
"ares_dns.h",
"ares_getenv.h",
"ares_getopt.h",
"ares_inet_net_pton.h",
"ares_iphlpapi.h",
"ares_ipv6.h",
"ares_library_init.h",
"ares_llist.h",
"ares_nowarn.h",
"ares_platform.h",
"ares_private.h",
"ares_rules.h",
"ares_setup.h",
"ares_strcasecmp.h",
"ares_strdup.h",
"ares_version.h",
"ares_writev.h",
"bitncmp.h",
"nameser.h",
"setup_once.h",
],
copts = [
"-DHAVE_CONFIG_H",
],
includes = ["."],
visibility = ["//visibility:public"],
)
genrule(
name = "config",
srcs = glob(["**/*"]),
outs = ["ares_config.h"],
cmd = "pushd external/cares_git ; ./buildconf ; ./configure ; cp ares_config.h ../../$@",
visibility = ["//visibility:public"],
)
genrule(
name = "ares_build",
srcs = [
"ares_build.h.dist",
],
outs = [
"ares_build.h",
],
cmd = "cp $(SRCS) $@",
visibility = ["//visibility:public"],
)
"""

native.new_git_repository(
name = "cares_git",
remote = "https://github.com/c-ares/c-ares.git",
commit = "7691f773af79bf75a62d1863fd0f13ebf9dc51b1", # v1.12.0
build_file_content = BUILD,
)

if bind:
native.bind(
name = "ares",
actual = "@cares_git//:ares",
)

def envoy_repositories(bind=True):
libevent_repositories(bind)
Expand All @@ -451,6 +572,7 @@ def envoy_repositories(bind=True):
http_parser_repositories(bind)
rapidjson_repositories(bind)
nghttp2_repositories(bind)
ares_repositories(bind)

BUILD = """
load("@protobuf_git//:protobuf.bzl", "cc_proto_library")
Expand Down Expand Up @@ -541,6 +663,7 @@ cc_library(
alwayslink=1,
deps = [
":envoy-ratelimit-pb",
"//external:ares",
"//external:libssl",
"//external:nghttp2",
"//external:spdlog",
Expand Down Expand Up @@ -629,6 +752,6 @@ cc_test(
native.new_git_repository(
name = "envoy_git",
remote = "https://github.com/lyft/envoy.git",
commit = "fa1d9680d809668fef2ec9386769c79486029f04",
commit = "abef64f738d269f6c7f8265233d3ea377eef9596", # 2/16/2017
build_file_content = BUILD,
)

0 comments on commit 7444da1

Please sign in to comment.