diff options
author | Craig Tiller <craig.tiller@gmail.com> | 2015-07-08 15:31:57 -0700 |
---|---|---|
committer | Craig Tiller <craig.tiller@gmail.com> | 2015-07-08 15:31:57 -0700 |
commit | ba334e951b830c5f31934ecbf202125481180767 (patch) | |
tree | 986b5b09b4c411057073b5f7d5c68775c0cdc10d | |
parent | 97fc6a3f3f6e3bbb39b6fda1444bc533deb8803d (diff) | |
parent | aa9b3ac5c70d43207de79be6b4151b2e01ffb6f8 (diff) |
Merge github.com:grpc/grpc into simpler-cq
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | src/core/channel/client_channel.c | 2 | ||||
-rw-r--r-- | src/core/json/json.h | 2 | ||||
-rw-r--r-- | src/node/binding.gyp | 57 | ||||
-rw-r--r-- | src/node/package.json | 2 | ||||
-rw-r--r-- | src/objective-c/tests/Podfile | 1 | ||||
-rw-r--r-- | src/ruby/ext/grpc/extconf.rb | 75 | ||||
-rw-r--r-- | src/ruby/ext/grpc/rb_server.c | 6 | ||||
-rwxr-xr-x | tools/run_tests/build_ruby.sh | 2 | ||||
-rwxr-xr-x | tools/run_tests/jobset.py | 2 |
10 files changed, 99 insertions, 56 deletions
@@ -5744,7 +5744,7 @@ FD_CONSERVATION_POSIX_TEST_SRC = \ FD_CONSERVATION_POSIX_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(FD_CONSERVATION_POSIX_TEST_SRC)))) ifeq ($(NO_SECURE),true) -# You can't build secure targets if you don't have OpenSSL with ALPN. +# You can't build secure targets if you don't have OpenSSL. $(BINDIR)/$(CONFIG)/fd_conservation_posix_test: openssl_dep_error @@ -7078,7 +7078,7 @@ MULTIPLE_SERVER_QUEUES_TEST_SRC = \ MULTIPLE_SERVER_QUEUES_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(MULTIPLE_SERVER_QUEUES_TEST_SRC)))) ifeq ($(NO_SECURE),true) -# You can't build secure targets if you don't have OpenSSL with ALPN. +# You can't build secure targets if you don't have OpenSSL. $(BINDIR)/$(CONFIG)/multiple_server_queues_test: openssl_dep_error @@ -7542,7 +7542,7 @@ URI_PARSER_TEST_SRC = \ URI_PARSER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(URI_PARSER_TEST_SRC)))) ifeq ($(NO_SECURE),true) -# You can't build secure targets if you don't have OpenSSL with ALPN. +# You can't build secure targets if you don't have OpenSSL. $(BINDIR)/$(CONFIG)/uri_parser_test: openssl_dep_error diff --git a/src/core/channel/client_channel.c b/src/core/channel/client_channel.c index 871e970eb8..f890f99237 100644 --- a/src/core/channel/client_channel.c +++ b/src/core/channel/client_channel.c @@ -427,7 +427,7 @@ static void cc_on_config_changed(void *arg, int iomgr_success) { GRPC_RESOLVER_REF(resolver, "channel-next"); gpr_mu_unlock(&chand->mu_config); GRPC_CHANNEL_INTERNAL_REF(chand->master, "resolver"); - grpc_resolver_next(chand->resolver, &chand->incoming_configuration, + grpc_resolver_next(resolver, &chand->incoming_configuration, &chand->on_config_changed); GRPC_RESOLVER_UNREF(resolver, "channel-next"); } else { diff --git a/src/core/json/json.h b/src/core/json/json.h index b78b42a5b2..cac18ad885 100644 --- a/src/core/json/json.h +++ b/src/core/json/json.h @@ -53,7 +53,7 @@ typedef struct grpc_json { } grpc_json; /* The next two functions are going to parse the input string, and - * destroy it in the process, in order to use its space to store + * modify it in the process, in order to use its space to store * all of the keys and values for the returned object tree. * * They assume UTF-8 input stream, and will output UTF-8 encoded diff --git a/src/node/binding.gyp b/src/node/binding.gyp index 83f72fabca..6ba233388a 100644 --- a/src/node/binding.gyp +++ b/src/node/binding.gyp @@ -10,20 +10,54 @@ '-pthread', '-pedantic', '-g', - '-zdefs' + '-zdefs', '-Werror' ], 'ldflags': [ '-g' ], - 'link_settings': { - 'libraries': [ - '-lpthread', - '-lgrpc', - '-lgpr' - ] - }, "conditions": [ + ['OS != "win"', { + 'variables': { + 'pkg_config_grpc': '<!(pkg-config --exists grpc >/dev/null 2>&1 && echo true || echo false)' + }, + 'conditions': [ + ['pkg_config_grpc == "true"', { + 'link_settings': { + 'libraries': [ + '<!@(pkg-config --libs-only-l --static grpc)' + ] + }, + 'cflags': [ + '<!@(pkg-config --cflags grpc)' + ], + 'libraries': [ + '<!@(pkg-config --libs-only-L --static grpc)' + ], + 'ldflags': [ + '<!@(pkg-config --libs-only-other --static grpc)' + ] + }, { + 'link_settings': { + 'libraries': [ + '-lpthread', + '-lgrpc', + '-lgpr' + ], + }, + 'conditions':[ + ['OS != "mac"', { + 'link_settings': { + 'libraries': [ + '-lrt' + ] + } + }] + ] + } + ] + ] + }], ['OS == "mac"', { 'xcode_settings': { 'MACOSX_DEPLOYMENT_TARGET': '10.9', @@ -32,13 +66,6 @@ '-stdlib=libc++' ] } - }], - ['OS != "mac"', { - 'link_settings': { - 'libraries': [ - '-lrt' - ] - } }] ], "target_name": "grpc", diff --git a/src/node/package.json b/src/node/package.json index 7d4a493af4..6b545705e1 100644 --- a/src/node/package.json +++ b/src/node/package.json @@ -27,7 +27,7 @@ "bindings": "^1.2.0", "lodash": "^3.9.3", "nan": "^1.5.0", - "protobufjs": "dcodeIO/ProtoBuf.js" + "protobufjs": "^4.0.0" }, "devDependencies": { "async": "^0.9.0", diff --git a/src/objective-c/tests/Podfile b/src/objective-c/tests/Podfile index 026868db12..2aa837f764 100644 --- a/src/objective-c/tests/Podfile +++ b/src/objective-c/tests/Podfile @@ -1,6 +1,7 @@ source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' +pod 'Protobuf', :path => "../../../third_party/protobuf" pod 'gRPC', :path => "../../.." pod 'RemoteTest', :path => "../generated_libraries/RemoteTestClient" pod 'RouteGuide', :path => "../generated_libraries/RouteGuideClient" diff --git a/src/ruby/ext/grpc/extconf.rb b/src/ruby/ext/grpc/extconf.rb index 6dd0234489..7972272e2d 100644 --- a/src/ruby/ext/grpc/extconf.rb +++ b/src/ruby/ext/grpc/extconf.rb @@ -54,44 +54,55 @@ LIB_DIRS = [ LIBDIR ] -# Check to see if GRPC_ROOT is defined or available -grpc_root = ENV['GRPC_ROOT'] -if grpc_root.nil? - r = File.expand_path(File.join(File.dirname(__FILE__), '../../../..')) - grpc_root = r if File.exist?(File.join(r, 'include/grpc/grpc.h')) -end - -# When grpc_root is available attempt to build the grpc core. -unless grpc_root.nil? - grpc_config = ENV['GRPC_CONFIG'] || 'opt' - if ENV.key?('GRPC_LIB_DIR') - grpc_lib_dir = File.join(grpc_root, ENV['GRPC_LIB_DIR']) - else - grpc_lib_dir = File.join(File.join(grpc_root, 'libs'), grpc_config) - end - unless File.exist?(File.join(grpc_lib_dir, 'libgrpc.a')) - system("make -C #{grpc_root} static_c CONFIG=#{grpc_config}") +def check_grpc_root + grpc_root = ENV['GRPC_ROOT'] + if grpc_root.nil? + r = File.expand_path(File.join(File.dirname(__FILE__), '../../../..')) + grpc_root = r if File.exist?(File.join(r, 'include/grpc/grpc.h')) end - HEADER_DIRS.unshift File.join(grpc_root, 'include') - LIB_DIRS.unshift grpc_lib_dir + grpc_root end -def crash(msg) - print(" extconf failure: #{msg}\n") - exit 1 -end +grpc_pkg_config = system('pkg-config --exists grpc') + +if grpc_pkg_config + $CFLAGS << ' ' + `pkg-config --static --cflags grpc`.strip + ' ' + $LDFLAGS << ' ' + `pkg-config --static --libs grpc`.strip + ' ' +else + dir_config('grpc', HEADER_DIRS, LIB_DIRS) + fail 'libdl not found' unless have_library('dl', 'dlopen') + fail 'zlib not found' unless have_library('z', 'inflate') + begin + fail 'Fail' unless have_library('gpr', 'gpr_now') + fail 'Fail' unless have_library('grpc', 'grpc_channel_destroy') + rescue + # Check to see if GRPC_ROOT is defined or available + grpc_root = check_grpc_root -dir_config('grpc', HEADER_DIRS, LIB_DIRS) + # Stop if there is still no grpc_root + exit 1 if grpc_root.nil? -$CFLAGS << ' -Wno-implicit-function-declaration ' -$CFLAGS << ' -Wno-pointer-sign ' -$CFLAGS << ' -Wno-return-type ' + grpc_config = ENV['GRPC_CONFIG'] || 'opt' + if ENV.key?('GRPC_LIB_DIR') + grpc_lib_dir = File.join(grpc_root, ENV['GRPC_LIB_DIR']) + else + grpc_lib_dir = File.join(File.join(grpc_root, 'libs'), grpc_config) + end + unless File.exist?(File.join(grpc_lib_dir, 'libgrpc.a')) + print "Building internal gRPC\n" + system("make -C #{grpc_root} static_c CONFIG=#{grpc_config}") + end + $CFLAGS << ' -I' + File.join(grpc_root, 'include') + $LDFLAGS << ' -L' + grpc_lib_dir + raise 'gpr not found' unless have_library('gpr', 'gpr_now') + raise 'grpc not found' unless have_library('grpc', 'grpc_channel_destroy') + end +end + +$CFLAGS << ' -std=c99 ' $CFLAGS << ' -Wall ' +$CFLAGS << ' -Wextra ' $CFLAGS << ' -pedantic ' +$CFLAGS << ' -Werror ' -$LDFLAGS << ' -lgrpc -lgpr -lz -ldl' - -crash('need grpc lib') unless have_library('grpc', 'grpc_channel_destroy') -have_library('grpc', 'grpc_channel_destroy') -crash('need gpr lib') unless have_library('gpr', 'gpr_now') create_makefile('grpc/grpc') diff --git a/src/ruby/ext/grpc/rb_server.c b/src/ruby/ext/grpc/rb_server.c index 9c0d24bf8f..bed3b26850 100644 --- a/src/ruby/ext/grpc/rb_server.c +++ b/src/ruby/ext/grpc/rb_server.c @@ -68,8 +68,12 @@ static void grpc_rb_server_free(void *p) { /* Deletes the wrapped object if the mark object is Qnil, which indicates that no other object is the actual owner. */ + /* grpc_server_shutdown does not exist. Change this to something that does + or delete it */ if (svr->wrapped != NULL && svr->mark == Qnil) { - grpc_server_shutdown(svr->wrapped); + // grpc_server_shutdown(svr->wrapped); + // Aborting to indicate a bug + abort(); grpc_server_destroy(svr->wrapped); } diff --git a/tools/run_tests/build_ruby.sh b/tools/run_tests/build_ruby.sh index de96413bc1..b6c4e32b7e 100755 --- a/tools/run_tests/build_ruby.sh +++ b/tools/run_tests/build_ruby.sh @@ -31,7 +31,7 @@ set -ex -export CONFIG=${CONFIG:-opt} +export GRPC_CONFIG=${CONFIG:-opt} # change to grpc's ruby directory cd $(dirname $0)/../../src/ruby diff --git a/tools/run_tests/jobset.py b/tools/run_tests/jobset.py index 8694b8f6bd..baa126ba5f 100755 --- a/tools/run_tests/jobset.py +++ b/tools/run_tests/jobset.py @@ -95,7 +95,7 @@ def message(tag, msg, explanatory_text=None, do_newline=False): return message.old_tag = tag message.old_msg = msg - if platform.system() == 'Windows': + if platform.system() == 'Windows' or not sys.stdout.isatty(): if explanatory_text: print explanatory_text print '%s: %s' % (tag, msg) |