Skip to content

Commit

Permalink
Fix python build
Browse files Browse the repository at this point in the history
  • Loading branch information
y-zeng committed Aug 12, 2016
1 parent 2fbf6fd commit d790dd6
Show file tree
Hide file tree
Showing 14 changed files with 2,170 additions and 3 deletions.
75 changes: 74 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,7 @@ plugins: $(PROTOC_PLUGINS)

privatelibs: privatelibs_c privatelibs_cxx

privatelibs_c: $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libreconnect_server.a $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a $(LIBDIR)/$(CONFIG)/libz.a $(LIBDIR)/$(CONFIG)/libbad_client_test.a $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a
privatelibs_c: $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc_test_util_unsecure.a $(LIBDIR)/$(CONFIG)/libreconnect_server.a $(LIBDIR)/$(CONFIG)/libtest_tcp_server.a $(LIBDIR)/$(CONFIG)/libz.a $(LIBDIR)/$(CONFIG)/libares.a $(LIBDIR)/$(CONFIG)/libbad_client_test.a $(LIBDIR)/$(CONFIG)/libbad_ssl_test_server.a $(LIBDIR)/$(CONFIG)/libend2end_tests.a $(LIBDIR)/$(CONFIG)/libend2end_nosec_tests.a
pc_c: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc.pc

pc_c_unsecure: $(LIBDIR)/$(CONFIG)/pkgconfig/grpc_unsecure.pc
Expand Down Expand Up @@ -6560,6 +6560,79 @@ ifneq ($(NO_DEPS),true)
endif


LIBARES_SRC = \
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 \

PUBLIC_HEADERS_C += \

LIBARES_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBARES_SRC))))


$(LIBDIR)/$(CONFIG)/libares.a: $(ZLIB_DEP) $(LIBARES_OBJS) $(CARES_DEP)
$(E) "[AR] Creating $@"
$(Q) mkdir -p `dirname $@`
$(Q) rm -f $(LIBDIR)/$(CONFIG)/libares.a
$(Q) $(AR) $(AROPTS) $(LIBDIR)/$(CONFIG)/libares.a $(LIBARES_OBJS)
ifeq ($(SYSTEM),Darwin)
$(Q) ranlib -no_warning_for_no_symbols $(LIBDIR)/$(CONFIG)/libares.a
endif




ifneq ($(NO_DEPS),true)
-include $(LIBARES_OBJS:.o=.dep)
endif


LIBBAD_CLIENT_TEST_SRC = \
test/core/bad_client/bad_client.c \

Expand Down
1 change: 1 addition & 0 deletions PYTHON-MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ graft include/grpc
graft third_party/boringssl
graft third_party/nanopb
graft third_party/zlib
graft third_party/c-ares
include src/python/grpcio/_unixccompiler_patch.py
include src/python/grpcio/commands.py
include src/python/grpcio/grpc_version.py
Expand Down
7 changes: 7 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3374,6 +3374,12 @@ configs:
UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1
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
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)
Expand Down Expand Up @@ -3457,6 +3463,7 @@ python_dependencies:
deps:
- grpc
- gpr
- ares
- boringssl
- z
ruby_gem:
Expand Down
9 changes: 7 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@
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'),)

# 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__)))
Expand Down Expand Up @@ -129,7 +134,7 @@
CORE_C_FILES = tuple(grpc_core_dependencies.CORE_SOURCE_FILES)

EXTENSION_INCLUDE_DIRECTORIES = (
(PYTHON_STEM,) + CORE_INCLUDE + BORINGSSL_INCLUDE + ZLIB_INCLUDE)
(PYTHON_STEM,) + CORE_INCLUDE + BORINGSSL_INCLUDE + ZLIB_INCLUDE + CARES_INCLUDE)

EXTENSION_LIBRARIES = ()
if "linux" in sys.platform:
Expand All @@ -141,7 +146,7 @@

DEFINE_MACROS = (
('OPENSSL_NO_ASM', 1), ('_WIN32_WINNT', 0x600),
('GPR_BACKWARDS_COMPATIBILITY_MODE', 1),)
('GPR_BACKWARDS_COMPATIBILITY_MODE', 1), ('HAVE_CONFIG_H', 1),)
if "win32" in sys.platform:
DEFINE_MACROS += (('OPENSSL_WINDOWS', 1), ('WIN32_LEAN_AND_MEAN', 1),)
if '64bit' in platform.architecture()[0]:
Expand Down
Loading

0 comments on commit d790dd6

Please sign in to comment.