aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2016-02-08 08:49:50 -0800
committerGravatar Vijay Pai <vpai@google.com>2016-02-08 08:49:50 -0800
commit4d9d4abc4973e35fad369c9cd6c8bc3624de73f2 (patch)
treecf2772262a6ebea41697e11eee96ed024ed55dbd
parentbedf57fe8c323c2e26a2ad64e29521a353343a6b (diff)
parentd2ae3c02593b4fca82bf64413f705142778fc338 (diff)
Merge branch 'master' into cpp_races
-rwxr-xr-xRakefile22
-rw-r--r--examples/objective-c/helloworld/main.m2
-rw-r--r--setup.py2
-rw-r--r--src/objective-c/GRPCClient/GRPCCall+ChannelArg.h (renamed from src/objective-c/GRPCClient/private/GRPCUnsecuredChannel.h)16
-rw-r--r--src/objective-c/GRPCClient/GRPCCall+ChannelArg.m (renamed from src/objective-c/GRPCClient/private/GRPCUnsecuredChannel.m)23
-rw-r--r--src/objective-c/GRPCClient/private/GRPCChannel.h45
-rw-r--r--src/objective-c/GRPCClient/private/GRPCChannel.m166
-rw-r--r--src/objective-c/GRPCClient/private/GRPCHost.h1
-rw-r--r--src/objective-c/GRPCClient/private/GRPCHost.m31
-rw-r--r--src/objective-c/GRPCClient/private/GRPCSecureChannel.h55
-rw-r--r--src/objective-c/GRPCClient/private/GRPCSecureChannel.m118
-rw-r--r--src/python/grpcio/commands.py2
-rw-r--r--src/python/grpcio/grpc/_cython/imports.generated.c36
-rw-r--r--src/python/grpcio/grpc/_cython/imports.generated.h58
-rw-r--r--src/ruby/ext/grpc/extconf.rb3
-rw-r--r--src/ruby/ext/grpc/rb_channel.c2
-rw-r--r--src/ruby/ext/grpc/rb_server_credentials.c2
-rw-r--r--src/ruby/lib/grpc/version.rb2
-rw-r--r--templates/src/ruby/lib/grpc/version.rb.template35
-rwxr-xr-xtest/distrib/python/run_distrib_test.sh20
-rw-r--r--third_party/rake-compiler-dock/Dockerfile21
-rw-r--r--tools/distrib/build_ruby_environment_macos.sh61
-rw-r--r--tools/dockerfile/distribtest/csharp_centos7_x64/Dockerfile1
-rw-r--r--tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile2
-rw-r--r--tools/dockerfile/distribtest/csharp_jessie_x86/Dockerfile2
-rw-r--r--tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile2
-rw-r--r--tools/dockerfile/distribtest/csharp_ubuntu1504_x64/Dockerfile2
-rw-r--r--tools/dockerfile/distribtest/csharp_ubuntu1510_x64/Dockerfile2
-rw-r--r--tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile2
-rw-r--r--tools/dockerfile/distribtest/csharp_wheezy_x64/Dockerfile2
-rw-r--r--tools/dockerfile/distribtest/node_centos7_x64/Dockerfile1
-rw-r--r--tools/dockerfile/distribtest/node_jessie_x64/Dockerfile2
-rw-r--r--tools/dockerfile/distribtest/node_jessie_x86/Dockerfile2
-rw-r--r--tools/dockerfile/distribtest/node_ubuntu1204_x64/Dockerfile2
-rw-r--r--tools/dockerfile/distribtest/node_ubuntu1404_x64/Dockerfile2
-rw-r--r--tools/dockerfile/distribtest/node_ubuntu1504_x64/Dockerfile2
-rw-r--r--tools/dockerfile/distribtest/node_ubuntu1510_x64/Dockerfile2
-rw-r--r--tools/dockerfile/distribtest/node_ubuntu1604_x64/Dockerfile2
-rw-r--r--tools/dockerfile/distribtest/python_arch_x64/Dockerfile6
-rw-r--r--tools/dockerfile/distribtest/python_centos6_x64/Dockerfile3
-rw-r--r--tools/dockerfile/distribtest/python_centos7_x64/Dockerfile1
-rw-r--r--tools/dockerfile/distribtest/python_fedora20_x64/Dockerfile7
-rw-r--r--tools/dockerfile/distribtest/python_fedora21_x64/Dockerfile7
-rw-r--r--tools/dockerfile/distribtest/python_fedora22_x64/Dockerfile7
-rw-r--r--tools/dockerfile/distribtest/python_fedora23_x64/Dockerfile7
-rw-r--r--tools/dockerfile/distribtest/python_jessie_x64/Dockerfile4
-rw-r--r--tools/dockerfile/distribtest/python_jessie_x86/Dockerfile4
-rw-r--r--tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile2
-rw-r--r--tools/dockerfile/distribtest/python_ubuntu1204_x64/Dockerfile6
-rw-r--r--tools/dockerfile/distribtest/python_ubuntu1404_x64/Dockerfile6
-rw-r--r--tools/dockerfile/distribtest/python_ubuntu1504_x64/Dockerfile6
-rw-r--r--tools/dockerfile/distribtest/python_ubuntu1510_x64/Dockerfile6
-rw-r--r--tools/dockerfile/distribtest/python_ubuntu1604_x64/Dockerfile6
-rw-r--r--tools/dockerfile/distribtest/python_wheezy_x64/Dockerfile4
-rw-r--r--tools/dockerfile/distribtest/ruby_centos6_x64/Dockerfile2
-rw-r--r--tools/dockerfile/distribtest/ruby_centos7_x64/Dockerfile2
-rw-r--r--tools/dockerfile/distribtest/ruby_fedora20_x64/Dockerfile6
-rw-r--r--tools/dockerfile/distribtest/ruby_fedora21_x64/Dockerfile6
-rw-r--r--tools/dockerfile/distribtest/ruby_fedora22_x64/Dockerfile6
-rw-r--r--tools/dockerfile/distribtest/ruby_fedora23_x64/Dockerfile6
-rw-r--r--tools/dockerfile/distribtest/ruby_jessie_x64/Dockerfile5
-rw-r--r--tools/dockerfile/distribtest/ruby_jessie_x86/Dockerfile5
-rw-r--r--tools/dockerfile/distribtest/ruby_opensuse_x64/Dockerfile2
-rw-r--r--tools/dockerfile/distribtest/ruby_ubuntu1204_x64/Dockerfile5
-rw-r--r--tools/dockerfile/distribtest/ruby_ubuntu1404_x64/Dockerfile5
-rw-r--r--tools/dockerfile/distribtest/ruby_ubuntu1504_x64/Dockerfile5
-rw-r--r--tools/dockerfile/distribtest/ruby_ubuntu1510_x64/Dockerfile5
-rw-r--r--tools/dockerfile/distribtest/ruby_ubuntu1604_x64/Dockerfile5
-rw-r--r--tools/dockerfile/distribtest/ruby_wheezy_x64/Dockerfile5
-rwxr-xr-xtools/jenkins/build_and_run_docker.sh3
-rwxr-xr-xtools/jenkins/build_artifacts.sh6
-rwxr-xr-xtools/jenkins/docker_run.sh16
-rwxr-xr-xtools/run_tests/build_artifact_python.sh10
-rwxr-xr-xtools/run_tests/build_artifact_ruby.sh32
-rw-r--r--tools/run_tests/distribtest_targets.py1
75 files changed, 531 insertions, 442 deletions
diff --git a/Rakefile b/Rakefile
index 3a30920fea..f208a24fd3 100755
--- a/Rakefile
+++ b/Rakefile
@@ -3,6 +3,7 @@ require 'rake/extensiontask'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
require 'bundler/gem_tasks'
+require 'fileutils'
load 'tools/distrib/docker_for_windows.rb'
@@ -23,7 +24,11 @@ Rake::ExtensionTask.new('grpc_c', spec) do |ext|
ext.ext_dir = File.join('src', 'ruby', 'ext', 'grpc')
ext.lib_dir = File.join('src', 'ruby', 'lib', 'grpc')
ext.cross_compile = true
- ext.cross_platform = ['x86-mingw32', 'x64-mingw32']
+ ext.cross_platform = [
+ 'x86-mingw32', 'x64-mingw32',
+ 'x86_64-linux', 'x86-linux',
+ 'universal-darwin'
+ ]
ext.cross_compiling do |spec|
spec.files = %w( etc/roots.pem grpc_c.32.ruby grpc_c.64.ruby )
spec.files += Dir.glob('src/ruby/bin/**/*')
@@ -91,11 +96,18 @@ task 'dlls' do
end
-desc 'Build the gem file under rake_compiler_dock'
-task 'gem:windows' do
+desc 'Build the native gem file under rake_compiler_dock'
+task 'gem:native' do
verbose = ENV['V'] || '0'
- docker_for_windows "bundle && rake cross native gem RUBY_CC_VERSION=2.3.0:2.2.2:2.1.6:2.0.0 V=#{verbose}"
+ if RUBY_PLATFORM =~ /darwin/
+ FileUtils.touch 'grpc_c.32.ruby'
+ FileUtils.touch 'grpc_c.64.ruby'
+ system "rake cross native gem RUBY_CC_VERSION=2.3.0:2.2.2:2.1.5:2.0.0 V=#{verbose}"
+ else
+ Rake::Task['dlls'].execute
+ docker_for_windows "bundle && rake cross native gem RUBY_CC_VERSION=2.3.0:2.2.2:2.1.5:2.0.0 V=#{verbose}"
+ end
end
# Define dependencies between the suites.
@@ -105,8 +117,6 @@ task 'suite:bidi' => 'suite:wrapper'
task 'suite:server' => 'suite:wrapper'
task 'suite:pb' => 'suite:server'
-task 'gem:windows' => 'dlls'
-
desc 'Compiles the gRPC extension then runs all the tests'
task all: ['suite:idiomatic', 'suite:bidi', 'suite:pb', 'suite:server']
task default: :all
diff --git a/examples/objective-c/helloworld/main.m b/examples/objective-c/helloworld/main.m
index a62f8362a2..755dce33df 100644
--- a/examples/objective-c/helloworld/main.m
+++ b/examples/objective-c/helloworld/main.m
@@ -34,6 +34,7 @@
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
+#import <GRPCClient/GRPCCall+ChannelArg.h>
#import <GRPCClient/GRPCCall+Tests.h>
#import <HelloWorld/Helloworld.pbrpc.h>
@@ -42,6 +43,7 @@ static NSString * const kHostAddress = @"localhost:50051";
int main(int argc, char * argv[]) {
@autoreleasepool {
[GRPCCall useInsecureConnectionsForHost:kHostAddress];
+ [GRPCCall setUserAgentPrefix:@"HelloWorld/1.0" forHost:kHostAddress];
HLWGreeter *client = [[HLWGreeter alloc] initWithHost:kHostAddress];
diff --git a/setup.py b/setup.py
index 720e4f75f6..80828a3b4a 100644
--- a/setup.py
+++ b/setup.py
@@ -118,6 +118,8 @@ def cython_extensions(package_names, module_names, extra_sources, include_dirs,
sources=[module_file] + extra_sources,
include_dirs=include_dirs, libraries=libraries,
define_macros=define_macros,
+ extra_compile_args=list(CFLAGS),
+ extra_link_args=list(LDFLAGS),
) for (module_name, module_file) in zip(module_names, module_files)
]
if build_with_cython:
diff --git a/src/objective-c/GRPCClient/private/GRPCUnsecuredChannel.h b/src/objective-c/GRPCClient/GRPCCall+ChannelArg.h
index 8528be44c0..bd6b064f16 100644
--- a/src/objective-c/GRPCClient/private/GRPCUnsecuredChannel.h
+++ b/src/objective-c/GRPCClient/GRPCCall+ChannelArg.h
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,9 +30,17 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
+#import "GRPCCall.h"
-#import "GRPCChannel.h"
+/**
+ * Methods to configure GRPC channel options.
+ */
+@interface GRPCCall (ChannelArg)
+
+/**
+ * Use the provided @c userAgentPrefix at the beginning of the HTTP User Agent string for all calls
+ * to the specified @c host.
+ */
++ (void)setUserAgentPrefix:(NSString *)userAgentPrefix forHost:(NSString *)host;
-@interface GRPCUnsecuredChannel : GRPCChannel
-- (instancetype)initWithHost:(NSString *)host NS_DESIGNATED_INITIALIZER;
@end
diff --git a/src/objective-c/GRPCClient/private/GRPCUnsecuredChannel.m b/src/objective-c/GRPCClient/GRPCCall+ChannelArg.m
index 15b6ffc75c..5f9932d86d 100644
--- a/src/objective-c/GRPCClient/private/GRPCUnsecuredChannel.m
+++ b/src/objective-c/GRPCClient/GRPCCall+ChannelArg.m
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -31,20 +31,19 @@
*
*/
-#import "GRPCUnsecuredChannel.h"
+#import "GRPCCall+ChannelArg.h"
-#include <grpc/grpc.h>
+#import "private/GRPCHost.h"
-@implementation GRPCUnsecuredChannel
+@implementation GRPCCall (ChannelArg)
-- (instancetype)initWithHost:(NSString *)host {
- return (self = [super initWithChannel:grpc_insecure_channel_create(host.UTF8String, NULL, NULL)]);
++ (void)setUserAgentPrefix:(NSString *)userAgentPrefix forHost:(NSString *)host {
+ if (!host) {
+ [NSException raise:NSInvalidArgumentException
+ format:@"host and userAgentPrefix must be provided."];
+ }
+ GRPCHost *hostConfig = [GRPCHost hostWithAddress:host];
+ hostConfig.userAgentPrefix = userAgentPrefix;
}
-// TODO(jcanizales): GRPCSecureChannel and GRPCUnsecuredChannel are just convenience initializers
-// for GRPCChannel. Move them into GRPCChannel, which will make the following unnecessary.
-- (instancetype)initWithChannel:(grpc_channel *)unmanagedChannel {
- [NSException raise:NSInternalInconsistencyException format:@"use the other initializer"];
- return [self initWithHost:nil]; // silence warnings
-}
@end
diff --git a/src/objective-c/GRPCClient/private/GRPCChannel.h b/src/objective-c/GRPCClient/private/GRPCChannel.h
index e2d19d506a..1888dea1b4 100644
--- a/src/objective-c/GRPCClient/private/GRPCChannel.h
+++ b/src/objective-c/GRPCClient/private/GRPCChannel.h
@@ -33,18 +33,51 @@
#import <Foundation/Foundation.h>
-struct grpc_channel;
+#include <grpc/grpc.h>
+
+struct grpc_channel_credentials;
+
/**
* Each separate instance of this class represents at least one TCP connection to the provided host.
- * Create them using one of the subclasses |GRPCSecureChannel| and |GRPCUnsecuredChannel|.
*/
@interface GRPCChannel : NSObject
-@property(nonatomic, readonly) struct grpc_channel *unmanagedChannel;
+
+@property(nonatomic, readonly, nonnull) struct grpc_channel *unmanagedChannel;
+
+- (nullable instancetype)init NS_UNAVAILABLE;
/**
- * This initializer takes ownership of the passed channel, and will destroy it when this object is
- * deallocated. It's illegal to pass the same grpc_channel to two different GRPCChannel objects.
+ * Creates a secure channel to the specified @c host using default credentials and channel
+ * arguments. If certificates could not be found to create a secure channel, then @c nil is
+ * returned.
*/
-- (instancetype)initWithChannel:(struct grpc_channel *)unmanagedChannel NS_DESIGNATED_INITIALIZER;
++ (nullable GRPCChannel *)secureChannelWithHost:(nonnull NSString *)host;
+
+/**
+ * Creates a secure channel to the specified @c host using the specified @c pathToCertificates and
+ * @c channelArgs. Only in tests should @c pathToCertificates be nil or
+ * @c GRPC_SSL_TARGET_NAME_OVERRIDE_ARG channel arg be set. Passing nil for @c pathToCertificates
+ * results in using the default root certificates distributed with the library. If certificates
+ * could not be found in any case, then @c nil is returned.
+ */
++ (nullable GRPCChannel *)secureChannelWithHost:(nonnull NSString *)host
+ pathToCertificates:(nullable NSString *)pathToCertificates
+ channelArgs:(nullable NSDictionary *)channelArgs;
+
+
+/**
+ * Creates a secure channel to the specified @c host using the specified @c credentials and
+ * @c channelArgs. Only in tests should @c GRPC_SSL_TARGET_NAME_OVERRIDE_ARG channel arg be set.
+ */
++ (nonnull GRPCChannel *)secureChannelWithHost:(nonnull NSString *)host
+ credentials:(nonnull struct grpc_channel_credentials *)credentials
+ channelArgs:(nullable NSDictionary *)channelArgs;
+
+/**
+ * Creates an insecure channel to the specified @c host using the specified @c channelArgs.
+ */
++ (nonnull GRPCChannel *)insecureChannelWithHost:(nonnull NSString *)host
+ channelArgs:(nullable NSDictionary *)channelArgs;
+
@end
diff --git a/src/objective-c/GRPCClient/private/GRPCChannel.m b/src/objective-c/GRPCClient/private/GRPCChannel.m
index 4366e63320..7a676060c1 100644
--- a/src/objective-c/GRPCClient/private/GRPCChannel.m
+++ b/src/objective-c/GRPCClient/private/GRPCChannel.m
@@ -33,22 +33,114 @@
#import "GRPCChannel.h"
-#include <grpc/grpc.h>
+#include <grpc/grpc_security.h>
+#include <grpc/support/alloc.h>
+#include <grpc/support/log.h>
+#include <grpc/support/string_util.h>
-@implementation GRPCChannel
+/**
+ * Returns @c grpc_channel_credentials from the specified @c path. If the file at the path could not
+ * be read then NULL is returned. If NULL is returned, @c errorPtr may not be NULL if there are
+ * details available describing what went wrong.
+ */
+static grpc_channel_credentials *CertificatesAtPath(NSString *path, NSError **errorPtr) {
+ // Files in PEM format can have non-ASCII characters in their comments (e.g. for the name of the
+ // issuer). Load them as UTF8 and produce an ASCII equivalent.
+ NSString *contentInUTF8 = [NSString stringWithContentsOfFile:path
+ encoding:NSUTF8StringEncoding
+ error:errorPtr];
+ NSData *contentInASCII = [contentInUTF8 dataUsingEncoding:NSASCIIStringEncoding
+ allowLossyConversion:YES];
+ if (!contentInASCII.bytes) {
+ // Passing NULL to grpc_ssl_credentials_create produces behavior we don't want, so return.
+ return NULL;
+ }
+ return grpc_ssl_credentials_create(contentInASCII.bytes, NULL, NULL);
+}
+
+void freeChannelArgs(grpc_channel_args *channel_args) {
+ for (size_t i = 0; i < channel_args->num_args; ++i) {
+ grpc_arg *arg = &channel_args->args[i];
+ gpr_free(arg->key);
+ if (arg->type == GRPC_ARG_STRING) {
+ gpr_free(arg->value.string);
+ }
+ }
+ gpr_free(channel_args);
+}
+
+/**
+ * Allocates a @c grpc_channel_args and populates it with the options specified in the
+ * @c dictionary. Keys must be @c NSString. If the value responds to @c @selector(UTF8String) then
+ * it will be mapped to @c GRPC_ARG_STRING. If not, it will be mapped to @c GRPC_ARG_INTEGER if the
+ * value responds to @c @selector(intValue). Otherwise, an exception will be raised. The caller of
+ * this function is responsible for calling @c freeChannelArgs on a non-NULL returned value.
+ */
+grpc_channel_args * buildChannelArgs(NSDictionary *dictionary) {
+ if (!dictionary) {
+ return NULL;
+ }
-- (instancetype)init {
- return [self initWithChannel:NULL];
+ NSArray *keys = [dictionary allKeys];
+ NSUInteger argCount = [keys count];
+
+ grpc_channel_args *channelArgs = gpr_malloc(sizeof(grpc_channel_args));
+ channelArgs->num_args = argCount;
+ channelArgs->args = gpr_malloc(argCount * sizeof(grpc_arg));
+
+ // TODO(kriswuollett) Check that keys adhere to GRPC core library requirements
+
+ for (NSUInteger i = 0; i < argCount; ++i) {
+ grpc_arg *arg = &channelArgs->args[i];
+ arg->key = gpr_strdup([keys[i] UTF8String]);
+
+ id value = dictionary[keys[i]];
+ if ([value respondsToSelector:@selector(UTF8String)]) {
+ arg->type = GRPC_ARG_STRING;
+ arg->value.string = gpr_strdup([value UTF8String]);
+ } else if ([value respondsToSelector:@selector(intValue)]) {
+ arg->type = GRPC_ARG_INTEGER;
+ arg->value.integer = [value intValue];
+ } else {
+ [NSException raise:NSInvalidArgumentException
+ format:@"Invalid value type: %@", [value class]];
+ }
+ }
+
+ return channelArgs;
+}
+
+@implementation GRPCChannel {
+ // Retain arguments to channel_create because they may not be used on the thread that invoked
+ // the channel_create function.
+ NSString *_host;
+ grpc_channel_args *_channelArgs;
}
-// Designated initializer
-- (instancetype)initWithChannel:(grpc_channel *)unmanagedChannel {
- if (!unmanagedChannel) {
+
+- (instancetype)initWithHost:(NSString *)host
+ secure:(BOOL)secure
+ credentials:(struct grpc_channel_credentials *)credentials
+ channelArgs:(NSDictionary *)channelArgs {
+ if (!host) {
+ [NSException raise:NSInvalidArgumentException format:@"host argument missing"];
+ }
+
+ if (secure && !credentials) {
return nil;
}
- if ((self = [super init])) {
- _unmanagedChannel = unmanagedChannel;
+
+ if (self = [super init]) {
+ _channelArgs = buildChannelArgs(channelArgs);
+ _host = [host copy];
+ if (secure) {
+ _unmanagedChannel = grpc_secure_channel_create(credentials, _host.UTF8String, _channelArgs,
+ NULL);
+ } else {
+ _unmanagedChannel = grpc_insecure_channel_create(_host.UTF8String, _channelArgs, NULL);
+ }
}
+
return self;
}
@@ -56,5 +148,61 @@
// TODO(jcanizales): Be sure to add a test with a server that closes the connection prematurely,
// as in the past that made this call to crash.
grpc_channel_destroy(_unmanagedChannel);
+ freeChannelArgs(_channelArgs);
}
+
++ (GRPCChannel *)secureChannelWithHost:(NSString *)host {
+ return [[GRPCChannel alloc] initWithHost:host secure:YES credentials:NULL channelArgs:NULL];
+}
+
++ (GRPCChannel *)secureChannelWithHost:(NSString *)host
+ pathToCertificates:(NSString *)path
+ channelArgs:(NSDictionary *)channelArgs {
+ // Load default SSL certificates once.
+ static grpc_channel_credentials *kDefaultCertificates;
+ static dispatch_once_t loading;
+ dispatch_once(&loading, ^{
+ NSString *defaultPath = @"gRPCCertificates.bundle/roots"; // .pem
+ // Do not use NSBundle.mainBundle, as it's nil for tests of library projects.
+ NSBundle *bundle = [NSBundle bundleForClass:self.class];
+ NSString *path = [bundle pathForResource:defaultPath ofType:@"pem"];
+ NSError *error;
+ kDefaultCertificates = CertificatesAtPath(path, &error);
+ NSAssert(kDefaultCertificates, @"Could not read %@/%@.pem. This file, with the root "
+ "certificates, is needed to establish secure (TLS) connections. Because the file is "
+ "distributed with the gRPC library, this error is usually a sign that the library "
+ "wasn't configured correctly for your project. Error: %@",
+ bundle.bundlePath, defaultPath, error);
+ });
+
+ //TODO(jcanizales): Add NSError** parameter to the initializer.
+ grpc_channel_credentials *certificates = path
+ ? CertificatesAtPath(path, NULL)
+ : kDefaultCertificates;
+
+ return [[GRPCChannel alloc] initWithHost:host
+ secure:YES
+ credentials:certificates
+ channelArgs:channelArgs];
+}
+
+
++ (GRPCChannel *)secureChannelWithHost:(NSString *)host
+ credentials:(struct grpc_channel_credentials *)credentials
+ channelArgs:(NSDictionary *)channelArgs {
+ return [[GRPCChannel alloc] initWithHost:host
+ secure:YES
+ credentials:credentials
+ channelArgs:channelArgs];
+
+}
+
++ (GRPCChannel *)insecureChannelWithHost:(NSString *)host
+ channelArgs:(NSDictionary *)channelArgs {
+ return [[GRPCChannel alloc] initWithHost:host
+ secure:NO
+ credentials:NULL
+ channelArgs:channelArgs];
+}
+
@end
diff --git a/src/objective-c/GRPCClient/private/GRPCHost.h b/src/objective-c/GRPCClient/private/GRPCHost.h
index 6b4f98746d..69a115e88c 100644
--- a/src/objective-c/GRPCClient/private/GRPCHost.h
+++ b/src/objective-c/GRPCClient/private/GRPCHost.h
@@ -39,6 +39,7 @@ struct grpc_call;
@interface GRPCHost : NSObject
@property(nonatomic, readonly) NSString *address;
+@property(nonatomic, copy) NSString *userAgentPrefix;
/** The following properties should only be modified for testing: */
diff --git a/src/objective-c/GRPCClient/private/GRPCHost.m b/src/objective-c/GRPCClient/private/GRPCHost.m
index a8cd3a0e74..f750841a44 100644
--- a/src/objective-c/GRPCClient/private/GRPCHost.m
+++ b/src/objective-c/GRPCClient/private/GRPCHost.m
@@ -34,11 +34,15 @@
#import "GRPCHost.h"
#include <grpc/grpc.h>
+#import <GRPCClient/GRPCCall+ChannelArg.h>
#import "GRPCChannel.h"
#import "GRPCCompletionQueue.h"
-#import "GRPCSecureChannel.h"
-#import "GRPCUnsecuredChannel.h"
+#import "NSDictionary+GRPC.h"
+
+// TODO(jcanizales): Generate the version in a standalone header, from templates. Like
+// templates/src/core/surface/version.c.template .
+#define GRPC_OBJC_VERSION_STRING @"0.13.0"
@interface GRPCHost ()
// TODO(mlumish): Investigate whether caching channels with strong links is a good idea.
@@ -106,13 +110,28 @@
- (GRPCChannel *)channel {
// Create it lazily, because we don't want to open a connection just because someone is
// configuring a host.
+
if (!_channel) {
+ NSMutableDictionary *args = [NSMutableDictionary dictionary];
+
+ // TODO(jcanizales): Add OS and device information (see
+ // https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#user-agents ).
+ NSString *userAgent = @"grpc-objc/" GRPC_OBJC_VERSION_STRING;
+ if (_userAgentPrefix) {
+ userAgent = [@[_userAgentPrefix, userAgent] componentsJoinedByString:@" "];
+ }
+ args[@GRPC_ARG_PRIMARY_USER_AGENT_STRING] = userAgent;
+
if (_secure) {
- _channel = [[GRPCSecureChannel alloc] initWithHost:_address
- pathToCertificates:_pathToCertificates
- hostNameOverride:_hostNameOverride];
+ if (_hostNameOverride) {
+ args[@GRPC_SSL_TARGET_NAME_OVERRIDE_ARG] = _hostNameOverride;
+ }
+
+ _channel = [GRPCChannel secureChannelWithHost:_address
+ pathToCertificates:_pathToCertificates
+ channelArgs:args];
} else {
- _channel = [[GRPCUnsecuredChannel alloc] initWithHost:_address];
+ _channel = [GRPCChannel insecureChannelWithHost:_address channelArgs:args];
}
}
return _channel;
diff --git a/src/objective-c/GRPCClient/private/GRPCSecureChannel.h b/src/objective-c/GRPCClient/private/GRPCSecureChannel.h
deleted file mode 100644
index b82b9fe35a..0000000000
--- a/src/objective-c/GRPCClient/private/GRPCSecureChannel.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- *
- * Copyright 2015, Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#include <grpc/grpc.h>
-
-#import "GRPCChannel.h"
-
-struct grpc_channel_credentials;
-
-@interface GRPCSecureChannel : GRPCChannel
-- (instancetype)initWithHost:(NSString *)host;
-
-/**
- * Only in tests shouldn't pathToCertificates or hostNameOverride be nil. Passing nil for
- * pathToCertificates results in using the default root certificates distributed with the library.
- */
-- (instancetype)initWithHost:(NSString *)host
- pathToCertificates:(NSString *)path
- hostNameOverride:(NSString *)hostNameOverride;
-
-/** The passed arguments aren't required to be valid beyond the invocation of this initializer. */
-- (instancetype)initWithHost:(NSString *)host
- credentials:(struct grpc_channel_credentials *)credentials
- args:(grpc_channel_args *)args NS_DESIGNATED_INITIALIZER;
-@end
diff --git a/src/objective-c/GRPCClient/private/GRPCSecureChannel.m b/src/objective-c/GRPCClient/private/GRPCSecureChannel.m
deleted file mode 100644
index a573c171e9..0000000000
--- a/src/objective-c/GRPCClient/private/GRPCSecureChannel.m
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- *
- * Copyright 2015, Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- */
-
-#import "GRPCSecureChannel.h"
-
-#include <grpc/grpc_security.h>
-
-// Returns NULL if the file at path couldn't be read. In that case, if errorPtr isn't NULL,
-// *errorPtr will be an object describing what went wrong.
-static grpc_channel_credentials *CertificatesAtPath(NSString *path, NSError **errorPtr) {
- // Files in PEM format can have non-ASCII characters in their comments (e.g. for the name of the
- // issuer). Load them as UTF8 and produce an ASCII equivalent.
- NSString *contentInUTF8 = [NSString stringWithContentsOfFile:path
- encoding:NSUTF8StringEncoding
- error:errorPtr];
- NSData *contentInASCII = [contentInUTF8 dataUsingEncoding:NSASCIIStringEncoding
- allowLossyConversion:YES];
- if (!contentInASCII.bytes) {
- // Passing NULL to grpc_ssl_credentials_create produces behavior we don't want, so return.
- return NULL;
- }
- return grpc_ssl_credentials_create(contentInASCII.bytes, NULL, NULL);
-}
-
-@implementation GRPCSecureChannel
-
-- (instancetype)initWithHost:(NSString *)host {
- return [self initWithHost:host pathToCertificates:nil hostNameOverride:nil];
-}
-
-- (instancetype)initWithHost:(NSString *)host
- pathToCertificates:(NSString *)path
- hostNameOverride:(NSString *)hostNameOverride {
- // Load default SSL certificates once.
- static grpc_channel_credentials *kDefaultCertificates;
- static dispatch_once_t loading;
- dispatch_once(&loading, ^{
- NSString *defaultPath = @"gRPCCertificates.bundle/roots"; // .pem
- // Do not use NSBundle.mainBundle, as it's nil for tests of library projects.
- NSBundle *bundle = [NSBundle bundleForClass:self.class];
- NSString *path = [bundle pathForResource:defaultPath ofType:@"pem"];
- NSError *error;
- kDefaultCertificates = CertificatesAtPath(path, &error);
- NSAssert(kDefaultCertificates, @"Could not read %@/%@.pem. This file, with the root "
- "certificates, is needed to establish secure (TLS) connections. Because the file is "
- "distributed with the gRPC library, this error is usually a sign that the library "
- "wasn't configured correctly for your project. Error: %@",
- bundle.bundlePath, defaultPath, error);
- });
-
- //TODO(jcanizales): Add NSError** parameter to the initializer.
- grpc_channel_credentials *certificates = path
- ? CertificatesAtPath(path, NULL)
- : kDefaultCertificates;
- if (!certificates) {
- return nil;
- }
-
- // Ritual to pass the SSL host name override to the C library.
- grpc_channel_args channelArgs;
- grpc_arg nameOverrideArg;
- channelArgs.num_args = 1;
- channelArgs.args = &nameOverrideArg;
- nameOverrideArg.type = GRPC_ARG_STRING;
- nameOverrideArg.key = GRPC_SSL_TARGET_NAME_OVERRIDE_ARG;
- // Cast const away. Hope C gRPC doesn't modify it!
- nameOverrideArg.value.string = (char *) hostNameOverride.UTF8String;
- grpc_channel_args *args = hostNameOverride ? &channelArgs : NULL;
-
- return [self initWithHost:host credentials:certificates args:args];
-}
-
-- (instancetype)initWithHost:(NSString *)host
- credentials:(grpc_channel_credentials *)credentials
- args:(grpc_channel_args *)args {
- return (self = [super
- initWithChannel:grpc_secure_channel_create(
- credentials, host.UTF8String, args, NULL)]);
-}
-
-// TODO(jcanizales): GRPCSecureChannel and GRPCUnsecuredChannel are just convenience initializers
-// for GRPCChannel. Move them into GRPCChannel, which will make the following unnecessary.
-- (instancetype)initWithChannel:(grpc_channel *)unmanagedChannel {
- [NSException raise:NSInternalInconsistencyException format:@"use another initializer"];
- return [self initWithHost:nil]; // silence warnings
-}
-
-@end
diff --git a/src/python/grpcio/commands.py b/src/python/grpcio/commands.py
index 490d0f07b3..31bd00e94e 100644
--- a/src/python/grpcio/commands.py
+++ b/src/python/grpcio/commands.py
@@ -135,7 +135,7 @@ class Install(install.install, EggNameMixin):
def initialize_options(self):
install.install.initialize_options(self)
- self.use_grpc_custom_bdist = False
+ self.use_grpc_custom_bdist = bool(int(os.environ.get('GRPC_PYTHON_USE_CUSTOM_BDIST', '1')))
def finalize_options(self):
install.install.finalize_options(self)
diff --git a/src/python/grpcio/grpc/_cython/imports.generated.c b/src/python/grpcio/grpc/_cython/imports.generated.c
index b818f3491b..817303c8a4 100644
--- a/src/python/grpcio/grpc/_cython/imports.generated.c
+++ b/src/python/grpcio/grpc/_cython/imports.generated.c
@@ -41,7 +41,14 @@ census_initialize_type census_initialize_import;
census_shutdown_type census_shutdown_import;
census_supported_type census_supported_import;
census_enabled_type census_enabled_import;
-census_context_serialize_type census_context_serialize_import;
+census_context_create_type census_context_create_import;
+census_context_destroy_type census_context_destroy_import;
+census_context_get_status_type census_context_get_status_import;
+census_context_initialize_iterator_type census_context_initialize_iterator_import;
+census_context_next_tag_type census_context_next_tag_import;
+census_context_get_tag_type census_context_get_tag_import;
+census_context_encode_type census_context_encode_import;
+census_context_decode_type census_context_decode_import;
census_trace_mask_type census_trace_mask_import;
census_set_trace_mask_type census_set_trace_mask_import;
census_start_rpc_op_timestamp_type census_start_rpc_op_timestamp_import;
@@ -54,15 +61,6 @@ census_trace_print_type census_trace_print_import;
census_trace_scan_start_type census_trace_scan_start_import;
census_get_trace_record_type census_get_trace_record_import;
census_trace_scan_end_type census_trace_scan_end_import;
-census_tag_set_create_type census_tag_set_create_import;
-census_tag_set_destroy_type census_tag_set_destroy_import;
-census_tag_set_get_create_status_type census_tag_set_get_create_status_import;
-census_tag_set_initialize_iterator_type census_tag_set_initialize_iterator_import;
-census_tag_set_next_tag_type census_tag_set_next_tag_import;
-census_tag_set_get_tag_by_key_type census_tag_set_get_tag_by_key_import;
-census_tag_set_encode_type census_tag_set_encode_import;
-census_tag_set_decode_type census_tag_set_decode_import;
-census_context_tag_set_type census_context_tag_set_import;
census_record_values_type census_record_values_import;
census_view_create_type census_view_create_import;
census_view_delete_type census_view_delete_import;
@@ -303,7 +301,14 @@ void pygrpc_load_imports(HMODULE library) {
census_shutdown_import = (census_shutdown_type) GetProcAddress(library, "census_shutdown");
census_supported_import = (census_supported_type) GetProcAddress(library, "census_supported");
census_enabled_import = (census_enabled_type) GetProcAddress(library, "census_enabled");
- census_context_serialize_import = (census_context_serialize_type) GetProcAddress(library, "census_context_serialize");
+ census_context_create_import = (census_context_create_type) GetProcAddress(library, "census_context_create");
+ census_context_destroy_import = (census_context_destroy_type) GetProcAddress(library, "census_context_destroy");
+ census_context_get_status_import = (census_context_get_status_type) GetProcAddress(library, "census_context_get_status");
+ census_context_initialize_iterator_import = (census_context_initialize_iterator_type) GetProcAddress(library, "census_context_initialize_iterator");
+ census_context_next_tag_import = (census_context_next_tag_type) GetProcAddress(library, "census_context_next_tag");
+ census_context_get_tag_import = (census_context_get_tag_type) GetProcAddress(library, "census_context_get_tag");
+ census_context_encode_import = (census_context_encode_type) GetProcAddress(library, "census_context_encode");
+ census_context_decode_import = (census_context_decode_type) GetProcAddress(library, "census_context_decode");
census_trace_mask_import = (census_trace_mask_type) GetProcAddress(library, "census_trace_mask");
census_set_trace_mask_import = (census_set_trace_mask_type) GetProcAddress(library, "census_set_trace_mask");
census_start_rpc_op_timestamp_import = (census_start_rpc_op_timestamp_type) GetProcAddress(library, "census_start_rpc_op_timestamp");
@@ -316,15 +321,6 @@ void pygrpc_load_imports(HMODULE library) {
census_trace_scan_start_import = (census_trace_scan_start_type) GetProcAddress(library, "census_trace_scan_start");
census_get_trace_record_import = (census_get_trace_record_type) GetProcAddress(library, "census_get_trace_record");
census_trace_scan_end_import = (census_trace_scan_end_type) GetProcAddress(library, "census_trace_scan_end");
- census_tag_set_create_import = (census_tag_set_create_type) GetProcAddress(library, "census_tag_set_create");
- census_tag_set_destroy_import = (census_tag_set_destroy_type) GetProcAddress(library, "census_tag_set_destroy");
- census_tag_set_get_create_status_import = (census_tag_set_get_create_status_type) GetProcAddress(library, "census_tag_set_get_create_status");
- census_tag_set_initialize_iterator_import = (census_tag_set_initialize_iterator_type) GetProcAddress(library, "census_tag_set_initialize_iterator");
- census_tag_set_next_tag_import = (census_tag_set_next_tag_type) GetProcAddress(library, "census_tag_set_next_tag");
- census_tag_set_get_tag_by_key_import = (census_tag_set_get_tag_by_key_type) GetProcAddress(library, "census_tag_set_get_tag_by_key");
- census_tag_set_encode_import = (census_tag_set_encode_type) GetProcAddress(library, "census_tag_set_encode");
- census_tag_set_decode_import = (census_tag_set_decode_type) GetProcAddress(library, "census_tag_set_decode");
- census_context_tag_set_import = (census_context_tag_set_type) GetProcAddress(library, "census_context_tag_set");
census_record_values_import = (census_record_values_type) GetProcAddress(library, "census_record_values");
census_view_create_import = (census_view_create_type) GetProcAddress(library, "census_view_create");
census_view_delete_import = (census_view_delete_type) GetProcAddress(library, "census_view_delete");
diff --git a/src/python/grpcio/grpc/_cython/imports.generated.h b/src/python/grpcio/grpc/_cython/imports.generated.h
index 2a8a910055..f85d416db8 100644
--- a/src/python/grpcio/grpc/_cython/imports.generated.h
+++ b/src/python/grpcio/grpc/_cython/imports.generated.h
@@ -73,9 +73,30 @@ extern census_supported_type census_supported_import;
typedef int(*census_enabled_type)(void);
extern census_enabled_type census_enabled_import;
#define census_enabled census_enabled_import
-typedef size_t(*census_context_serialize_type)(const census_context *context, char *buffer, size_t buf_size);
-extern census_context_serialize_type census_context_serialize_import;
-#define census_context_serialize census_context_serialize_import
+typedef census_context *(*census_context_create_type)(const census_context *base, const census_tag *tags, int ntags, census_context_status const **status);
+extern census_context_create_type census_context_create_import;
+#define census_context_create census_context_create_import
+typedef void(*census_context_destroy_type)(census_context *context);
+extern census_context_destroy_type census_context_destroy_import;
+#define census_context_destroy census_context_destroy_import
+typedef const census_context_status *(*census_context_get_status_type)(const census_context *context);
+extern census_context_get_status_type census_context_get_status_import;
+#define census_context_get_status census_context_get_status_import
+typedef void(*census_context_initialize_iterator_type)(const census_context *context, census_context_iterator *iterator);
+extern census_context_initialize_iterator_type census_context_initialize_iterator_import;
+#define census_context_initialize_iterator census_context_initialize_iterator_import
+typedef int(*census_context_next_tag_type)(census_context_iterator *iterator, census_tag *tag);
+extern census_context_next_tag_type census_context_next_tag_import;
+#define census_context_next_tag census_context_next_tag_import
+typedef int(*census_context_get_tag_type)(const census_context *context, const char *key, census_tag *tag);
+extern census_context_get_tag_type census_context_get_tag_import;
+#define census_context_get_tag census_context_get_tag_import
+typedef char *(*census_context_encode_type)(const census_context *context, char *buffer, size_t buf_size, size_t *print_buf_size, size_t *bin_buf_size);
+extern census_context_encode_type census_context_encode_import;
+#define census_context_encode census_context_encode_import
+typedef census_context *(*census_context_decode_type)(const char *buffer, size_t size, const char *bin_buffer, size_t bin_size);
+extern census_context_decode_type census_context_decode_import;
+#define census_context_decode census_context_decode_import
typedef int(*census_trace_mask_type)(const census_context *context);
extern census_trace_mask_type census_trace_mask_import;
#define census_trace_mask census_trace_mask_import
@@ -112,37 +133,10 @@ extern census_get_trace_record_type census_get_trace_record_import;
typedef void(*census_trace_scan_end_type)();
extern census_trace_scan_end_type census_trace_scan_end_import;
#define census_trace_scan_end census_trace_scan_end_import
-typedef census_tag_set *(*census_tag_set_create_type)(const census_tag_set *base, const census_tag *tags, int ntags, census_tag_set_create_status const **status);
-extern census_tag_set_create_type census_tag_set_create_import;
-#define census_tag_set_create census_tag_set_create_import
-typedef void(*census_tag_set_destroy_type)(census_tag_set *tags);
-extern census_tag_set_destroy_type census_tag_set_destroy_import;
-#define census_tag_set_destroy census_tag_set_destroy_import
-typedef const census_tag_set_create_status *(*census_tag_set_get_create_status_type)(const census_tag_set *tags);
-extern census_tag_set_get_create_status_type census_tag_set_get_create_status_import;
-#define census_tag_set_get_create_status census_tag_set_get_create_status_import
-typedef void(*census_tag_set_initialize_iterator_type)(const census_tag_set *tags, census_tag_set_iterator *iterator);
-extern census_tag_set_initialize_iterator_type census_tag_set_initialize_iterator_import;
-#define census_tag_set_initialize_iterator census_tag_set_initialize_iterator_import
-typedef int(*census_tag_set_next_tag_type)(census_tag_set_iterator *iterator, census_tag *tag);
-extern census_tag_set_next_tag_type census_tag_set_next_tag_import;
-#define census_tag_set_next_tag census_tag_set_next_tag_import
-typedef int(*census_tag_set_get_tag_by_key_type)(const census_tag_set *tags, const char *key, census_tag *tag);
-extern census_tag_set_get_tag_by_key_type census_tag_set_get_tag_by_key_import;
-#define census_tag_set_get_tag_by_key census_tag_set_get_tag_by_key_import
-typedef char *(*census_tag_set_encode_type)(const census_tag_set *tags, char *buffer, size_t buf_size, size_t *print_buf_size, size_t *bin_buf_size);
-extern census_tag_set_encode_type census_tag_set_encode_import;
-#define census_tag_set_encode census_tag_set_encode_import
-typedef census_tag_set *(*census_tag_set_decode_type)(const char *buffer, size_t size, const char *bin_buffer, size_t bin_size);
-extern census_tag_set_decode_type census_tag_set_decode_import;
-#define census_tag_set_decode census_tag_set_decode_import
-typedef census_tag_set *(*census_context_tag_set_type)(census_context *context);
-extern census_context_tag_set_type census_context_tag_set_import;
-#define census_context_tag_set census_context_tag_set_import
typedef void(*census_record_values_type)(census_context *context, census_value *values, size_t nvalues);
extern census_record_values_type census_record_values_import;
#define census_record_values census_record_values_import
-typedef census_view *(*census_view_create_type)(uint32_t metric_id, const census_tag_set *tags, const census_aggregation *aggregations, size_t naggregations);
+typedef census_view *(*census_view_create_type)(uint32_t metric_id, const census_context *tags, const census_aggregation *aggregations, size_t naggregations);
extern census_view_create_type census_view_create_import;
#define census_view_create census_view_create_import
typedef void(*census_view_delete_type)(census_view *view);
@@ -154,7 +148,7 @@ extern census_view_metric_type census_view_metric_import;
typedef size_t(*census_view_naggregations_type)(const census_view *view);
extern census_view_naggregations_type census_view_naggregations_import;
#define census_view_naggregations census_view_naggregations_import
-typedef const census_tag_set *(*census_view_tags_type)(const census_view *view);
+typedef const census_context *(*census_view_tags_type)(const census_view *view);
extern census_view_tags_type census_view_tags_import;
#define census_view_tags census_view_tags_import
typedef const census_aggregation *(*census_view_aggregrations_type)(const census_view *view);
diff --git a/src/ruby/ext/grpc/extconf.rb b/src/ruby/ext/grpc/extconf.rb
index 426a6e67a0..b7c6cb3d7e 100644
--- a/src/ruby/ext/grpc/extconf.rb
+++ b/src/ruby/ext/grpc/extconf.rb
@@ -66,6 +66,8 @@ else
grpc_lib_dir = File.join(grpc_root, 'libs', grpc_config)
end
+ENV['MACOSX_DEPLOYMENT_TARGET'] = '10.7'
+
unless File.exist?(File.join(grpc_lib_dir, 'libgrpc.a')) or windows
ENV['AR'] = RbConfig::CONFIG['AR'] + ' rcs'
ENV['CC'] = RbConfig::CONFIG['CC']
@@ -75,6 +77,7 @@ unless File.exist?(File.join(grpc_lib_dir, 'libgrpc.a')) or windows
ENV['EMBED_OPENSSL'] = 'true'
ENV['EMBED_ZLIB'] = 'true'
+ ENV['ARCH_FLAGS'] = RbConfig::CONFIG['ARCH_FLAG']
ENV['ARCH_FLAGS'] = '-arch i386 -arch x86_64' if RUBY_PLATFORM =~ /darwin/
output_dir = File.expand_path(RbConfig::CONFIG['topdir'])
diff --git a/src/ruby/ext/grpc/rb_channel.c b/src/ruby/ext/grpc/rb_channel.c
index d1e48753f2..0e6badbdaf 100644
--- a/src/ruby/ext/grpc/rb_channel.c
+++ b/src/ruby/ext/grpc/rb_channel.c
@@ -229,7 +229,7 @@ static VALUE grpc_rb_channel_watch_connectivity_state(VALUE self,
}
grpc_channel_watch_connectivity_state(
ch,
- NUM2LONG(last_state),
+ (grpc_connectivity_state)NUM2LONG(last_state),
grpc_rb_time_timeval(deadline, /* absolute time */ 0),
cq,
ROBJECT(tag));
diff --git a/src/ruby/ext/grpc/rb_server_credentials.c b/src/ruby/ext/grpc/rb_server_credentials.c
index f866aecd28..4ea59b6b27 100644
--- a/src/ruby/ext/grpc/rb_server_credentials.c
+++ b/src/ruby/ext/grpc/rb_server_credentials.c
@@ -177,7 +177,7 @@ static VALUE grpc_rb_server_credentials_init(VALUE self, VALUE pem_root_certs,
VALUE key = Qnil;
VALUE key_cert = Qnil;
int auth_client = 0;
- int num_key_certs = 0;
+ long num_key_certs = 0;
int i;
if (NIL_P(force_client_auth) ||
diff --git a/src/ruby/lib/grpc/version.rb b/src/ruby/lib/grpc/version.rb
index 956e0222df..89ff882916 100644
--- a/src/ruby/lib/grpc/version.rb
+++ b/src/ruby/lib/grpc/version.rb
@@ -29,5 +29,5 @@
# GRPC contains the General RPC module.
module GRPC
- VERSION = '0.12.0'
+ VERSION = '0.13.0.0'
end
diff --git a/templates/src/ruby/lib/grpc/version.rb.template b/templates/src/ruby/lib/grpc/version.rb.template
new file mode 100644
index 0000000000..4859d2f883
--- /dev/null
+++ b/templates/src/ruby/lib/grpc/version.rb.template
@@ -0,0 +1,35 @@
+%YAML 1.2
+--- |
+ # Copyright 2015-2016, Google Inc.
+ # All rights reserved.
+ #
+ # Redistribution and use in source and binary forms, with or without
+ # modification, are permitted provided that the following conditions are
+ # met:
+ #
+ # * Redistributions of source code must retain the above copyright
+ # notice, this list of conditions and the following disclaimer.
+ # * Redistributions in binary form must reproduce the above
+ # copyright notice, this list of conditions and the following disclaimer
+ # in the documentation and/or other materials provided with the
+ # distribution.
+ # * Neither the name of Google Inc. nor the names of its
+ # contributors may be used to endorse or promote products derived from
+ # this software without specific prior written permission.
+ #
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ # GRPC contains the General RPC module.
+ module GRPC
+ VERSION = '${settings.version.major}.${settings.version.minor}.${settings.version.micro}.${settings.version.build}'
+ end
diff --git a/test/distrib/python/run_distrib_test.sh b/test/distrib/python/run_distrib_test.sh
index a185bcbc26..08856ad388 100755
--- a/test/distrib/python/run_distrib_test.sh
+++ b/test/distrib/python/run_distrib_test.sh
@@ -42,17 +42,17 @@ then
exit 1
fi
-# TODO(jtattermusch): this shouldn't be required
-pip install --upgrade six
+PIP=pip2
+which $PIP || PIP=pip
+PYTHON=python2
+which $PYTHON || PYTHON=python
-# TODO(jtattermusch): if these don't get preinstalled, pip tries to install them
-# with --use-grpc-custom-bdist option, which obviously fails.
-pip install --upgrade enum34
-pip install --upgrade futures
+# TODO(jtattermusch): this shouldn't be required
+$PIP install --upgrade six
GRPC_PYTHON_BINARIES_REPOSITORY="${BDIST_DIR}" \
- pip install \
- "${SDIST_ARCHIVE}" \
- --install-option="--use-grpc-custom-bdist"
+ $PIP install \
+ "${SDIST_ARCHIVE}"
+
+$PYTHON distribtest.py
-python distribtest.py
diff --git a/third_party/rake-compiler-dock/Dockerfile b/third_party/rake-compiler-dock/Dockerfile
index 28623c3028..a8f5b8a116 100644
--- a/third_party/rake-compiler-dock/Dockerfile
+++ b/third_party/rake-compiler-dock/Dockerfile
@@ -1,7 +1,7 @@
FROM ubuntu:14.04
RUN apt-get -y update && \
- apt-get install -y curl git-core mingw-w64 xz-utils build-essential wget unzip
+ apt-get install -y curl git-core mingw-w64 xz-utils build-essential gcc-multilib wget unzip
RUN mkdir -p /opt/mingw && \
curl -SL http://downloads.sourceforge.net/mingw-w64/i686-w64-mingw32-gcc-4.7.2-release-linux64_rubenvb.tar.xz | \
@@ -103,12 +103,25 @@ RUN bash -c "rvm use 2.3.0 --default && \
export MAKE=\"make -j`nproc`\" CFLAGS='-s -O1 -fno-omit-frame-pointer -fno-fast-math' && \
rake-compiler cross-ruby VERSION=2.3.0 HOST=i686-w64-mingw32 && \
rake-compiler cross-ruby VERSION=2.3.0 HOST=x86_64-w64-mingw32 && \
+ rake-compiler cross-ruby VERSION=2.3.0 HOST=x86_64-linux-gnu && \
rake-compiler cross-ruby VERSION=2.2.2 HOST=i686-w64-mingw32 && \
rake-compiler cross-ruby VERSION=2.2.2 HOST=x86_64-w64-mingw32 && \
- rake-compiler cross-ruby VERSION=2.1.6 HOST=i686-w64-mingw32 && \
- rake-compiler cross-ruby VERSION=2.1.6 HOST=x86_64-w64-mingw32 && \
+ rake-compiler cross-ruby VERSION=2.2.2 HOST=x86_64-linux-gnu && \
+ rake-compiler cross-ruby VERSION=2.1.5 HOST=i686-w64-mingw32 && \
+ rake-compiler cross-ruby VERSION=2.1.5 HOST=x86_64-w64-mingw32 && \
+ rake-compiler cross-ruby VERSION=2.1.5 HOST=x86_64-linux-gnu && \
rake-compiler cross-ruby VERSION=2.0.0-p645 HOST=i686-w64-mingw32 && \
rake-compiler cross-ruby VERSION=2.0.0-p645 HOST=x86_64-w64-mingw32 && \
+ rake-compiler cross-ruby VERSION=2.0.0-p645 HOST=x86_64-linux-gnu && \
+ rm -rf ~/.rake-compiler/tmp/builds ~/.rake-compiler/sources && \
+ find /usr/local/rvm -type d -print0 | sudo xargs -0 chmod g+sw "
+
+RUN bash -c "rvm use 2.3.0 --default && \
+ export MAKE=\"make -j`nproc`\" CFLAGS='-m32 -s -O1 -fno-omit-frame-pointer -fno-fast-math' LDFLAGS='-m32' && \
+ rake-compiler cross-ruby VERSION=2.3.0 HOST=i686-linux-gnu && \
+ rake-compiler cross-ruby VERSION=2.2.2 HOST=i686-linux-gnu && \
+ rake-compiler cross-ruby VERSION=2.1.5 HOST=i686-linux-gnu && \
+ rake-compiler cross-ruby VERSION=2.0.0-p645 HOST=i686-linux-gnu && \
rm -rf ~/.rake-compiler/tmp/builds ~/.rake-compiler/sources && \
find /usr/local/rvm -type d -print0 | sudo xargs -0 chmod g+sw "
@@ -151,6 +164,6 @@ RUN cp /tmp/build/runas /usr/local/bin/
# Install sudoers configuration
RUN cp /tmp/build/sudoers /etc/sudoers.d/rake-compiler-dock
-ENV RUBY_CC_VERSION 2.3.0:2.2.2:2.1.6:2.0.0
+ENV RUBY_CC_VERSION 2.3.0:2.2.2:2.1.5:2.0.0
CMD bash
diff --git a/tools/distrib/build_ruby_environment_macos.sh b/tools/distrib/build_ruby_environment_macos.sh
new file mode 100644
index 0000000000..ff3a388eaf
--- /dev/null
+++ b/tools/distrib/build_ruby_environment_macos.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+# Copyright 2015-2016, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+set -ex
+
+rm -rf ~/.rake-compiler
+
+CROSS_RUBY=`mktemp tmpfile.XXXXXXXX`
+
+curl https://raw.githubusercontent.com/rake-compiler/rake-compiler/v0.9.5/tasks/bin/cross-ruby.rake > $CROSS_RUBY
+
+patch $CROSS_RUBY << EOF
+--- cross-ruby.rake 2016-02-05 16:26:53.000000000 -0800
++++ cross-ruby.rake.patched 2016-02-05 16:27:33.000000000 -0800
+@@ -133,7 +133,8 @@
+ "--host=#{MINGW_HOST}",
+ "--target=#{MINGW_TARGET}",
+ "--build=#{RUBY_BUILD}",
+- '--enable-shared',
++ '--enable-static',
++ '--disable-shared',
+ '--disable-install-doc',
+ '--without-tk',
+ '--without-tcl'
+EOF
+
+MAKE="make -j8"
+
+for v in 2.3.0 2.2.2 2.1.5 2.0.0-p645 ; do
+ rake -f $CROSS_RUBY cross-ruby VERSION=$v HOST=x86_64-darwin11
+done
+
+sed 's/x86_64-darwin-11/universal-darwin/' ~/.rake-compiler/config.yml > $CROSS_RUBY
+mv $CROSS_RUBY ~/.rake-compiler/config.yml
diff --git a/tools/dockerfile/distribtest/csharp_centos7_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_centos7_x64/Dockerfile
index 17e9698904..03b5b364f8 100644
--- a/tools/dockerfile/distribtest/csharp_centos7_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/csharp_centos7_x64/Dockerfile
@@ -33,6 +33,5 @@ RUN rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E03
RUN yum-config-manager --add-repo http://download.mono-project.com/repo/centos/
RUN yum install -y mono
-RUN yum install -y git
RUN yum install -y unzip
RUN yum install -y nuget
diff --git a/tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile
index 840ecf0fc2..1cadba3b7b 100644
--- a/tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile
@@ -40,4 +40,4 @@ RUN apt-get update && apt-get install -y \
ca-certificates-mono \
nuget
-RUN apt-get update && apt-get install -y git unzip
+RUN apt-get update && apt-get install -y unzip
diff --git a/tools/dockerfile/distribtest/csharp_jessie_x86/Dockerfile b/tools/dockerfile/distribtest/csharp_jessie_x86/Dockerfile
index 3a50da4936..be962828c2 100644
--- a/tools/dockerfile/distribtest/csharp_jessie_x86/Dockerfile
+++ b/tools/dockerfile/distribtest/csharp_jessie_x86/Dockerfile
@@ -40,4 +40,4 @@ RUN apt-get update && apt-get install -y \
ca-certificates-mono \
nuget
-RUN apt-get update && apt-get install -y git unzip
+RUN apt-get update && apt-get install -y unzip
diff --git a/tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile
index 901c981acb..3d04d032b5 100644
--- a/tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile
@@ -37,4 +37,4 @@ RUN apt-get update && apt-get install -y \
ca-certificates-mono \
nuget
-RUN apt-get update && apt-get install -y git unzip
+RUN apt-get update && apt-get install -y unzip
diff --git a/tools/dockerfile/distribtest/csharp_ubuntu1504_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_ubuntu1504_x64/Dockerfile
index 1b8d454681..5eec570491 100644
--- a/tools/dockerfile/distribtest/csharp_ubuntu1504_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/csharp_ubuntu1504_x64/Dockerfile
@@ -37,4 +37,4 @@ RUN apt-get update && apt-get install -y \
ca-certificates-mono \
nuget
-RUN apt-get update && apt-get install -y git unzip
+RUN apt-get update && apt-get install -y unzip
diff --git a/tools/dockerfile/distribtest/csharp_ubuntu1510_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_ubuntu1510_x64/Dockerfile
index a6c26a4b9e..a6d60fb4b9 100644
--- a/tools/dockerfile/distribtest/csharp_ubuntu1510_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/csharp_ubuntu1510_x64/Dockerfile
@@ -37,4 +37,4 @@ RUN apt-get update && apt-get install -y \
ca-certificates-mono \
nuget
-RUN apt-get update && apt-get install -y git unzip
+RUN apt-get update && apt-get install -y unzip
diff --git a/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile
index c6a8634937..61472704d7 100644
--- a/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile
@@ -34,4 +34,4 @@ RUN apt-get update && apt-get install -y \
ca-certificates-mono \
nuget
-RUN apt-get update && apt-get install -y git unzip
+RUN apt-get update && apt-get install -y unzip
diff --git a/tools/dockerfile/distribtest/csharp_wheezy_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_wheezy_x64/Dockerfile
index dd865e8bbc..9039c3c509 100644
--- a/tools/dockerfile/distribtest/csharp_wheezy_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/csharp_wheezy_x64/Dockerfile
@@ -29,4 +29,4 @@
FROM mono:4.2.2.30
-RUN apt-get update && apt-get install -y git unzip
+RUN apt-get update && apt-get install -y unzip
diff --git a/tools/dockerfile/distribtest/node_centos7_x64/Dockerfile b/tools/dockerfile/distribtest/node_centos7_x64/Dockerfile
index 9c1f5ee729..f6e1664086 100644
--- a/tools/dockerfile/distribtest/node_centos7_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/node_centos7_x64/Dockerfile
@@ -29,7 +29,6 @@
FROM centos:7
-RUN yum install -y git
RUN yum install -y curl
# Install nvm
diff --git a/tools/dockerfile/distribtest/node_jessie_x64/Dockerfile b/tools/dockerfile/distribtest/node_jessie_x64/Dockerfile
index 69a071500e..4ca5e86563 100644
--- a/tools/dockerfile/distribtest/node_jessie_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/node_jessie_x64/Dockerfile
@@ -29,7 +29,7 @@
FROM debian:jessie
-RUN apt-get update && apt-get install -y curl git
+RUN apt-get update && apt-get install -y curl
# Install nvm
RUN touch .profile
diff --git a/tools/dockerfile/distribtest/node_jessie_x86/Dockerfile b/tools/dockerfile/distribtest/node_jessie_x86/Dockerfile
index 173c70360d..bd40ab2b4c 100644
--- a/tools/dockerfile/distribtest/node_jessie_x86/Dockerfile
+++ b/tools/dockerfile/distribtest/node_jessie_x86/Dockerfile
@@ -29,7 +29,7 @@
FROM 32bit/debian:jessie
-RUN apt-get update && apt-get install -y curl git
+RUN apt-get update && apt-get install -y git
# Install nvm
RUN touch .profile
diff --git a/tools/dockerfile/distribtest/node_ubuntu1204_x64/Dockerfile b/tools/dockerfile/distribtest/node_ubuntu1204_x64/Dockerfile
index c53a4aa305..0134dc964e 100644
--- a/tools/dockerfile/distribtest/node_ubuntu1204_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/node_ubuntu1204_x64/Dockerfile
@@ -29,7 +29,7 @@
FROM ubuntu:12.04
-RUN apt-get update && apt-get install -y curl git
+RUN apt-get update && apt-get install -y curl
# Install nvm
RUN touch .profile
diff --git a/tools/dockerfile/distribtest/node_ubuntu1404_x64/Dockerfile b/tools/dockerfile/distribtest/node_ubuntu1404_x64/Dockerfile
index 8fe6ae1f33..0fae447946 100644
--- a/tools/dockerfile/distribtest/node_ubuntu1404_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/node_ubuntu1404_x64/Dockerfile
@@ -29,7 +29,7 @@
FROM ubuntu:14.04
-RUN apt-get update && apt-get install -y curl git
+RUN apt-get update && apt-get install -y curl
# Install nvm
RUN touch .profile
diff --git a/tools/dockerfile/distribtest/node_ubuntu1504_x64/Dockerfile b/tools/dockerfile/distribtest/node_ubuntu1504_x64/Dockerfile
index 013c2a0c72..55da46c3be 100644
--- a/tools/dockerfile/distribtest/node_ubuntu1504_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/node_ubuntu1504_x64/Dockerfile
@@ -29,7 +29,7 @@
FROM ubuntu:15.04
-RUN apt-get update && apt-get install -y curl git
+RUN apt-get update && apt-get install -y curl
# Install nvm
RUN touch .profile
diff --git a/tools/dockerfile/distribtest/node_ubuntu1510_x64/Dockerfile b/tools/dockerfile/distribtest/node_ubuntu1510_x64/Dockerfile
index 43b3ae2738..c050cab7d3 100644
--- a/tools/dockerfile/distribtest/node_ubuntu1510_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/node_ubuntu1510_x64/Dockerfile
@@ -29,7 +29,7 @@
FROM ubuntu:15.10
-RUN apt-get update && apt-get install -y curl git
+RUN apt-get update && apt-get install -y curl
# Install nvm
RUN touch .profile
diff --git a/tools/dockerfile/distribtest/node_ubuntu1604_x64/Dockerfile b/tools/dockerfile/distribtest/node_ubuntu1604_x64/Dockerfile
index 3eae75475c..ab9e8a32e3 100644
--- a/tools/dockerfile/distribtest/node_ubuntu1604_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/node_ubuntu1604_x64/Dockerfile
@@ -29,7 +29,7 @@
FROM ubuntu:16.04
-RUN apt-get update && apt-get install -y curl git
+RUN apt-get update && apt-get install -y curl
# Install nvm
RUN touch .profile
diff --git a/tools/dockerfile/distribtest/python_arch_x64/Dockerfile b/tools/dockerfile/distribtest/python_arch_x64/Dockerfile
index 4d10e240c6..c4f2431080 100644
--- a/tools/dockerfile/distribtest/python_arch_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_arch_x64/Dockerfile
@@ -30,7 +30,7 @@
FROM base/archlinux
RUN pacman --noconfirm -Syy
-RUN pacman --noconfirm -S git
-RUN pacman --noconfirm -S python
-RUN pacman --noconfirm -S python-pip
+RUN pacman --noconfirm -S openssl
+RUN pacman --noconfirm -S python2
+RUN pacman --noconfirm -S python2-pip
diff --git a/tools/dockerfile/distribtest/python_centos6_x64/Dockerfile b/tools/dockerfile/distribtest/python_centos6_x64/Dockerfile
index 683686c6db..99306bb403 100644
--- a/tools/dockerfile/distribtest/python_centos6_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_centos6_x64/Dockerfile
@@ -29,9 +29,10 @@
FROM centos:6
-RUN yum install -y git
RUN yum install -y python
RUN rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
RUN yum install -y python-pip
+RUN pip install --upgrade pip
+
diff --git a/tools/dockerfile/distribtest/python_centos7_x64/Dockerfile b/tools/dockerfile/distribtest/python_centos7_x64/Dockerfile
index 6b70f65f10..114957b573 100644
--- a/tools/dockerfile/distribtest/python_centos7_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_centos7_x64/Dockerfile
@@ -29,7 +29,6 @@
FROM centos:7
-RUN yum install -y git
RUN yum install -y python
RUN yum install -y epel-release
RUN yum install -y python-pip
diff --git a/tools/dockerfile/distribtest/python_fedora20_x64/Dockerfile b/tools/dockerfile/distribtest/python_fedora20_x64/Dockerfile
index 1c91594363..d58036410f 100644
--- a/tools/dockerfile/distribtest/python_fedora20_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_fedora20_x64/Dockerfile
@@ -29,9 +29,4 @@
FROM fedora:20
-RUN yum clean all
-RUN yum update -y
-RUN yum install -y git
-RUN yum install -y python
-RUN yum install -y python-pip
-
+RUN yum clean all && yum update -y && yum install -y python python-pip
diff --git a/tools/dockerfile/distribtest/python_fedora21_x64/Dockerfile b/tools/dockerfile/distribtest/python_fedora21_x64/Dockerfile
index e35de109ea..b44fcff7e3 100644
--- a/tools/dockerfile/distribtest/python_fedora21_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_fedora21_x64/Dockerfile
@@ -29,9 +29,4 @@
FROM fedora:21
-RUN yum clean all
-RUN yum update -y
-RUN yum install -y git
-RUN yum install -y python
-RUN yum install -y python-pip
-
+RUN yum clean all && yum update -y && yum install -y python python-pip
diff --git a/tools/dockerfile/distribtest/python_fedora22_x64/Dockerfile b/tools/dockerfile/distribtest/python_fedora22_x64/Dockerfile
index 69c3b541d3..c6415946c3 100644
--- a/tools/dockerfile/distribtest/python_fedora22_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_fedora22_x64/Dockerfile
@@ -29,9 +29,4 @@
FROM fedora:22
-RUN yum clean all
-RUN yum update -y
-RUN yum install -y git
-RUN yum install -y python
-RUN yum install -y python-pip
-
+RUN yum clean all && yum update -y && yum install -y python python-pip
diff --git a/tools/dockerfile/distribtest/python_fedora23_x64/Dockerfile b/tools/dockerfile/distribtest/python_fedora23_x64/Dockerfile
index 74639a3118..6c834d2bc2 100644
--- a/tools/dockerfile/distribtest/python_fedora23_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_fedora23_x64/Dockerfile
@@ -29,9 +29,4 @@
FROM fedora:23
-RUN yum clean all
-RUN yum update -y
-RUN yum install -y git
-RUN yum install -y python
-RUN yum install -y python-pip
-
+RUN yum clean all && yum update -y && yum install -y python python-pip
diff --git a/tools/dockerfile/distribtest/python_jessie_x64/Dockerfile b/tools/dockerfile/distribtest/python_jessie_x64/Dockerfile
index 3d511e267a..5778d604c8 100644
--- a/tools/dockerfile/distribtest/python_jessie_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_jessie_x64/Dockerfile
@@ -29,6 +29,4 @@
FROM debian:jessie
-RUN apt-get update
-RUN apt-get install -y git python python-pip
-
+RUN apt-get update && apt-get install -y python python-pip
diff --git a/tools/dockerfile/distribtest/python_jessie_x86/Dockerfile b/tools/dockerfile/distribtest/python_jessie_x86/Dockerfile
index 035d56b655..cb6ec22d0a 100644
--- a/tools/dockerfile/distribtest/python_jessie_x86/Dockerfile
+++ b/tools/dockerfile/distribtest/python_jessie_x86/Dockerfile
@@ -29,6 +29,4 @@
FROM 32bit/debian:jessie
-RUN apt-get update
-RUN apt-get install -y git python python-pip
-
+RUN apt-get update && apt-get install -y python python-pip
diff --git a/tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile b/tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile
index 032beb97e5..417d9e0293 100644
--- a/tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile
@@ -29,7 +29,5 @@
FROM opensuse:42.1
-RUN zypper --non-interactive install git
RUN zypper --non-interactive install python
RUN zypper --non-interactive install python-pip
-
diff --git a/tools/dockerfile/distribtest/python_ubuntu1204_x64/Dockerfile b/tools/dockerfile/distribtest/python_ubuntu1204_x64/Dockerfile
index 9dbf90f511..a48ce0eeef 100644
--- a/tools/dockerfile/distribtest/python_ubuntu1204_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_ubuntu1204_x64/Dockerfile
@@ -29,8 +29,4 @@
FROM ubuntu:12.04
-RUN apt-get update -y
-RUN apt-get install -y git
-RUN apt-get install -y python
-RUN apt-get install -y python-pip
-
+RUN apt-get update -y && apt-get install -y python python-pip
diff --git a/tools/dockerfile/distribtest/python_ubuntu1404_x64/Dockerfile b/tools/dockerfile/distribtest/python_ubuntu1404_x64/Dockerfile
index 3b366a9bb4..18dbfd4657 100644
--- a/tools/dockerfile/distribtest/python_ubuntu1404_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_ubuntu1404_x64/Dockerfile
@@ -29,8 +29,4 @@
FROM ubuntu:14.04
-RUN apt-get update -y
-RUN apt-get install -y git
-RUN apt-get install -y python
-RUN apt-get install -y python-pip
-
+RUN apt-get update -y && apt-get install -y python python-pip
diff --git a/tools/dockerfile/distribtest/python_ubuntu1504_x64/Dockerfile b/tools/dockerfile/distribtest/python_ubuntu1504_x64/Dockerfile
index de90b5b7e2..444a54d14b 100644
--- a/tools/dockerfile/distribtest/python_ubuntu1504_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_ubuntu1504_x64/Dockerfile
@@ -29,8 +29,4 @@
FROM ubuntu:15.04
-RUN apt-get update -y
-RUN apt-get install -y git
-RUN apt-get install -y python
-RUN apt-get install -y python-pip
-
+RUN apt-get update -y && apt-get install -y python python-pip
diff --git a/tools/dockerfile/distribtest/python_ubuntu1510_x64/Dockerfile b/tools/dockerfile/distribtest/python_ubuntu1510_x64/Dockerfile
index d10e04aacc..245ffb9413 100644
--- a/tools/dockerfile/distribtest/python_ubuntu1510_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_ubuntu1510_x64/Dockerfile
@@ -29,8 +29,4 @@
FROM ubuntu:15.10
-RUN apt-get update -y
-RUN apt-get install -y git
-RUN apt-get install -y python
-RUN apt-get install -y python-pip
-
+RUN apt-get update -y && apt-get install -y python python-pip
diff --git a/tools/dockerfile/distribtest/python_ubuntu1604_x64/Dockerfile b/tools/dockerfile/distribtest/python_ubuntu1604_x64/Dockerfile
index bc56285a3d..a1ac3051ba 100644
--- a/tools/dockerfile/distribtest/python_ubuntu1604_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_ubuntu1604_x64/Dockerfile
@@ -29,8 +29,4 @@
FROM ubuntu:16.04
-RUN apt-get update -y
-RUN apt-get install -y git
-RUN apt-get install -y python
-RUN apt-get install -y python-pip
-
+RUN apt-get update -y && apt-get install -y python python-pip
diff --git a/tools/dockerfile/distribtest/python_wheezy_x64/Dockerfile b/tools/dockerfile/distribtest/python_wheezy_x64/Dockerfile
index 895dd96747..46353b92d6 100644
--- a/tools/dockerfile/distribtest/python_wheezy_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_wheezy_x64/Dockerfile
@@ -29,6 +29,4 @@
FROM debian:wheezy
-RUN apt-get update
-RUN apt-get install -y git python python-pip
-
+RUN apt-get update -y && apt-get install -y python python-pip
diff --git a/tools/dockerfile/distribtest/ruby_centos6_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_centos6_x64/Dockerfile
index 28a5c4ad71..fd2cf63a59 100644
--- a/tools/dockerfile/distribtest/ruby_centos6_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_centos6_x64/Dockerfile
@@ -29,6 +29,4 @@
FROM centos:6
-RUN yum install -y git
RUN yum install -y ruby
-
diff --git a/tools/dockerfile/distribtest/ruby_centos7_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_centos7_x64/Dockerfile
index bdc100ee1c..5bb9bd6fa6 100644
--- a/tools/dockerfile/distribtest/ruby_centos7_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_centos7_x64/Dockerfile
@@ -29,6 +29,4 @@
FROM centos:7
-RUN yum install -y git
RUN yum install -y ruby
-
diff --git a/tools/dockerfile/distribtest/ruby_fedora20_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_fedora20_x64/Dockerfile
index 50ff0b038b..9f23be986f 100644
--- a/tools/dockerfile/distribtest/ruby_fedora20_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_fedora20_x64/Dockerfile
@@ -29,8 +29,4 @@
FROM fedora:20
-RUN yum clean all
-RUN yum update -y
-RUN yum install -y git
-RUN yum install -y ruby
-
+RUN yum clean all && yum update -y && yum install -y ruby
diff --git a/tools/dockerfile/distribtest/ruby_fedora21_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_fedora21_x64/Dockerfile
index 219ecc8b53..57106a4894 100644
--- a/tools/dockerfile/distribtest/ruby_fedora21_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_fedora21_x64/Dockerfile
@@ -29,8 +29,4 @@
FROM fedora:21
-RUN yum clean all
-RUN yum update -y
-RUN yum install -y git
-RUN yum install -y ruby
-
+RUN yum clean all && yum update -y && yum install -y ruby
diff --git a/tools/dockerfile/distribtest/ruby_fedora22_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_fedora22_x64/Dockerfile
index 49d4c7d7f8..d770177381 100644
--- a/tools/dockerfile/distribtest/ruby_fedora22_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_fedora22_x64/Dockerfile
@@ -29,8 +29,4 @@
FROM fedora:22
-RUN yum clean all
-RUN yum update -y
-RUN yum install -y git
-RUN yum install -y ruby
-
+RUN yum clean all && yum update -y && yum install -y ruby
diff --git a/tools/dockerfile/distribtest/ruby_fedora23_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_fedora23_x64/Dockerfile
index 3c5363fb63..2c9b78ed08 100644
--- a/tools/dockerfile/distribtest/ruby_fedora23_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_fedora23_x64/Dockerfile
@@ -29,8 +29,4 @@
FROM fedora:23
-RUN yum clean all
-RUN yum update -y
-RUN yum install -y git
-RUN yum install -y ruby
-
+RUN yum clean all && yum update -y && yum install -y ruby
diff --git a/tools/dockerfile/distribtest/ruby_jessie_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_jessie_x64/Dockerfile
index 6a3d7edba0..4784bd73b4 100644
--- a/tools/dockerfile/distribtest/ruby_jessie_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_jessie_x64/Dockerfile
@@ -29,7 +29,4 @@
FROM debian:jessie
-RUN apt-get update
-RUN apt-get install -y git
-RUN apt-get install -y ruby-full
-
+RUN apt-get update && apt-get install -y ruby-full
diff --git a/tools/dockerfile/distribtest/ruby_jessie_x86/Dockerfile b/tools/dockerfile/distribtest/ruby_jessie_x86/Dockerfile
index ca3b731f56..4f649cbc03 100644
--- a/tools/dockerfile/distribtest/ruby_jessie_x86/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_jessie_x86/Dockerfile
@@ -29,7 +29,4 @@
FROM 32bit/debian:jessie
-RUN apt-get update
-RUN apt-get install -y git
-RUN apt-get install -y ruby-full
-
+RUN apt-get update && apt-get install -y ruby-full
diff --git a/tools/dockerfile/distribtest/ruby_opensuse_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_opensuse_x64/Dockerfile
index a9423042ea..a249950998 100644
--- a/tools/dockerfile/distribtest/ruby_opensuse_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_opensuse_x64/Dockerfile
@@ -29,6 +29,4 @@
FROM opensuse:42.1
-RUN zypper --non-interactive install git
RUN zypper --non-interactive install ruby
-
diff --git a/tools/dockerfile/distribtest/ruby_ubuntu1204_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_ubuntu1204_x64/Dockerfile
index 66f17100cf..95b7702afb 100644
--- a/tools/dockerfile/distribtest/ruby_ubuntu1204_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_ubuntu1204_x64/Dockerfile
@@ -29,7 +29,4 @@
FROM ubuntu:12.04
-RUN apt-get update -y
-RUN apt-get install -y git
-RUN apt-get install -y ruby-full
-
+RUN apt-get update -y && apt-get install -y ruby-full
diff --git a/tools/dockerfile/distribtest/ruby_ubuntu1404_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_ubuntu1404_x64/Dockerfile
index dc533a5fca..66ba01d37e 100644
--- a/tools/dockerfile/distribtest/ruby_ubuntu1404_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_ubuntu1404_x64/Dockerfile
@@ -29,7 +29,4 @@
FROM ubuntu:14.04
-RUN apt-get update -y
-RUN apt-get install -y git
-RUN apt-get install -y ruby-full
-
+RUN apt-get update -y && apt-get install -y ruby-full
diff --git a/tools/dockerfile/distribtest/ruby_ubuntu1504_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_ubuntu1504_x64/Dockerfile
index 7e4f203041..81e7ca1d3c 100644
--- a/tools/dockerfile/distribtest/ruby_ubuntu1504_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_ubuntu1504_x64/Dockerfile
@@ -29,7 +29,4 @@
FROM ubuntu:15.04
-RUN apt-get update -y
-RUN apt-get install -y git
-RUN apt-get install -y ruby-full
-
+RUN apt-get update -y && apt-get install -y ruby-full
diff --git a/tools/dockerfile/distribtest/ruby_ubuntu1510_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_ubuntu1510_x64/Dockerfile
index 43ef63ec8c..37b897f0f5 100644
--- a/tools/dockerfile/distribtest/ruby_ubuntu1510_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_ubuntu1510_x64/Dockerfile
@@ -29,7 +29,4 @@
FROM ubuntu:15.10
-RUN apt-get update -y
-RUN apt-get install -y git
-RUN apt-get install -y ruby-full
-
+RUN apt-get update -y && apt-get install -y ruby-full
diff --git a/tools/dockerfile/distribtest/ruby_ubuntu1604_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_ubuntu1604_x64/Dockerfile
index 3b63976d3c..5c54b8f754 100644
--- a/tools/dockerfile/distribtest/ruby_ubuntu1604_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_ubuntu1604_x64/Dockerfile
@@ -29,7 +29,4 @@
FROM ubuntu:16.04
-RUN apt-get update -y
-RUN apt-get install -y git
-RUN apt-get install -y ruby-full
-
+RUN apt-get update -y && apt-get install -y ruby-full
diff --git a/tools/dockerfile/distribtest/ruby_wheezy_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_wheezy_x64/Dockerfile
index 1ff083d43c..2e6593c230 100644
--- a/tools/dockerfile/distribtest/ruby_wheezy_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_wheezy_x64/Dockerfile
@@ -29,7 +29,4 @@
FROM debian:wheezy
-RUN apt-get update
-RUN apt-get install -y git
-RUN apt-get install -y ruby-full
-
+RUN apt-get update && apt-get install -y ruby-full
diff --git a/tools/jenkins/build_and_run_docker.sh b/tools/jenkins/build_and_run_docker.sh
index b77cd0aebb..92dbbc6f38 100755
--- a/tools/jenkins/build_and_run_docker.sh
+++ b/tools/jenkins/build_and_run_docker.sh
@@ -37,9 +37,6 @@ cd $(dirname $0)/../..
git_root=$(pwd)
cd -
-# Create a local branch so the child Docker script won't complain
-git branch -f jenkins-docker
-
# Inputs
# DOCKERFILE_DIR - Directory in which Dockerfile file is located.
# DOCKER_RUN_SCRIPT - Script to run under docker (relative to grpc repo root)
diff --git a/tools/jenkins/build_artifacts.sh b/tools/jenkins/build_artifacts.sh
index 9af553ae48..c0acbdfb27 100755
--- a/tools/jenkins/build_artifacts.sh
+++ b/tools/jenkins/build_artifacts.sh
@@ -39,4 +39,8 @@ set -ex -o igncr || set -ex
curr_platform="$platform"
unset platform # variable named 'platform' breaks the windows build
-python tools/run_tests/task_runner.py -f artifact $language $curr_platform $architecture
+if [ "$curr_platform" == "linux" ] && [ "$language" == "ruby" ] ; then
+ ./tools/run_tests/build_artifact_ruby.sh
+else
+ python tools/run_tests/task_runner.py -f artifact $language $curr_platform $architecture
+fi
diff --git a/tools/jenkins/docker_run.sh b/tools/jenkins/docker_run.sh
index 49553aae2f..519dc5cade 100755
--- a/tools/jenkins/docker_run.sh
+++ b/tools/jenkins/docker_run.sh
@@ -31,18 +31,24 @@
# This script is invoked by build_docker_* inside a docker
# container. You should never need to call this script on your own.
-set -e
+set -ex
-mkdir -p /var/local/git
-git clone --recursive "$EXTERNAL_GIT_ROOT" /var/local/git/grpc
+if [ "$RELATIVE_COPY_PATH" == "" ]
+then
+ mkdir -p /var/local/git
+ git clone --recursive "$EXTERNAL_GIT_ROOT" /var/local/git/grpc
+else
+ mkdir -p "/var/local/git/grpc/$RELATIVE_COPY_PATH"
+ cp -r "$EXTERNAL_GIT_ROOT/$RELATIVE_COPY_PATH"/* "/var/local/git/grpc/$RELATIVE_COPY_PATH"
+fi
if [ -x "$(command -v rvm)" ]
then
rvm use ruby-2.1
fi
-cd /var/local/git/grpc
-
nvm use 4 || true
+cd /var/local/git/grpc
+
$RUN_COMMAND
diff --git a/tools/run_tests/build_artifact_python.sh b/tools/run_tests/build_artifact_python.sh
index 48cf390f69..835fad83e1 100755
--- a/tools/run_tests/build_artifact_python.sh
+++ b/tools/run_tests/build_artifact_python.sh
@@ -39,11 +39,13 @@ then
pip install -rrequirements.txt
fi
-GRPC_PYTHON_BUILD_WITH_CYTHON=1 ${SETARCH_CMD} python setup.py \
- bdist_wheel \
- sdist \
+GRPC_PYTHON_USE_CUSTOM_BDIST=0 \
+GRPC_PYTHON_BUILD_WITH_CYTHON=1 \
+${SETARCH_CMD} python setup.py \
+ bdist_wheel \
+ sdist \
bdist_egg_grpc_custom
mkdir -p artifacts
-cp -r dist/* artifacts \ No newline at end of file
+cp -r dist/* artifacts
diff --git a/tools/run_tests/build_artifact_ruby.sh b/tools/run_tests/build_artifact_ruby.sh
index 482d128be3..2d97b4068b 100755
--- a/tools/run_tests/build_artifact_ruby.sh
+++ b/tools/run_tests/build_artifact_ruby.sh
@@ -27,16 +27,40 @@
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
set -ex
+SYSTEM=`uname | cut -f 1 -d_`
+
cd $(dirname $0)/../..
+set +ex
+[[ -s /etc/profile.d/rvm.sh ]] && . /etc/profile.d/rvm.sh
+[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
+set -ex
+
+if [ "$SYSTEM" == "MSYS" ] ; then
+ SYSTEM=MINGW32
+fi
+if [ "$SYSTEM" == "MINGW64" ] ; then
+ SYSTEM=MINGW32
+fi
-${SETARCH_CMD} bundle install
+if [ "$SYSTEM" == "MINGW32" ] ; then
+ echo "Need Linux to build the Windows ruby gem."
+ exit 1
+fi
-${SETARCH_CMD} rake native gem
+set +ex
+rvm use default
+gem install bundler --update
+bundle install
+set -ex
+
+rake gem:native
+
+if [ "$SYSTEM" == "Darwin" ] ; then
+ rm `ls pkg/*.gem | grep -v darwin`
+fi
mkdir -p artifacts
cp pkg/*.gem artifacts
-
diff --git a/tools/run_tests/distribtest_targets.py b/tools/run_tests/distribtest_targets.py
index e9a80d2cf4..a1e45ece9d 100644
--- a/tools/run_tests/distribtest_targets.py
+++ b/tools/run_tests/distribtest_targets.py
@@ -38,6 +38,7 @@ def create_docker_jobspec(name, dockerfile_dir, shell_command, environ={},
"""Creates jobspec for a task running under docker."""
environ = environ.copy()
environ['RUN_COMMAND'] = shell_command
+ environ['RELATIVE_COPY_PATH'] = 'test/distrib'
docker_args=[]
for k,v in environ.iteritems():