aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.gitmodules1
-rw-r--r--Makefile6
-rw-r--r--build.yaml9
-rw-r--r--setup.py14
-rwxr-xr-xsrc/c-ares/gen_build_yaml.py3
-rw-r--r--templates/Makefile.template5
m---------third_party/c-ares0
-rwxr-xr-xtools/buildgen/plugins/expand_bin_attrs.py2
-rwxr-xr-xtools/buildgen/plugins/expand_filegroups.py1
-rwxr-xr-xtools/distrib/check_copyright.py4
10 files changed, 26 insertions, 19 deletions
diff --git a/.gitmodules b/.gitmodules
index 3dd8247048..01b8fab98d 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -20,3 +20,4 @@
[submodule "third_party/c-ares"]
path = third_party/c-ares
url = https://github.com/c-ares/c-ares.git
+ branch = cares-1_11_0
diff --git a/Makefile b/Makefile
index f67e1f352f..58b3977582 100644
--- a/Makefile
+++ b/Makefile
@@ -1252,8 +1252,6 @@ $(LIBDIR)/$(CONFIG)/c-ares/libcares.a: third_party/c-ares/configure
$(Q)$(MAKE) -C third_party/c-ares
$(Q)mkdir -p $(LIBDIR)/$(CONFIG)/c-ares
$(Q)cp third_party/c-ares/.libs/libcares.a $(LIBDIR)/$(CONFIG)
- # $(Q)[ -f third_party/c-ares/.libs/libcares.2.dylib ] && cp third_party/c-ares/.libs/libcares.2.dylib $(LIBDIR)/$(CONFIG)/c-ares
- # $(Q)[ -f third_party/c-ares/.libs/libcares.dylib ] && cp third_party/c-ares/.libs/libcares.dylib $(LIBDIR)/$(CONFIG)/c-ares
$(OBJDIR)/$(CONFIG)/src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.o: third_party/c-ares/configure
$(OBJDIR)/$(CONFIG)/src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.o: third_party/c-ares/configure
@@ -6615,8 +6613,10 @@ PUBLIC_HEADERS_C += \
LIBARES_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBARES_SRC))))
+$(LIBARES_OBJS): CPPFLAGS += -Ithird_party/c-ares -Isrc/c-ares $(if $(subst Linux,,$(SYSTEM)),,-Isrc/c-ares/config_linux) -fvisibility=hidden -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN -D_HAS_EXCEPTIONS=0 -DNOMINMAX -DHAVE_CONFIG_H
+$(LIBARES_OBJS): CFLAGS += -Wno-sign-conversion -Wno-invalid-source-encoding
-$(LIBDIR)/$(CONFIG)/libares.a: $(ZLIB_DEP) $(LIBARES_OBJS) $(CARES_DEP)
+$(LIBDIR)/$(CONFIG)/libares.a: $(ZLIB_DEP) third_party/c-ares/configure $(LIBARES_OBJS) $(CARES_DEP)
$(E) "[AR] Creating $@"
$(Q) mkdir -p `dirname $@`
$(Q) rm -f $(LIBDIR)/$(CONFIG)/libares.a
diff --git a/build.yaml b/build.yaml
index a8df258151..d636287403 100644
--- a/build.yaml
+++ b/build.yaml
@@ -3375,11 +3375,10 @@ configs:
timeout_multiplier: 1.5
defaults:
ares:
- CFLAGS: -Wno-sign-conversion -Wno-conversion -Wno-unused-value -Wno-unknown-pragmas
- -Wno-implicit-function-declaration -Wno-unused-variable -Wno-sign-compare $(NO_W_EXTRA_SEMI)
- -DHAVE_CONFIG_H
- CPPFLAGS: -Ithird_party/boringssl/include -fvisibility=hidden -DOPENSSL_NO_ASM
- -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN -D_HAS_EXCEPTIONS=0 -DNOMINMAX
+ CFLAGS: -Wno-sign-conversion -Wno-invalid-source-encoding
+ CPPFLAGS: -Ithird_party/c-ares -Isrc/c-ares $(if $(subst Linux,,$(SYSTEM)),,-Isrc/c-ares/config_linux)
+ -fvisibility=hidden -D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN -D_HAS_EXCEPTIONS=0
+ -DNOMINMAX -DHAVE_CONFIG_H
boringssl:
CFLAGS: -Wno-sign-conversion -Wno-conversion -Wno-unused-value -Wno-unknown-pragmas
-Wno-implicit-function-declaration -Wno-unused-variable -Wno-sign-compare $(NO_W_EXTRA_SEMI)
diff --git a/setup.py b/setup.py
index 895fd663d6..e59f4286b4 100644
--- a/setup.py
+++ b/setup.py
@@ -52,11 +52,12 @@ PYTHON_STEM = os.path.join('src', 'python', 'grpcio')
CORE_INCLUDE = ('include', '.',)
BORINGSSL_INCLUDE = (os.path.join('third_party', 'boringssl', 'include'),)
ZLIB_INCLUDE = (os.path.join('third_party', 'zlib'),)
-CARES_INCLUDE = (os.path.join('third_party', 'c-ares'), os.path.join('src', 'c-ares'),)
-if "linux" in sys.platform:
- CARES_INCLUDE += (os.path.join('src', 'c-ares', 'config_linux'),)
-if "darwin" in sys.platform:
- CARES_INCLUDE += (os.path.join('src', 'c-ares', 'config_darwin'),)
+CARES_INCLUDE = (
+ os.path.join('third_party', 'c-ares'), os.path.join('src', 'c-ares'),)
+if 'linux' in sys.platform:
+ CARES_INCLUDE += (os.path.join('src', 'c-ares', 'config_linux'),)
+if 'darwin' in sys.platform:
+ CARES_INCLUDE += (os.path.join('src', 'c-ares', 'config_darwin'),)
# Ensure we're in the proper directory whether or not we're being used by pip.
os.chdir(os.path.dirname(os.path.abspath(__file__)))
@@ -134,7 +135,8 @@ CYTHON_HELPER_C_FILES = ()
CORE_C_FILES = tuple(grpc_core_dependencies.CORE_SOURCE_FILES)
EXTENSION_INCLUDE_DIRECTORIES = (
- (PYTHON_STEM,) + CORE_INCLUDE + BORINGSSL_INCLUDE + ZLIB_INCLUDE + CARES_INCLUDE)
+ (PYTHON_STEM,) + CORE_INCLUDE + BORINGSSL_INCLUDE + ZLIB_INCLUDE +
+ CARES_INCLUDE)
EXTENSION_LIBRARIES = ()
if "linux" in sys.platform:
diff --git a/src/c-ares/gen_build_yaml.py b/src/c-ares/gen_build_yaml.py
index 6cde19a915..1081b4b311 100755
--- a/src/c-ares/gen_build_yaml.py
+++ b/src/c-ares/gen_build_yaml.py
@@ -59,10 +59,9 @@ try:
gen_ares_build(x)
return 'third_party/c-ares/ares_build.h'
-
-
out['libs'] = [{
'name': 'ares',
+ 'defaults': 'ares',
'build': 'private',
'language': 'c',
'secure': 'no',
diff --git a/templates/Makefile.template b/templates/Makefile.template
index b06aa17263..8e4c87b640 100644
--- a/templates/Makefile.template
+++ b/templates/Makefile.template
@@ -894,8 +894,6 @@
$(Q)$(MAKE) -C third_party/c-ares
$(Q)mkdir -p $(LIBDIR)/$(CONFIG)/c-ares
$(Q)cp third_party/c-ares/.libs/libcares.a $(LIBDIR)/$(CONFIG)
- # $(Q)[ -f third_party/c-ares/.libs/libcares.2.dylib ] && cp third_party/c-ares/.libs/libcares.2.dylib $(LIBDIR)/$(CONFIG)/c-ares
- # $(Q)[ -f third_party/c-ares/.libs/libcares.dylib ] && cp third_party/c-ares/.libs/libcares.dylib $(LIBDIR)/$(CONFIG)/c-ares
$(OBJDIR)/$(CONFIG)/src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.o: third_party/c-ares/configure
$(OBJDIR)/$(CONFIG)/src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.o: third_party/c-ares/configure
@@ -1499,6 +1497,9 @@
% if lib.name != 'z':
$(ZLIB_DEP) \
% endif
+ % if lib.name == 'ares':
+ third_party/c-ares/configure \
+ % endif
% endif
% if lib.language == 'c++':
$(PROTOBUF_DEP)\
diff --git a/third_party/c-ares b/third_party/c-ares
-Subproject 7d3e99fd5c57d61a420f2e1419989740916fbeb
+Subproject e7fe2744db383c4489b7adc2b74f8ec3069367e
diff --git a/tools/buildgen/plugins/expand_bin_attrs.py b/tools/buildgen/plugins/expand_bin_attrs.py
index dc72bf3b9d..f52168a9d3 100755
--- a/tools/buildgen/plugins/expand_bin_attrs.py
+++ b/tools/buildgen/plugins/expand_bin_attrs.py
@@ -52,9 +52,11 @@ def mako_plugin(dictionary):
tgt['ci_platforms'] = sorted(tgt.get('ci_platforms', tgt['platforms']))
tgt['boringssl'] = tgt.get('boringssl', False)
tgt['zlib'] = tgt.get('zlib', False)
+ tgt['ares'] = tgt.get('ares', False)
tgt['gtest'] = tgt.get('gtest', False)
libs = dictionary.get('libs')
for lib in libs:
lib['boringssl'] = lib.get('boringssl', False)
lib['zlib'] = lib.get('zlib', False)
+ lib['ares'] = lib.get('ares', False)
diff --git a/tools/buildgen/plugins/expand_filegroups.py b/tools/buildgen/plugins/expand_filegroups.py
index 477e69c869..6cee27ee46 100755
--- a/tools/buildgen/plugins/expand_filegroups.py
+++ b/tools/buildgen/plugins/expand_filegroups.py
@@ -57,6 +57,7 @@ FILEGROUP_DEFAULTS = {
'language': 'c',
'boringssl': False,
'zlib': False,
+ 'ares': False,
}
diff --git a/tools/distrib/check_copyright.py b/tools/distrib/check_copyright.py
index 4577ab3d11..3757c90afd 100755
--- a/tools/distrib/check_copyright.py
+++ b/tools/distrib/check_copyright.py
@@ -108,7 +108,9 @@ RE_LICENSE = dict(
if args.precommit:
FILE_LIST_COMMAND = 'git status -z | grep -Poz \'(?<=^[MARC][MARCD ] )[^\s]+\''
else:
- FILE_LIST_COMMAND = 'git ls-tree -r --name-only -r HEAD | grep -v ^third_party/'
+ FILE_LIST_COMMAND = 'git ls-tree -r --name-only -r HEAD | ' \
+ 'grep -v ^third_party/ |' \
+ 'grep -v "\(ares_config.h\|ares_build.h\)"'
def load(name):
with open(name) as f: