grpc 1.56.2-x86_64-darwin → 1.57.0-x86_64-darwin
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/src/ruby/bin/math_pb.rb +24 -18
- data/src/ruby/ext/grpc/extconf.rb +19 -18
- data/src/ruby/ext/grpc/rb_call.c +62 -39
- data/src/ruby/ext/grpc/rb_call_credentials.c +0 -1
- data/src/ruby/ext/grpc/rb_channel.c +109 -84
- data/src/ruby/ext/grpc/rb_channel.h +1 -0
- data/src/ruby/ext/grpc/rb_channel_args.c +16 -2
- data/src/ruby/ext/grpc/rb_channel_args.h +4 -0
- data/src/ruby/ext/grpc/rb_channel_credentials.c +0 -1
- data/src/ruby/ext/grpc/rb_compression_options.c +0 -1
- data/src/ruby/ext/grpc/rb_event_thread.c +22 -6
- data/src/ruby/ext/grpc/rb_event_thread.h +1 -0
- data/src/ruby/ext/grpc/rb_grpc.c +192 -30
- data/src/ruby/ext/grpc/rb_grpc.h +8 -2
- data/src/ruby/ext/grpc/rb_server.c +62 -45
- data/src/ruby/ext/grpc/rb_server_credentials.c +0 -1
- data/src/ruby/ext/grpc/rb_xds_channel_credentials.c +0 -1
- data/src/ruby/ext/grpc/rb_xds_server_credentials.c +0 -1
- data/src/ruby/lib/grpc/2.6/grpc_c.bundle +0 -0
- data/src/ruby/lib/grpc/2.7/grpc_c.bundle +0 -0
- data/src/ruby/lib/grpc/3.0/grpc_c.bundle +0 -0
- data/src/ruby/lib/grpc/3.1/grpc_c.bundle +0 -0
- data/src/ruby/lib/grpc/3.2/grpc_c.bundle +0 -0
- data/src/ruby/lib/grpc/generic/bidi_call.rb +2 -0
- data/src/ruby/lib/grpc/version.rb +1 -1
- data/src/ruby/pb/grpc/health/v1/health_pb.rb +24 -13
- data/src/ruby/pb/src/proto/grpc/testing/empty_pb.rb +24 -3
- data/src/ruby/pb/src/proto/grpc/testing/messages_pb.rb +25 -111
- data/src/ruby/pb/src/proto/grpc/testing/test_pb.rb +25 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9103b89ee64f2081e544ba50f313739c0d87140a1b0c7b47c289533d0eb2cae3
|
4
|
+
data.tar.gz: 14fafb4bc75841ddab6e5fb75025df9bce29565e2d8f8e976b5e88e7215d5c64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8ff5159269cc94be2b51a414e6a3bcf672b9df22343f14f57978c0cc4874c873525e6dce3af1bbd062e61d61a5bff8fe4cf2aacb25368f281e67e337f658b49
|
7
|
+
data.tar.gz: 4d06acb59f8da22520d425d288d4e8593eceb1fd197217e34693b278082ab36bcef3b0b7e9c100960e39a19f671eb0a2d556e7204c474a413887374f933e8357
|
data/src/ruby/bin/math_pb.rb
CHANGED
@@ -1,28 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
3
|
# source: math.proto
|
3
4
|
|
4
5
|
require 'google/protobuf'
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
7
|
+
|
8
|
+
descriptor_data = "\n\nmath.proto\x12\x04math\",\n\x07\x44ivArgs\x12\x10\n\x08\x64ividend\x18\x01 \x01(\x03\x12\x0f\n\x07\x64ivisor\x18\x02 \x01(\x03\"/\n\x08\x44ivReply\x12\x10\n\x08quotient\x18\x01 \x01(\x03\x12\x11\n\tremainder\x18\x02 \x01(\x03\"\x18\n\x07\x46ibArgs\x12\r\n\x05limit\x18\x01 \x01(\x03\"\x12\n\x03Num\x12\x0b\n\x03num\x18\x01 \x01(\x03\"\x19\n\x08\x46ibReply\x12\r\n\x05\x63ount\x18\x01 \x01(\x03\x32\xa4\x01\n\x04Math\x12&\n\x03\x44iv\x12\r.math.DivArgs\x1a\x0e.math.DivReply\"\x00\x12.\n\x07\x44ivMany\x12\r.math.DivArgs\x1a\x0e.math.DivReply\"\x00(\x01\x30\x01\x12#\n\x03\x46ib\x12\r.math.FibArgs\x1a\t.math.Num\"\x00\x30\x01\x12\x1f\n\x03Sum\x12\t.math.Num\x1a\t.math.Num\"\x00(\x01\x62\x06proto3"
|
9
|
+
|
10
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
11
|
+
|
12
|
+
begin
|
13
|
+
pool.add_serialized_file(descriptor_data)
|
14
|
+
rescue TypeError => e
|
15
|
+
# Compatibility code: will be removed in the next major version.
|
16
|
+
require 'google/protobuf/descriptor_pb'
|
17
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
18
|
+
parsed.clear_dependency
|
19
|
+
serialized = parsed.class.encode(parsed)
|
20
|
+
file = pool.add_serialized_file(serialized)
|
21
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
22
|
+
imports = [
|
23
|
+
]
|
24
|
+
imports.each do |type_name, expected_filename|
|
25
|
+
import_file = pool.lookup(type_name).file_descriptor
|
26
|
+
if import_file.name != expected_filename
|
27
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
24
28
|
end
|
25
29
|
end
|
30
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
31
|
+
warn "This will become an error in the next major version."
|
26
32
|
end
|
27
33
|
|
28
34
|
module Math
|
@@ -88,11 +88,15 @@ env_append 'CPPFLAGS', '-DGRPC_XDS_USER_AGENT_NAME_SUFFIX="\"RUBY\""'
|
|
88
88
|
|
89
89
|
require_relative '../../lib/grpc/version'
|
90
90
|
env_append 'CPPFLAGS', '-DGRPC_XDS_USER_AGENT_VERSION_SUFFIX="\"' + GRPC::VERSION + '\""'
|
91
|
+
env_append 'CPPFLAGS', '-DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1'
|
91
92
|
|
92
93
|
output_dir = File.expand_path(RbConfig::CONFIG['topdir'])
|
93
94
|
grpc_lib_dir = File.join(output_dir, 'libs', grpc_config)
|
94
95
|
ENV['BUILDDIR'] = output_dir
|
95
96
|
|
97
|
+
strip_tool = RbConfig::CONFIG['STRIP']
|
98
|
+
strip_tool += ' -x' if apple_toolchain
|
99
|
+
|
96
100
|
unless windows
|
97
101
|
puts 'Building internal gRPC into ' + grpc_lib_dir
|
98
102
|
nproc = 4
|
@@ -107,6 +111,17 @@ unless windows
|
|
107
111
|
puts "Building grpc native library: #{cmd}"
|
108
112
|
system(cmd)
|
109
113
|
exit 1 unless $? == 0
|
114
|
+
|
115
|
+
if grpc_config == 'opt'
|
116
|
+
rm_obj_cmd = "rm -rf #{File.join(output_dir, 'objs')}"
|
117
|
+
puts "Removing grpc object files: #{rm_obj_cmd}"
|
118
|
+
system(rm_obj_cmd)
|
119
|
+
exit 1 unless $? == 0
|
120
|
+
strip_cmd = "#{strip_tool} #{grpc_lib_dir}/*.a"
|
121
|
+
puts "Stripping grpc native library: #{strip_cmd}"
|
122
|
+
system(strip_cmd)
|
123
|
+
exit 1 unless $? == 0
|
124
|
+
end
|
110
125
|
end
|
111
126
|
|
112
127
|
$CFLAGS << ' -DGRPC_RUBY_WINDOWS_UCRT' if windows_ucrt
|
@@ -141,7 +156,10 @@ end
|
|
141
156
|
|
142
157
|
ext_export_file = File.join(grpc_root, 'src', 'ruby', 'ext', 'grpc', ext_export_filename())
|
143
158
|
$LDFLAGS << ' -Wl,--version-script="' + ext_export_file + '.gcc"' if linux
|
144
|
-
|
159
|
+
if apple_toolchain
|
160
|
+
$LDFLAGS << ' -weak_framework CoreFoundation' if RUBY_PLATFORM =~ /arm64/
|
161
|
+
$LDFLAGS << ' -Wl,-exported_symbols_list,"' + ext_export_file + '.clang"'
|
162
|
+
end
|
145
163
|
|
146
164
|
$LDFLAGS << ' ' + File.join(grpc_lib_dir, 'libgrpc.a') unless windows
|
147
165
|
if grpc_config == 'gcov'
|
@@ -169,23 +187,6 @@ output = File.join('grpc', 'grpc_c')
|
|
169
187
|
puts 'Generating Makefile for ' + output
|
170
188
|
create_makefile(output)
|
171
189
|
|
172
|
-
strip_tool = RbConfig::CONFIG['STRIP']
|
173
|
-
strip_tool += ' -x' if apple_toolchain
|
174
|
-
|
175
|
-
if grpc_config == 'opt'
|
176
|
-
File.open('Makefile.new', 'w') do |o|
|
177
|
-
o.puts 'hijack: all strip'
|
178
|
-
o.puts
|
179
|
-
File.foreach('Makefile') do |i|
|
180
|
-
o.puts i
|
181
|
-
end
|
182
|
-
o.puts
|
183
|
-
o.puts 'strip: $(DLLIB)'
|
184
|
-
o.puts "\t$(ECHO) Stripping $(DLLIB)"
|
185
|
-
o.puts "\t$(Q) #{strip_tool} $(DLLIB)"
|
186
|
-
end
|
187
|
-
File.rename('Makefile.new', 'Makefile')
|
188
|
-
end
|
189
190
|
if ENV['GRPC_RUBY_TEST_ONLY_WORKAROUND_MAKE_INSTALL_BUG']
|
190
191
|
# Note: this env var setting is intended to work around a problem observed
|
191
192
|
# with the ginstall command on grpc's macos automated test infrastructure,
|
data/src/ruby/ext/grpc/rb_call.c
CHANGED
@@ -801,6 +801,56 @@ static VALUE grpc_run_batch_stack_build_result(run_batch_stack* st) {
|
|
801
801
|
return result;
|
802
802
|
}
|
803
803
|
|
804
|
+
struct call_run_batch_args {
|
805
|
+
grpc_rb_call* call;
|
806
|
+
unsigned write_flag;
|
807
|
+
VALUE ops_hash;
|
808
|
+
run_batch_stack* st;
|
809
|
+
};
|
810
|
+
|
811
|
+
static VALUE grpc_rb_call_run_batch_try(VALUE value_args) {
|
812
|
+
grpc_rb_fork_unsafe_begin();
|
813
|
+
struct call_run_batch_args* args = (struct call_run_batch_args*)value_args;
|
814
|
+
void* tag = (void*)&args->st;
|
815
|
+
|
816
|
+
grpc_event ev;
|
817
|
+
grpc_call_error err;
|
818
|
+
|
819
|
+
args->st = gpr_malloc(sizeof(run_batch_stack));
|
820
|
+
grpc_run_batch_stack_init(args->st, args->write_flag);
|
821
|
+
grpc_run_batch_stack_fill_ops(args->st, args->ops_hash);
|
822
|
+
|
823
|
+
/* call grpc_call_start_batch, then wait for it to complete using
|
824
|
+
* pluck_event */
|
825
|
+
err = grpc_call_start_batch(args->call->wrapped, args->st->ops,
|
826
|
+
args->st->op_num, tag, NULL);
|
827
|
+
if (err != GRPC_CALL_OK) {
|
828
|
+
rb_raise(grpc_rb_eCallError,
|
829
|
+
"grpc_call_start_batch failed with %s (code=%d)",
|
830
|
+
grpc_call_error_detail_of(err), err);
|
831
|
+
}
|
832
|
+
ev = rb_completion_queue_pluck(args->call->queue, tag,
|
833
|
+
gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
|
834
|
+
if (!ev.success) {
|
835
|
+
rb_raise(grpc_rb_eCallError, "call#run_batch failed somehow");
|
836
|
+
}
|
837
|
+
/* Build and return the BatchResult struct result,
|
838
|
+
if there is an error, it's reflected in the status */
|
839
|
+
return grpc_run_batch_stack_build_result(args->st);
|
840
|
+
}
|
841
|
+
|
842
|
+
static VALUE grpc_rb_call_run_batch_ensure(VALUE value_args) {
|
843
|
+
grpc_rb_fork_unsafe_end();
|
844
|
+
struct call_run_batch_args* args = (struct call_run_batch_args*)value_args;
|
845
|
+
|
846
|
+
if (args->st) {
|
847
|
+
grpc_run_batch_stack_cleanup(args->st);
|
848
|
+
gpr_free(args->st);
|
849
|
+
}
|
850
|
+
|
851
|
+
return Qnil;
|
852
|
+
}
|
853
|
+
|
804
854
|
/* call-seq:
|
805
855
|
ops = {
|
806
856
|
GRPC::Core::CallOps::SEND_INITIAL_METADATA => <op_value>,
|
@@ -819,56 +869,29 @@ static VALUE grpc_run_batch_stack_build_result(run_batch_stack* st) {
|
|
819
869
|
Only one operation of each type can be active at once in any given
|
820
870
|
batch */
|
821
871
|
static VALUE grpc_rb_call_run_batch(VALUE self, VALUE ops_hash) {
|
822
|
-
run_batch_stack* st = NULL;
|
823
|
-
grpc_rb_call* call = NULL;
|
824
|
-
grpc_event ev;
|
825
|
-
grpc_call_error err;
|
826
|
-
VALUE result = Qnil;
|
827
|
-
VALUE rb_write_flag = rb_ivar_get(self, id_write_flag);
|
828
|
-
unsigned write_flag = 0;
|
829
|
-
void* tag = (void*)&st;
|
830
|
-
|
831
872
|
grpc_ruby_fork_guard();
|
832
873
|
if (RTYPEDDATA_DATA(self) == NULL) {
|
833
874
|
rb_raise(grpc_rb_eCallError, "Cannot run batch on closed call");
|
834
|
-
return Qnil;
|
835
875
|
}
|
876
|
+
|
877
|
+
grpc_rb_call* call = NULL;
|
836
878
|
TypedData_Get_Struct(self, grpc_rb_call, &grpc_call_data_type, call);
|
837
879
|
|
838
880
|
/* Validate the ops args, adding them to a ruby array */
|
839
881
|
if (TYPE(ops_hash) != T_HASH) {
|
840
882
|
rb_raise(rb_eTypeError, "call#run_batch: ops hash should be a hash");
|
841
|
-
return Qnil;
|
842
883
|
}
|
843
|
-
if (rb_write_flag != Qnil) {
|
844
|
-
write_flag = NUM2UINT(rb_write_flag);
|
845
|
-
}
|
846
|
-
st = gpr_malloc(sizeof(run_batch_stack));
|
847
|
-
grpc_run_batch_stack_init(st, write_flag);
|
848
|
-
grpc_run_batch_stack_fill_ops(st, ops_hash);
|
849
884
|
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
}
|
861
|
-
ev = rb_completion_queue_pluck(call->queue, tag,
|
862
|
-
gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
|
863
|
-
if (!ev.success) {
|
864
|
-
rb_raise(grpc_rb_eCallError, "call#run_batch failed somehow");
|
865
|
-
}
|
866
|
-
/* Build and return the BatchResult struct result,
|
867
|
-
if there is an error, it's reflected in the status */
|
868
|
-
result = grpc_run_batch_stack_build_result(st);
|
869
|
-
grpc_run_batch_stack_cleanup(st);
|
870
|
-
gpr_free(st);
|
871
|
-
return result;
|
885
|
+
VALUE rb_write_flag = rb_ivar_get(self, id_write_flag);
|
886
|
+
|
887
|
+
struct call_run_batch_args args = {
|
888
|
+
.call = call,
|
889
|
+
.write_flag = rb_write_flag == Qnil ? 0 : NUM2UINT(rb_write_flag),
|
890
|
+
.ops_hash = ops_hash,
|
891
|
+
.st = NULL};
|
892
|
+
|
893
|
+
return rb_ensure(grpc_rb_call_run_batch_try, (VALUE)&args,
|
894
|
+
grpc_rb_call_run_batch_ensure, (VALUE)&args);
|
872
895
|
}
|
873
896
|
|
874
897
|
static void Init_grpc_write_flags() {
|
@@ -193,7 +193,6 @@ static void grpc_rb_call_credentials_free_internal(void* p) {
|
|
193
193
|
/* Destroys the credentials instances. */
|
194
194
|
static void grpc_rb_call_credentials_free(void* p) {
|
195
195
|
grpc_rb_call_credentials_free_internal(p);
|
196
|
-
grpc_ruby_shutdown();
|
197
196
|
}
|
198
197
|
|
199
198
|
/* Protects the mark object from GC */
|