From a4e10dedf1232cd18c83c7da544683aea03971bf Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Fri, 17 Feb 2017 15:18:55 -0800 Subject: [PATCH 1/4] Update envoy and add c-ares depedencies --- src/envoy/repositories.bzl | 124 ++++++++++++++++++++++++++++++++++++- 1 file changed, 123 insertions(+), 1 deletion(-) diff --git a/src/envoy/repositories.bzl b/src/envoy/repositories.bzl index ec140710592..356f59be58c 100644 --- a/src/envoy/repositories.bzl +++ b/src/envoy/repositories.bzl @@ -442,6 +442,126 @@ 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 ; ls ; 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) @@ -451,6 +571,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") @@ -541,6 +662,7 @@ cc_library( alwayslink=1, deps = [ ":envoy-ratelimit-pb", + "//external:ares", "//external:libssl", "//external:nghttp2", "//external:spdlog", @@ -629,6 +751,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, ) From 93e41ab7f84964342d15b5e42732a8c0bb5e9af1 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Fri, 17 Feb 2017 15:21:45 -0800 Subject: [PATCH 2/4] Update release script with debug and normal binary --- script/release-binary | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/script/release-binary b/script/release-binary index 98bbc67a173..0ff4dd63f91 100755 --- a/script/release-binary +++ b/script/release-binary @@ -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}" From aabcc768073129137f0798a6013a9125fc6d5aaa Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Fri, 17 Feb 2017 15:25:33 -0800 Subject: [PATCH 3/4] remove debug ls --- src/envoy/repositories.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/envoy/repositories.bzl b/src/envoy/repositories.bzl index 356f59be58c..06e8935758d 100644 --- a/src/envoy/repositories.bzl +++ b/src/envoy/repositories.bzl @@ -533,7 +533,7 @@ genrule( name = "config", srcs = glob(["**/*"]), outs = ["ares_config.h"], - cmd = "pushd external/cares_git ; ./buildconf ; ./configure ; ls ; cp ares_config.h ../../$@", + cmd = "pushd external/cares_git ; ./buildconf ; ./configure ; cp ares_config.h ../../$@", visibility = ["//visibility:public"], ) From d22ecc2d2a4216e6f2b664424efb80ab9aab7230 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Fri, 17 Feb 2017 15:27:37 -0800 Subject: [PATCH 4/4] formatting --- src/envoy/repositories.bzl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/envoy/repositories.bzl b/src/envoy/repositories.bzl index 06e8935758d..150f445015e 100644 --- a/src/envoy/repositories.bzl +++ b/src/envoy/repositories.bzl @@ -498,7 +498,7 @@ cc_library( "windows_port.c", ], hdrs = [ - "ares_config.h", + "ares_config.h", "ares.h", "ares_build.h", "ares_data.h", @@ -518,7 +518,7 @@ cc_library( "ares_strcasecmp.h", "ares_strdup.h", "ares_version.h", - "ares_writev.h", + "ares_writev.h", "bitncmp.h", "nameser.h", "setup_once.h", @@ -529,6 +529,7 @@ cc_library( includes = ["."], visibility = ["//visibility:public"], ) + genrule( name = "config", srcs = glob(["**/*"]),