Remove dependency on node c-ares

pull/7900/head
Yuchen Zeng 8 years ago
parent e986b658b7
commit ea88fc197b
  1. 6
      BUILD
  2. 4
      CMakeLists.txt
  3. 6
      Makefile
  4. 92
      binding.gyp
  5. 5
      build.yaml
  6. 2
      config.m4
  7. 2
      gRPC-Core.podspec
  8. 2
      grpc.gemspec
  9. 2
      package.xml
  10. 0
      src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c
  11. 1
      src/core/lib/security/credentials/fake/fake_credentials.c
  12. 2
      src/python/grpcio/grpc_core_dependencies.py
  13. 51
      templates/binding.gyp.template
  14. 2
      tools/doxygen/Doxyfile.core.internal
  15. 2
      tools/run_tests/sources_and_headers.json
  16. 2
      vsprojects/vcxproj/grpc/grpc.vcxproj
  17. 2
      vsprojects/vcxproj/grpc/grpc.vcxproj.filters
  18. 2
      vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj
  19. 2
      vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters

@ -486,7 +486,7 @@ cc_library(
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c",
"src/core/ext/lb_policy/pick_first/pick_first.c",
"src/core/ext/lb_policy/round_robin/round_robin.c",
"src/core/ext/resolver/dns/c_ares/dns_resolver.c",
"src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c",
"src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c",
"src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c",
"src/core/ext/resolver/dns/native/dns_resolver.c",
@ -1182,7 +1182,7 @@ cc_library(
"src/core/ext/client_config/subchannel_call_holder.c",
"src/core/ext/client_config/subchannel_index.c",
"src/core/ext/client_config/uri_parser.c",
"src/core/ext/resolver/dns/c_ares/dns_resolver.c",
"src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c",
"src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c",
"src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c",
"src/core/ext/resolver/dns/native/dns_resolver.c",
@ -1987,7 +1987,7 @@ objc_library(
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c",
"src/core/ext/lb_policy/pick_first/pick_first.c",
"src/core/ext/lb_policy/round_robin/round_robin.c",
"src/core/ext/resolver/dns/c_ares/dns_resolver.c",
"src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c",
"src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c",
"src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c",
"src/core/ext/resolver/dns/native/dns_resolver.c",

@ -450,7 +450,7 @@ add_library(grpc
third_party/nanopb/pb_encode.c
src/core/ext/lb_policy/pick_first/pick_first.c
src/core/ext/lb_policy/round_robin/round_robin.c
src/core/ext/resolver/dns/c_ares/dns_resolver.c
src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c
src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c
src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c
src/core/ext/resolver/dns/native/dns_resolver.c
@ -901,7 +901,7 @@ add_library(grpc_unsecure
src/core/ext/client_config/subchannel_call_holder.c
src/core/ext/client_config/subchannel_index.c
src/core/ext/client_config/uri_parser.c
src/core/ext/resolver/dns/c_ares/dns_resolver.c
src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c
src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c
src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c
src/core/ext/resolver/dns/native/dns_resolver.c

@ -2753,7 +2753,7 @@ LIBGRPC_SRC = \
third_party/nanopb/pb_encode.c \
src/core/ext/lb_policy/pick_first/pick_first.c \
src/core/ext/lb_policy/round_robin/round_robin.c \
src/core/ext/resolver/dns/c_ares/dns_resolver.c \
src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c \
src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c \
src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c \
src/core/ext/resolver/dns/native/dns_resolver.c \
@ -3452,7 +3452,7 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/client_config/subchannel_call_holder.c \
src/core/ext/client_config/subchannel_index.c \
src/core/ext/client_config/uri_parser.c \
src/core/ext/resolver/dns/c_ares/dns_resolver.c \
src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c \
src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c \
src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c \
src/core/ext/resolver/dns/native/dns_resolver.c \
@ -6605,7 +6605,7 @@ 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) $(if $(subst Darwin,,$(SYSTEM)),,-Isrc/c-ares/config_darwin) -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
$(LIBARES_OBJS): CFLAGS += -Wno-sign-conversion -Wno-invalid-source-encoding -Wno-pointer-sign
$(LIBDIR)/$(CONFIG)/libares.a: $(ZLIB_DEP) $(LIBARES_OBJS)
$(E) "[AR] Creating $@"

@ -47,7 +47,8 @@
"include_dirs": [
"third_party/boringssl/include",
"third_party/zlib",
"third_party/c-ares"
"third_party/c-ares",
"src/c-ares",
],
"defines": [
'_WIN32_WINNT=0x0600',
@ -86,7 +87,8 @@
'include_dirs': [
'<(node_root_dir)/deps/openssl/openssl/include',
'<(node_root_dir)/deps/zlib',
'<(node_root_dir)/deps/cares/include'
"third_party/c-ares",
"src/c-ares"
],
'conditions': [
['config=="gcov"', {
@ -485,7 +487,6 @@
}]
],
'targets': [
{
'cflags': [
'-std=c99',
@ -563,7 +564,6 @@
'type': 'static_library',
'dependencies': [
'gpr',
'node_modules/cares/deps/cares/cares.gyp:cares',
],
'sources': [
'src/core/lib/surface/init.c',
@ -739,7 +739,7 @@
'third_party/nanopb/pb_encode.c',
'src/core/ext/lb_policy/pick_first/pick_first.c',
'src/core/ext/lb_policy/round_robin/round_robin.c',
'src/core/ext/resolver/dns/c_ares/dns_resolver.c',
'src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c',
'src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c',
'src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c',
'src/core/ext/resolver/dns/native/dns_resolver.c',
@ -768,6 +768,86 @@
}]
]
},
{
'cflags': [
'-Wall',
'-Werror',
'-Wno-implicit-function-declaration'
],
'include_dirs': [ 'src/c-ares' ],
'target_name': 'ares',
'product_prefix': 'lib',
'type': 'static_library',
'dependencies': [
],
'sources': [
'third_party/c-ares/ares__close_sockets.c',
'third_party/c-ares/ares__get_hostent.c',
'third_party/c-ares/ares__read_line.c',
'third_party/c-ares/ares__timeval.c',
'third_party/c-ares/ares_cancel.c',
'third_party/c-ares/ares_create_query.c',
'third_party/c-ares/ares_data.c',
'third_party/c-ares/ares_destroy.c',
'third_party/c-ares/ares_expand_name.c',
'third_party/c-ares/ares_expand_string.c',
'third_party/c-ares/ares_fds.c',
'third_party/c-ares/ares_free_hostent.c',
'third_party/c-ares/ares_free_string.c',
'third_party/c-ares/ares_getenv.c',
'third_party/c-ares/ares_gethostbyaddr.c',
'third_party/c-ares/ares_gethostbyname.c',
'third_party/c-ares/ares_getnameinfo.c',
'third_party/c-ares/ares_getopt.c',
'third_party/c-ares/ares_getsock.c',
'third_party/c-ares/ares_init.c',
'third_party/c-ares/ares_library_init.c',
'third_party/c-ares/ares_llist.c',
'third_party/c-ares/ares_mkquery.c',
'third_party/c-ares/ares_nowarn.c',
'third_party/c-ares/ares_options.c',
'third_party/c-ares/ares_parse_a_reply.c',
'third_party/c-ares/ares_parse_aaaa_reply.c',
'third_party/c-ares/ares_parse_mx_reply.c',
'third_party/c-ares/ares_parse_naptr_reply.c',
'third_party/c-ares/ares_parse_ns_reply.c',
'third_party/c-ares/ares_parse_ptr_reply.c',
'third_party/c-ares/ares_parse_soa_reply.c',
'third_party/c-ares/ares_parse_srv_reply.c',
'third_party/c-ares/ares_parse_txt_reply.c',
'third_party/c-ares/ares_platform.c',
'third_party/c-ares/ares_process.c',
'third_party/c-ares/ares_query.c',
'third_party/c-ares/ares_search.c',
'third_party/c-ares/ares_send.c',
'third_party/c-ares/ares_strcasecmp.c',
'third_party/c-ares/ares_strdup.c',
'third_party/c-ares/ares_strerror.c',
'third_party/c-ares/ares_timeout.c',
'third_party/c-ares/ares_version.c',
'third_party/c-ares/ares_writev.c',
'third_party/c-ares/bitncmp.c',
'third_party/c-ares/inet_net_pton.c',
'third_party/c-ares/inet_ntop.c',
'third_party/c-ares/windows_port.c',
],
"conditions": [
['OS == "mac"', {
'xcode_settings': {
'MACOSX_DEPLOYMENT_TARGET': '10.9'
},
'include_dirs': [ 'src/c-ares/config_darwin' ],
'defines': [ 'HAVE_CONFIG_H' ]
}],
['OS == "linux"', {
'include_dirs': [ 'src/c-ares/config_linux' ],
'defines': [ 'HAVE_CONFIG_H' ]
}],
['OS == "win"', {
'defines': [ 'CARES_STATICLIB' ]
}]
]
},
{
'include_dirs': [
"<!(node -e \"require('nan')\")"
@ -822,7 +902,7 @@
"dependencies": [
"grpc",
"gpr",
"node_modules/cares/deps/cares/cares.gyp:cares",
"ares",
]
},
{

@ -423,7 +423,7 @@ filegroups:
- src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver.h
- src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.h
src:
- src/core/ext/resolver/dns/c_ares/dns_resolver.c
- src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c
- src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c
- src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c
plugin: grpc_resolver_dns_ares
@ -3408,7 +3408,7 @@ configs:
timeout_multiplier: 1.5
defaults:
ares:
CFLAGS: -Wno-sign-conversion -Wno-invalid-source-encoding
CFLAGS: -Wno-sign-conversion -Wno-invalid-source-encoding -Wno-pointer-sign
CPPFLAGS: -Ithird_party/c-ares -Isrc/c-ares $(if $(subst Linux,,$(SYSTEM)),,-Isrc/c-ares/config_linux)
$(if $(subst Darwin,,$(SYSTEM)),,-Isrc/c-ares/config_darwin) -fvisibility=hidden
-D_GNU_SOURCE -DWIN32_LEAN_AND_MEAN -D_HAS_EXCEPTIONS=0 -DNOMINMAX -DHAVE_CONFIG_H
@ -3427,6 +3427,7 @@ node_modules:
- deps:
- grpc
- gpr
- ares
- boringssl
- z
headers:

@ -254,7 +254,7 @@ if test "$PHP_GRPC" != "no"; then
third_party/nanopb/pb_encode.c \
src/core/ext/lb_policy/pick_first/pick_first.c \
src/core/ext/lb_policy/round_robin/round_robin.c \
src/core/ext/resolver/dns/c_ares/dns_resolver.c \
src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c \
src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c \
src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c \
src/core/ext/resolver/dns/native/dns_resolver.c \

@ -586,7 +586,7 @@ Pod::Spec.new do |s|
'third_party/nanopb/pb_encode.c',
'src/core/ext/lb_policy/pick_first/pick_first.c',
'src/core/ext/lb_policy/round_robin/round_robin.c',
'src/core/ext/resolver/dns/c_ares/dns_resolver.c',
'src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c',
'src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c',
'src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c',
'src/core/ext/resolver/dns/native/dns_resolver.c',

@ -505,7 +505,7 @@ Gem::Specification.new do |s|
s.files += %w( third_party/nanopb/pb_encode.c )
s.files += %w( src/core/ext/lb_policy/pick_first/pick_first.c )
s.files += %w( src/core/ext/lb_policy/round_robin/round_robin.c )
s.files += %w( src/core/ext/resolver/dns/c_ares/dns_resolver.c )
s.files += %w( src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c )
s.files += %w( src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c )
s.files += %w( src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c )
s.files += %w( src/core/ext/resolver/dns/native/dns_resolver.c )

@ -513,7 +513,7 @@
<file baseinstalldir="/" name="third_party/nanopb/pb_encode.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/lb_policy/pick_first/pick_first.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/lb_policy/round_robin/round_robin.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/resolver/dns/c_ares/dns_resolver.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c" role="src" />
<file baseinstalldir="/" name="src/core/ext/resolver/dns/native/dns_resolver.c" role="src" />

@ -34,7 +34,6 @@
#include "src/core/lib/security/credentials/fake/fake_credentials.h"
#include <string.h>
#include <unistd.h>
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/iomgr/executor.h"

@ -248,7 +248,7 @@ CORE_SOURCE_FILES = [
'third_party/nanopb/pb_encode.c',
'src/core/ext/lb_policy/pick_first/pick_first.c',
'src/core/ext/lb_policy/round_robin/round_robin.c',
'src/core/ext/resolver/dns/c_ares/dns_resolver.c',
'src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c',
'src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c',
'src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c',
'src/core/ext/resolver/dns/native/dns_resolver.c',

@ -49,7 +49,8 @@
"include_dirs": [
"third_party/boringssl/include",
"third_party/zlib",
"third_party/c-ares"
"third_party/c-ares",
"src/c-ares",
],
"defines": [
'_WIN32_WINNT=0x0600',
@ -88,7 +89,8 @@
'include_dirs': [
'<(node_root_dir)/deps/openssl/openssl/include',
'<(node_root_dir)/deps/zlib',
'<(node_root_dir)/deps/cares/include'
"third_party/c-ares",
"src/c-ares"
],
'conditions': [
['config=="gcov"', {
@ -173,16 +175,9 @@
}]
],
'targets': [
<%
for lib in libs:
if 'grpc' in lib.transitive_deps or lib.name == 'grpc':
lib.deps.append('node_modules/cares/deps/cares/cares.gyp:cares')
for module in node_modules:
module.deps.append('node_modules/cares/deps/cares/cares.gyp:cares')
%>
% for module in node_modules:
% for lib in libs:
% if lib.name in module.transitive_deps and lib.name not in ('boringssl', 'z'):
% if lib.name in module.transitive_deps and lib.name not in ('boringssl', 'z', 'ares'):
{
'cflags': [
'-std=c99',
@ -211,6 +206,42 @@
]
},
% endif
% if lib.name == 'ares':
{
'cflags': [
'-Wall',
'-Werror',
'-Wno-implicit-function-declaration'
],
'include_dirs': [ 'src/c-ares' ],
'target_name': '${lib.name}',
'product_prefix': 'lib',
'type': 'static_library',
'dependencies': [
],
'sources': [
% for source in lib.src:
'${source}',
% endfor
],
"conditions": [
['OS == "mac"', {
'xcode_settings': {
'MACOSX_DEPLOYMENT_TARGET': '10.9'
},
'include_dirs': [ 'src/c-ares/config_darwin' ],
'defines': [ 'HAVE_CONFIG_H' ]
}],
['OS == "linux"', {
'include_dirs': [ 'src/c-ares/config_linux' ],
'defines': [ 'HAVE_CONFIG_H' ]
}],
['OS == "win"', {
'defines': [ 'CARES_STATICLIB' ]
}]
]
},
% endif
% endfor
{
'include_dirs': [

@ -1124,7 +1124,7 @@ third_party/nanopb/pb_decode.c \
third_party/nanopb/pb_encode.c \
src/core/ext/lb_policy/pick_first/pick_first.c \
src/core/ext/lb_policy/round_robin/round_robin.c \
src/core/ext/resolver/dns/c_ares/dns_resolver.c \
src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c \
src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c \
src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c \
src/core/ext/resolver/dns/native/dns_resolver.c \

@ -6299,7 +6299,7 @@
"language": "c",
"name": "grpc_resolver_dns_ares",
"src": [
"src/core/ext/resolver/dns/c_ares/dns_resolver.c",
"src/core/ext/resolver/dns/c_ares/dns_resolver_ares.c",
"src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver.h",
"src/core/ext/resolver/dns/c_ares/grpc_ares_ev_driver_posix.c",
"src/core/ext/resolver/dns/c_ares/grpc_ares_wrapper.c",

@ -808,7 +808,7 @@
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\lb_policy\round_robin\round_robin.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\resolver\dns\c_ares\dns_resolver.c">
<ClCompile Include="$(SolutionDir)\..\src\core\ext\resolver\dns\c_ares\dns_resolver_ares.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\resolver\dns\c_ares\grpc_ares_ev_driver_posix.c">
</ClCompile>

@ -520,7 +520,7 @@
<ClCompile Include="$(SolutionDir)\..\src\core\ext\lb_policy\round_robin\round_robin.c">
<Filter>src\core\ext\lb_policy\round_robin</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\resolver\dns\c_ares\dns_resolver.c">
<ClCompile Include="$(SolutionDir)\..\src\core\ext\resolver\dns\c_ares\dns_resolver_ares.c">
<Filter>src\core\ext\resolver\dns\c_ares</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\resolver\dns\c_ares\grpc_ares_ev_driver_posix.c">

@ -699,7 +699,7 @@
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\uri_parser.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\resolver\dns\c_ares\dns_resolver.c">
<ClCompile Include="$(SolutionDir)\..\src\core\ext\resolver\dns\c_ares\dns_resolver_ares.c">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\resolver\dns\c_ares\grpc_ares_ev_driver_posix.c">
</ClCompile>

@ -409,7 +409,7 @@
<ClCompile Include="$(SolutionDir)\..\src\core\ext\client_config\uri_parser.c">
<Filter>src\core\ext\client_config</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\resolver\dns\c_ares\dns_resolver.c">
<ClCompile Include="$(SolutionDir)\..\src\core\ext\resolver\dns\c_ares\dns_resolver_ares.c">
<Filter>src\core\ext\resolver\dns\c_ares</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\src\core\ext\resolver\dns\c_ares\grpc_ares_ev_driver_posix.c">

Loading…
Cancel
Save