google-protobuf 3.21.10 → 3.25.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/google/protobuf_c/Rakefile +3 -0
- data/ext/google/protobuf_c/convert.c +23 -70
- data/ext/google/protobuf_c/convert.h +3 -28
- data/ext/google/protobuf_c/defs.c +178 -55
- data/ext/google/protobuf_c/defs.h +3 -28
- data/ext/google/protobuf_c/extconf.rb +4 -4
- data/ext/google/protobuf_c/glue.c +56 -0
- data/ext/google/protobuf_c/map.c +54 -70
- data/ext/google/protobuf_c/map.h +6 -28
- data/ext/google/protobuf_c/message.c +178 -161
- data/ext/google/protobuf_c/message.h +10 -28
- data/ext/google/protobuf_c/protobuf.c +39 -176
- data/ext/google/protobuf_c/protobuf.h +24 -32
- data/ext/google/protobuf_c/repeated_field.c +28 -29
- data/ext/google/protobuf_c/repeated_field.h +6 -28
- data/ext/google/protobuf_c/ruby-upb.c +12326 -9027
- data/ext/google/protobuf_c/ruby-upb.h +11950 -4518
- data/ext/google/protobuf_c/shared_convert.c +64 -0
- data/ext/google/protobuf_c/shared_convert.h +26 -0
- data/ext/google/protobuf_c/shared_message.c +65 -0
- data/ext/google/protobuf_c/shared_message.h +25 -0
- data/ext/google/protobuf_c/third_party/utf8_range/LICENSE +1 -0
- data/ext/google/protobuf_c/third_party/utf8_range/naive.c +0 -0
- data/ext/google/protobuf_c/third_party/utf8_range/range2-neon.c +1 -1
- data/ext/google/protobuf_c/third_party/utf8_range/range2-sse.c +0 -0
- data/ext/google/protobuf_c/third_party/utf8_range/utf8_range.h +13 -1
- data/ext/google/protobuf_c/wrap_memcpy.c +3 -26
- data/lib/google/protobuf/any_pb.rb +24 -5
- data/lib/google/protobuf/api_pb.rb +26 -23
- data/lib/google/protobuf/descriptor_dsl.rb +0 -0
- data/lib/google/protobuf/descriptor_pb.rb +43 -226
- data/lib/google/protobuf/duration_pb.rb +24 -5
- data/lib/google/protobuf/empty_pb.rb +24 -3
- data/lib/google/protobuf/ffi/descriptor.rb +165 -0
- data/lib/google/protobuf/ffi/descriptor_pool.rb +75 -0
- data/lib/google/protobuf/ffi/enum_descriptor.rb +171 -0
- data/lib/google/protobuf/ffi/ffi.rb +213 -0
- data/lib/google/protobuf/ffi/field_descriptor.rb +319 -0
- data/lib/google/protobuf/ffi/file_descriptor.rb +59 -0
- data/lib/google/protobuf/ffi/internal/arena.rb +66 -0
- data/lib/google/protobuf/ffi/internal/convert.rb +305 -0
- data/lib/google/protobuf/ffi/internal/pointer_helper.rb +35 -0
- data/lib/google/protobuf/ffi/internal/type_safety.rb +25 -0
- data/lib/google/protobuf/ffi/map.rb +407 -0
- data/lib/google/protobuf/ffi/message.rb +662 -0
- data/lib/google/protobuf/ffi/object_cache.rb +30 -0
- data/lib/google/protobuf/ffi/oneof_descriptor.rb +95 -0
- data/lib/google/protobuf/ffi/repeated_field.rb +383 -0
- data/lib/google/protobuf/field_mask_pb.rb +24 -4
- data/lib/google/protobuf/message_exts.rb +8 -26
- data/lib/google/protobuf/object_cache.rb +97 -0
- data/lib/google/protobuf/plugin_pb.rb +47 -0
- data/lib/google/protobuf/repeated_field.rb +3 -26
- data/lib/google/protobuf/source_context_pb.rb +24 -4
- data/lib/google/protobuf/struct_pb.rb +24 -20
- data/lib/google/protobuf/timestamp_pb.rb +24 -5
- data/lib/google/protobuf/type_pb.rb +26 -68
- data/lib/google/protobuf/well_known_types.rb +5 -34
- data/lib/google/protobuf/wrappers_pb.rb +24 -28
- data/lib/google/protobuf.rb +27 -45
- data/lib/google/protobuf_ffi.rb +50 -0
- data/lib/google/protobuf_native.rb +20 -0
- data/lib/google/tasks/ffi.rake +102 -0
- metadata +75 -12
- data/tests/basic.rb +0 -739
- data/tests/generated_code_test.rb +0 -23
- data/tests/stress.rb +0 -38
@@ -0,0 +1,102 @@
|
|
1
|
+
# # @param task [FFI::Compiler::CompileTask] task to configure
|
2
|
+
def configure_common_compile_task(task)
|
3
|
+
if FileUtils.pwd.include? 'ext'
|
4
|
+
src_dir = '.'
|
5
|
+
third_party_path = 'third_party/utf8_range'
|
6
|
+
else
|
7
|
+
src_dir = 'ext/google/protobuf_c'
|
8
|
+
third_party_path = 'ext/google/protobuf_c/third_party/utf8_range'
|
9
|
+
end
|
10
|
+
|
11
|
+
task.add_include_path third_party_path
|
12
|
+
task.add_define 'NDEBUG'
|
13
|
+
task.cflags << "-std=gnu99 -O3"
|
14
|
+
[
|
15
|
+
:convert, :defs, :map, :message, :protobuf, :repeated_field, :wrap_memcpy
|
16
|
+
].each { |file| task.exclude << "/#{file}.c" }
|
17
|
+
task.ext_dir = src_dir
|
18
|
+
task.source_dirs = [src_dir]
|
19
|
+
if RbConfig::CONFIG['target_os'] =~ /darwin|linux/
|
20
|
+
task.cflags << "-Wall -Wsign-compare -Wno-declaration-after-statement"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# FFI::CompilerTask's constructor walks the filesystem at task definition time
|
25
|
+
# to create subtasks for each source file, so files from third_party must be
|
26
|
+
# copied into place before the task is defined for it to work correctly.
|
27
|
+
# TODO Is there a sane way to check for generated protos under lib too?
|
28
|
+
def with_generated_files
|
29
|
+
expected_path = FileUtils.pwd.include?('ext') ? 'third_party/utf8_range' : 'ext/google/protobuf_c/third_party/utf8_range'
|
30
|
+
if File.directory?(expected_path)
|
31
|
+
yield
|
32
|
+
else
|
33
|
+
task :default do
|
34
|
+
# It is possible, especially in cases like the first invocation of
|
35
|
+
# `rake test` following `rake clean` or a fresh checkout that the
|
36
|
+
# `copy_third_party` task has been executed since initial task definition.
|
37
|
+
# If so, run the task definition block now and invoke it explicitly.
|
38
|
+
if File.directory?(expected_path)
|
39
|
+
yield
|
40
|
+
Rake::Task[:default].invoke
|
41
|
+
else
|
42
|
+
raise "Missing directory #{File.absolute_path(expected_path)}." +
|
43
|
+
" Did you forget to run `rake copy_third_party` before building" +
|
44
|
+
" native extensions?"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
begin
|
51
|
+
require "ffi-compiler/compile_task"
|
52
|
+
|
53
|
+
desc "Compile Protobuf library for FFI"
|
54
|
+
namespace "ffi-protobuf" do
|
55
|
+
with_generated_files do
|
56
|
+
# Compile Ruby UPB separately in order to limit use of -DUPB_BUILD_API to one
|
57
|
+
# compilation unit.
|
58
|
+
desc "Compile UPB library for FFI"
|
59
|
+
namespace "ffi-upb" do
|
60
|
+
with_generated_files do
|
61
|
+
FFI::Compiler::CompileTask.new('ruby-upb') do |c|
|
62
|
+
configure_common_compile_task c
|
63
|
+
c.add_define "UPB_BUILD_API"
|
64
|
+
c.exclude << "/glue.c"
|
65
|
+
c.exclude << "/shared_message.c"
|
66
|
+
c.exclude << "/shared_convert.c"
|
67
|
+
if RbConfig::CONFIG['target_os'] =~ /darwin|linux/
|
68
|
+
c.cflags << "-fvisibility=hidden"
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
FFI::Compiler::CompileTask.new 'protobuf_c_ffi' do |c|
|
75
|
+
configure_common_compile_task c
|
76
|
+
# Ruby UPB was already compiled with different flags.
|
77
|
+
c.exclude << "/range2-neon.c"
|
78
|
+
c.exclude << "/range2-sse.c"
|
79
|
+
c.exclude << "/naive.c"
|
80
|
+
c.exclude << "/ruby-upb.c"
|
81
|
+
end
|
82
|
+
|
83
|
+
# Setup dependencies so that the .o files generated by building ffi-upb are
|
84
|
+
# available to link here.
|
85
|
+
# TODO Can this be simplified? Can the single shared library be used
|
86
|
+
# instead of the object files?
|
87
|
+
protobuf_c_task = Rake::Task[:default]
|
88
|
+
protobuf_c_shared_lib_task = Rake::Task[protobuf_c_task.prereqs.last]
|
89
|
+
ruby_upb_shared_lib_task = Rake::Task[:"ffi-upb:default"].prereqs.first
|
90
|
+
Rake::Task[ruby_upb_shared_lib_task].prereqs.each do |dependency|
|
91
|
+
protobuf_c_shared_lib_task.prereqs.prepend dependency
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
rescue LoadError
|
96
|
+
desc "Compile Protobuf library for FFI"
|
97
|
+
namespace "ffi-protobuf" do
|
98
|
+
task :default do
|
99
|
+
warn "Skipping build of FFI; `gem install ffi-compiler` to enable."
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-protobuf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.25.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Protobuf Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler-dock
|
@@ -24,6 +24,48 @@ dependencies:
|
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.2.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '13'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '13'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: ffi
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: ffi-compiler
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1'
|
27
69
|
- !ruby/object:Gem::Dependency
|
28
70
|
name: rake-compiler
|
29
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -63,13 +105,16 @@ email: protobuf@googlegroups.com
|
|
63
105
|
executables: []
|
64
106
|
extensions:
|
65
107
|
- ext/google/protobuf_c/extconf.rb
|
108
|
+
- ext/google/protobuf_c/Rakefile
|
66
109
|
extra_rdoc_files: []
|
67
110
|
files:
|
111
|
+
- ext/google/protobuf_c/Rakefile
|
68
112
|
- ext/google/protobuf_c/convert.c
|
69
113
|
- ext/google/protobuf_c/convert.h
|
70
114
|
- ext/google/protobuf_c/defs.c
|
71
115
|
- ext/google/protobuf_c/defs.h
|
72
116
|
- ext/google/protobuf_c/extconf.rb
|
117
|
+
- ext/google/protobuf_c/glue.c
|
73
118
|
- ext/google/protobuf_c/map.c
|
74
119
|
- ext/google/protobuf_c/map.h
|
75
120
|
- ext/google/protobuf_c/message.c
|
@@ -80,6 +125,10 @@ files:
|
|
80
125
|
- ext/google/protobuf_c/repeated_field.h
|
81
126
|
- ext/google/protobuf_c/ruby-upb.c
|
82
127
|
- ext/google/protobuf_c/ruby-upb.h
|
128
|
+
- ext/google/protobuf_c/shared_convert.c
|
129
|
+
- ext/google/protobuf_c/shared_convert.h
|
130
|
+
- ext/google/protobuf_c/shared_message.c
|
131
|
+
- ext/google/protobuf_c/shared_message.h
|
83
132
|
- ext/google/protobuf_c/third_party/utf8_range/LICENSE
|
84
133
|
- ext/google/protobuf_c/third_party/utf8_range/naive.c
|
85
134
|
- ext/google/protobuf_c/third_party/utf8_range/range2-neon.c
|
@@ -93,8 +142,25 @@ files:
|
|
93
142
|
- lib/google/protobuf/descriptor_pb.rb
|
94
143
|
- lib/google/protobuf/duration_pb.rb
|
95
144
|
- lib/google/protobuf/empty_pb.rb
|
145
|
+
- lib/google/protobuf/ffi/descriptor.rb
|
146
|
+
- lib/google/protobuf/ffi/descriptor_pool.rb
|
147
|
+
- lib/google/protobuf/ffi/enum_descriptor.rb
|
148
|
+
- lib/google/protobuf/ffi/ffi.rb
|
149
|
+
- lib/google/protobuf/ffi/field_descriptor.rb
|
150
|
+
- lib/google/protobuf/ffi/file_descriptor.rb
|
151
|
+
- lib/google/protobuf/ffi/internal/arena.rb
|
152
|
+
- lib/google/protobuf/ffi/internal/convert.rb
|
153
|
+
- lib/google/protobuf/ffi/internal/pointer_helper.rb
|
154
|
+
- lib/google/protobuf/ffi/internal/type_safety.rb
|
155
|
+
- lib/google/protobuf/ffi/map.rb
|
156
|
+
- lib/google/protobuf/ffi/message.rb
|
157
|
+
- lib/google/protobuf/ffi/object_cache.rb
|
158
|
+
- lib/google/protobuf/ffi/oneof_descriptor.rb
|
159
|
+
- lib/google/protobuf/ffi/repeated_field.rb
|
96
160
|
- lib/google/protobuf/field_mask_pb.rb
|
97
161
|
- lib/google/protobuf/message_exts.rb
|
162
|
+
- lib/google/protobuf/object_cache.rb
|
163
|
+
- lib/google/protobuf/plugin_pb.rb
|
98
164
|
- lib/google/protobuf/repeated_field.rb
|
99
165
|
- lib/google/protobuf/source_context_pb.rb
|
100
166
|
- lib/google/protobuf/struct_pb.rb
|
@@ -102,14 +168,14 @@ files:
|
|
102
168
|
- lib/google/protobuf/type_pb.rb
|
103
169
|
- lib/google/protobuf/well_known_types.rb
|
104
170
|
- lib/google/protobuf/wrappers_pb.rb
|
105
|
-
-
|
106
|
-
-
|
107
|
-
-
|
171
|
+
- lib/google/protobuf_ffi.rb
|
172
|
+
- lib/google/protobuf_native.rb
|
173
|
+
- lib/google/tasks/ffi.rake
|
108
174
|
homepage: https://developers.google.com/protocol-buffers
|
109
175
|
licenses:
|
110
176
|
- BSD-3-Clause
|
111
177
|
metadata:
|
112
|
-
source_code_uri: https://github.com/protocolbuffers/protobuf/tree/v3.
|
178
|
+
source_code_uri: https://github.com/protocolbuffers/protobuf/tree/v3.25.5/ruby
|
113
179
|
post_install_message:
|
114
180
|
rdoc_options: []
|
115
181
|
require_paths:
|
@@ -118,18 +184,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
118
184
|
requirements:
|
119
185
|
- - ">="
|
120
186
|
- !ruby/object:Gem::Version
|
121
|
-
version: '2.
|
187
|
+
version: '2.7'
|
122
188
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
123
189
|
requirements:
|
124
190
|
- - ">="
|
125
191
|
- !ruby/object:Gem::Version
|
126
192
|
version: '0'
|
127
193
|
requirements: []
|
128
|
-
rubygems_version: 3.0.
|
194
|
+
rubygems_version: 3.0.8
|
129
195
|
signing_key:
|
130
196
|
specification_version: 4
|
131
197
|
summary: Protocol Buffers
|
132
|
-
test_files:
|
133
|
-
- tests/basic.rb
|
134
|
-
- tests/stress.rb
|
135
|
-
- tests/generated_code_test.rb
|
198
|
+
test_files: []
|