google-protobuf 3.24.4-x86_64-linux → 3.25.0.rc.1-x86_64-linux
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of google-protobuf might be problematic. Click here for more details.
- 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 -26
- data/ext/google/protobuf_c/defs.c +3 -26
- data/ext/google/protobuf_c/defs.h +3 -26
- data/ext/google/protobuf_c/extconf.rb +2 -1
- data/ext/google/protobuf_c/glue.c +21 -0
- data/ext/google/protobuf_c/map.c +3 -26
- data/ext/google/protobuf_c/map.h +3 -26
- data/ext/google/protobuf_c/message.c +21 -69
- data/ext/google/protobuf_c/message.h +3 -26
- data/ext/google/protobuf_c/protobuf.c +3 -26
- data/ext/google/protobuf_c/protobuf.h +3 -26
- data/ext/google/protobuf_c/repeated_field.c +4 -27
- data/ext/google/protobuf_c/repeated_field.h +3 -26
- data/ext/google/protobuf_c/ruby-upb.c +8351 -8160
- data/ext/google/protobuf_c/ruby-upb.h +4077 -3784
- 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/wrap_memcpy.c +3 -26
- data/lib/google/2.7/protobuf_c.so +0 -0
- data/lib/google/3.0/protobuf_c.so +0 -0
- data/lib/google/3.1/protobuf_c.so +0 -0
- data/lib/google/3.2/protobuf_c.so +0 -0
- data/lib/google/protobuf/any_pb.rb +1 -1
- data/lib/google/protobuf/api_pb.rb +1 -1
- data/lib/google/protobuf/descriptor_pb.rb +6 -3
- data/lib/google/protobuf/duration_pb.rb +1 -1
- data/lib/google/protobuf/empty_pb.rb +1 -1
- data/lib/google/protobuf/ffi/descriptor.rb +154 -0
- data/lib/google/protobuf/ffi/descriptor_pool.rb +70 -0
- data/lib/google/protobuf/ffi/enum_descriptor.rb +161 -0
- data/lib/google/protobuf/ffi/ffi.rb +213 -0
- data/lib/google/protobuf/ffi/field_descriptor.rb +309 -0
- data/lib/google/protobuf/ffi/file_descriptor.rb +48 -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 +396 -0
- data/lib/google/protobuf/ffi/message.rb +641 -0
- data/lib/google/protobuf/ffi/object_cache.rb +30 -0
- data/lib/google/protobuf/ffi/oneof_descriptor.rb +88 -0
- data/lib/google/protobuf/ffi/repeated_field.rb +503 -0
- data/lib/google/protobuf/field_mask_pb.rb +1 -1
- data/lib/google/protobuf/message_exts.rb +3 -26
- data/lib/google/protobuf/object_cache.rb +3 -26
- data/lib/google/protobuf/plugin_pb.rb +1 -1
- data/lib/google/protobuf/repeated_field.rb +3 -26
- data/lib/google/protobuf/source_context_pb.rb +1 -1
- data/lib/google/protobuf/struct_pb.rb +1 -1
- data/lib/google/protobuf/timestamp_pb.rb +1 -1
- data/lib/google/protobuf/type_pb.rb +1 -1
- data/lib/google/protobuf/well_known_types.rb +3 -26
- data/lib/google/protobuf/wrappers_pb.rb +1 -1
- data/lib/google/protobuf.rb +26 -45
- data/lib/google/protobuf_ffi.rb +50 -0
- data/lib/google/protobuf_native.rb +20 -0
- data/lib/google/tasks/ffi.rake +94 -0
- metadata +71 -5
@@ -1,32 +1,9 @@
|
|
1
1
|
# Protocol Buffers - Google's data interchange format
|
2
2
|
# Copyright 2008 Google Inc. All rights reserved.
|
3
|
-
# https://developers.google.com/protocol-buffers/
|
4
3
|
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
# * Redistributions of source code must retain the above copyright
|
10
|
-
# notice, this list of conditions and the following disclaimer.
|
11
|
-
# * Redistributions in binary form must reproduce the above
|
12
|
-
# copyright notice, this list of conditions and the following disclaimer
|
13
|
-
# in the documentation and/or other materials provided with the
|
14
|
-
# distribution.
|
15
|
-
# * Neither the name of Google Inc. nor the names of its
|
16
|
-
# contributors may be used to endorse or promote products derived from
|
17
|
-
# this software without specific prior written permission.
|
18
|
-
#
|
19
|
-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
20
|
-
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
21
|
-
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
22
|
-
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
23
|
-
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
24
|
-
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
25
|
-
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
26
|
-
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
27
|
-
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
28
|
-
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
29
|
-
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
4
|
+
# Use of this source code is governed by a BSD-style
|
5
|
+
# license that can be found in the LICENSE file or at
|
6
|
+
# https://developers.google.com/open-source/licenses/bsd
|
30
7
|
|
31
8
|
require 'forwardable'
|
32
9
|
|
@@ -11,7 +11,7 @@ pool = Google::Protobuf::DescriptorPool.generated_pool
|
|
11
11
|
|
12
12
|
begin
|
13
13
|
pool.add_serialized_file(descriptor_data)
|
14
|
-
rescue TypeError
|
14
|
+
rescue TypeError
|
15
15
|
# Compatibility code: will be removed in the next major version.
|
16
16
|
require 'google/protobuf/descriptor_pb'
|
17
17
|
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
@@ -11,7 +11,7 @@ pool = Google::Protobuf::DescriptorPool.generated_pool
|
|
11
11
|
|
12
12
|
begin
|
13
13
|
pool.add_serialized_file(descriptor_data)
|
14
|
-
rescue TypeError
|
14
|
+
rescue TypeError
|
15
15
|
# Compatibility code: will be removed in the next major version.
|
16
16
|
require 'google/protobuf/descriptor_pb'
|
17
17
|
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
@@ -11,7 +11,7 @@ pool = Google::Protobuf::DescriptorPool.generated_pool
|
|
11
11
|
|
12
12
|
begin
|
13
13
|
pool.add_serialized_file(descriptor_data)
|
14
|
-
rescue TypeError
|
14
|
+
rescue TypeError
|
15
15
|
# Compatibility code: will be removed in the next major version.
|
16
16
|
require 'google/protobuf/descriptor_pb'
|
17
17
|
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
@@ -14,7 +14,7 @@ pool = Google::Protobuf::DescriptorPool.generated_pool
|
|
14
14
|
|
15
15
|
begin
|
16
16
|
pool.add_serialized_file(descriptor_data)
|
17
|
-
rescue TypeError
|
17
|
+
rescue TypeError
|
18
18
|
# Compatibility code: will be removed in the next major version.
|
19
19
|
require 'google/protobuf/descriptor_pb'
|
20
20
|
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
@@ -1,33 +1,10 @@
|
|
1
1
|
#!/usr/bin/ruby
|
2
2
|
# Protocol Buffers - Google's data interchange format
|
3
3
|
# Copyright 2008 Google Inc. All rights reserved.
|
4
|
-
# https://developers.google.com/protocol-buffers/
|
5
4
|
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
# * Redistributions of source code must retain the above copyright
|
11
|
-
# notice, this list of conditions and the following disclaimer.
|
12
|
-
# * Redistributions in binary form must reproduce the above
|
13
|
-
# copyright notice, this list of conditions and the following disclaimer
|
14
|
-
# in the documentation and/or other materials provided with the
|
15
|
-
# distribution.
|
16
|
-
# * Neither the name of Google Inc. nor the names of its
|
17
|
-
# contributors may be used to endorse or promote products derived from
|
18
|
-
# this software without specific prior written permission.
|
19
|
-
#
|
20
|
-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
21
|
-
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
22
|
-
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
23
|
-
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
24
|
-
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
25
|
-
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
26
|
-
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
27
|
-
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
28
|
-
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
29
|
-
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
30
|
-
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
5
|
+
# Use of this source code is governed by a BSD-style
|
6
|
+
# license that can be found in the LICENSE file or at
|
7
|
+
# https://developers.google.com/open-source/licenses/bsd
|
31
8
|
|
32
9
|
require 'google/protobuf/any_pb'
|
33
10
|
require 'google/protobuf/duration_pb'
|
@@ -11,7 +11,7 @@ pool = Google::Protobuf::DescriptorPool.generated_pool
|
|
11
11
|
|
12
12
|
begin
|
13
13
|
pool.add_serialized_file(descriptor_data)
|
14
|
-
rescue TypeError
|
14
|
+
rescue TypeError
|
15
15
|
# Compatibility code: will be removed in the next major version.
|
16
16
|
require 'google/protobuf/descriptor_pb'
|
17
17
|
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
data/lib/google/protobuf.rb
CHANGED
@@ -1,32 +1,9 @@
|
|
1
1
|
# Protocol Buffers - Google's data interchange format
|
2
2
|
# Copyright 2008 Google Inc. All rights reserved.
|
3
|
-
# https://developers.google.com/protocol-buffers/
|
4
3
|
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
# * Redistributions of source code must retain the above copyright
|
10
|
-
# notice, this list of conditions and the following disclaimer.
|
11
|
-
# * Redistributions in binary form must reproduce the above
|
12
|
-
# copyright notice, this list of conditions and the following disclaimer
|
13
|
-
# in the documentation and/or other materials provided with the
|
14
|
-
# distribution.
|
15
|
-
# * Neither the name of Google Inc. nor the names of its
|
16
|
-
# contributors may be used to endorse or promote products derived from
|
17
|
-
# this software without specific prior written permission.
|
18
|
-
#
|
19
|
-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
20
|
-
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
21
|
-
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
22
|
-
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
23
|
-
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
24
|
-
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
25
|
-
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
26
|
-
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
27
|
-
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
28
|
-
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
29
|
-
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
4
|
+
# Use of this source code is governed by a BSD-style
|
5
|
+
# license that can be found in the LICENSE file or at
|
6
|
+
# https://developers.google.com/open-source/licenses/bsd
|
30
7
|
|
31
8
|
# require mixins before we hook them into the java & c code
|
32
9
|
require 'google/protobuf/message_exts'
|
@@ -39,26 +16,16 @@ module Google
|
|
39
16
|
class Error < StandardError; end
|
40
17
|
class ParseError < Error; end
|
41
18
|
class TypeError < ::TypeError; end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
if RUBY_PLATFORM == "java"
|
46
|
-
require 'json'
|
47
|
-
require 'google/protobuf_java'
|
48
|
-
else
|
49
|
-
begin
|
50
|
-
require "google/#{RUBY_VERSION.sub(/\.\d+$/, '')}/protobuf_c"
|
51
|
-
rescue LoadError
|
52
|
-
require 'google/protobuf_c'
|
53
|
-
end
|
54
19
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
20
|
+
PREFER_FFI = case ENV['PROTOCOL_BUFFERS_RUBY_IMPLEMENTATION']
|
21
|
+
when nil, "", /^native$/i
|
22
|
+
false
|
23
|
+
when /^ffi$/i
|
24
|
+
true
|
25
|
+
else
|
26
|
+
warn "Unexpected value `#{ENV['PROTOCOL_BUFFERS_RUBY_IMPLEMENTATION']}` for environment variable `PROTOCOL_BUFFERS_RUBY_IMPLEMENTATION`. Should be either \"FFI\", \"NATIVE\"."
|
27
|
+
false
|
28
|
+
end
|
62
29
|
|
63
30
|
def self.encode(msg, options = {})
|
64
31
|
msg.to_proto(options)
|
@@ -76,5 +43,19 @@ module Google
|
|
76
43
|
klass.decode_json(json, options)
|
77
44
|
end
|
78
45
|
|
46
|
+
IMPLEMENTATION = if PREFER_FFI
|
47
|
+
begin
|
48
|
+
require 'google/protobuf_ffi'
|
49
|
+
:FFI
|
50
|
+
rescue LoadError
|
51
|
+
warn "Caught exception `#{$!.message}` while loading FFI implementation of google/protobuf."
|
52
|
+
warn "Falling back to native implementation."
|
53
|
+
require 'google/protobuf_native'
|
54
|
+
:NATIVE
|
55
|
+
end
|
56
|
+
else
|
57
|
+
require 'google/protobuf_native'
|
58
|
+
:NATIVE
|
59
|
+
end
|
79
60
|
end
|
80
61
|
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# Protocol Buffers - Google's data interchange format
|
2
|
+
# Copyright 2023 Google Inc. All rights reserved.
|
3
|
+
#
|
4
|
+
# Use of this source code is governed by a BSD-style
|
5
|
+
# license that can be found in the LICENSE file or at
|
6
|
+
# https://developers.google.com/open-source/licenses/bsd
|
7
|
+
|
8
|
+
require 'ffi-compiler/loader'
|
9
|
+
require 'google/protobuf/ffi/ffi'
|
10
|
+
require 'google/protobuf/ffi/internal/type_safety'
|
11
|
+
require 'google/protobuf/ffi/internal/pointer_helper'
|
12
|
+
require 'google/protobuf/ffi/internal/arena'
|
13
|
+
require 'google/protobuf/ffi/internal/convert'
|
14
|
+
require 'google/protobuf/ffi/descriptor'
|
15
|
+
require 'google/protobuf/ffi/enum_descriptor'
|
16
|
+
require 'google/protobuf/ffi/field_descriptor'
|
17
|
+
require 'google/protobuf/ffi/oneof_descriptor'
|
18
|
+
require 'google/protobuf/ffi/descriptor_pool'
|
19
|
+
require 'google/protobuf/ffi/file_descriptor'
|
20
|
+
require 'google/protobuf/ffi/map'
|
21
|
+
require 'google/protobuf/ffi/object_cache'
|
22
|
+
require 'google/protobuf/ffi/repeated_field'
|
23
|
+
require 'google/protobuf/ffi/message'
|
24
|
+
require 'google/protobuf/descriptor_dsl'
|
25
|
+
|
26
|
+
module Google
|
27
|
+
module Protobuf
|
28
|
+
def self.deep_copy(object)
|
29
|
+
case object
|
30
|
+
when RepeatedField
|
31
|
+
RepeatedField.send(:deep_copy, object)
|
32
|
+
when Google::Protobuf::Map
|
33
|
+
Google::Protobuf::Map.deep_copy(object)
|
34
|
+
when Google::Protobuf::MessageExts
|
35
|
+
object.class.send(:deep_copy, object.instance_variable_get(:@msg))
|
36
|
+
else
|
37
|
+
raise NotImplementedError
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.discard_unknown(message)
|
42
|
+
raise FrozenError if message.frozen?
|
43
|
+
raise ArgumentError.new "Expected message, got #{message.class} instead." if message.instance_variable_get(:@msg).nil?
|
44
|
+
unless Google::Protobuf::FFI.message_discard_unknown(message.instance_variable_get(:@msg), message.class.descriptor, 128)
|
45
|
+
raise RuntimeError.new "Messages nested too deeply."
|
46
|
+
end
|
47
|
+
nil
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# Protocol Buffers - Google's data interchange format
|
2
|
+
# Copyright 2023 Google Inc. All rights reserved.
|
3
|
+
#
|
4
|
+
# Use of this source code is governed by a BSD-style
|
5
|
+
# license that can be found in the LICENSE file or at
|
6
|
+
# https://developers.google.com/open-source/licenses/bsd
|
7
|
+
|
8
|
+
if RUBY_PLATFORM == "java"
|
9
|
+
require 'json'
|
10
|
+
require 'google/protobuf_java'
|
11
|
+
else
|
12
|
+
begin
|
13
|
+
require "google/#{RUBY_VERSION.sub(/\.\d+$/, '')}/protobuf_c"
|
14
|
+
rescue LoadError
|
15
|
+
require 'google/protobuf_c'
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
require 'google/protobuf/descriptor_dsl'
|
20
|
+
require 'google/protobuf/repeated_field'
|
@@ -0,0 +1,94 @@
|
|
1
|
+
require "ffi-compiler/compile_task"
|
2
|
+
|
3
|
+
# # @param task [FFI::Compiler::CompileTask] task to configure
|
4
|
+
def configure_common_compile_task(task)
|
5
|
+
if FileUtils.pwd.include? 'ext'
|
6
|
+
src_dir = '.'
|
7
|
+
third_party_path = 'third_party/utf8_range'
|
8
|
+
else
|
9
|
+
src_dir = 'ext/google/protobuf_c'
|
10
|
+
third_party_path = 'ext/google/protobuf_c/third_party/utf8_range'
|
11
|
+
end
|
12
|
+
|
13
|
+
task.add_include_path third_party_path
|
14
|
+
task.add_define 'NDEBUG'
|
15
|
+
task.cflags << "-std=gnu99 -O3"
|
16
|
+
[
|
17
|
+
:convert, :defs, :map, :message, :protobuf, :repeated_field, :wrap_memcpy
|
18
|
+
].each { |file| task.exclude << "/#{file}.c" }
|
19
|
+
task.ext_dir = src_dir
|
20
|
+
task.source_dirs = [src_dir]
|
21
|
+
if RbConfig::CONFIG['target_os'] =~ /darwin|linux/
|
22
|
+
task.cflags << "-Wall -Wsign-compare -Wno-declaration-after-statement"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
# FFI::CompilerTask's constructor walks the filesystem at task definition time
|
27
|
+
# to create subtasks for each source file, so files from third_party must be
|
28
|
+
# copied into place before the task is defined for it to work correctly.
|
29
|
+
# TODO Is there a sane way to check for generated protos under lib too?
|
30
|
+
def with_generated_files
|
31
|
+
expected_path = FileUtils.pwd.include?('ext') ? 'third_party/utf8_range' : 'ext/google/protobuf_c/third_party/utf8_range'
|
32
|
+
if File.directory?(expected_path)
|
33
|
+
yield
|
34
|
+
else
|
35
|
+
task :default do
|
36
|
+
# It is possible, especially in cases like the first invocation of
|
37
|
+
# `rake test` following `rake clean` or a fresh checkout that the
|
38
|
+
# `copy_third_party` task has been executed since initial task definition.
|
39
|
+
# If so, run the task definition block now and invoke it explicitly.
|
40
|
+
if File.directory?(expected_path)
|
41
|
+
yield
|
42
|
+
Rake::Task[:default].invoke
|
43
|
+
else
|
44
|
+
raise "Missing directory #{File.absolute_path(expected_path)}." +
|
45
|
+
" Did you forget to run `rake copy_third_party` before building" +
|
46
|
+
" native extensions?"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
desc "Compile Protobuf library for FFI"
|
53
|
+
namespace "ffi-protobuf" do
|
54
|
+
with_generated_files do
|
55
|
+
# Compile Ruby UPB separately in order to limit use of -DUPB_BUILD_API to one
|
56
|
+
# compilation unit.
|
57
|
+
desc "Compile UPB library for FFI"
|
58
|
+
namespace "ffi-upb" do
|
59
|
+
with_generated_files do
|
60
|
+
FFI::Compiler::CompileTask.new('ruby-upb') do |c|
|
61
|
+
configure_common_compile_task c
|
62
|
+
c.add_define "UPB_BUILD_API"
|
63
|
+
c.exclude << "/glue.c"
|
64
|
+
c.exclude << "/shared_message.c"
|
65
|
+
c.exclude << "/shared_convert.c"
|
66
|
+
if RbConfig::CONFIG['target_os'] =~ /darwin|linux/
|
67
|
+
c.cflags << "-fvisibility=hidden"
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
FFI::Compiler::CompileTask.new 'protobuf_c_ffi' do |c|
|
74
|
+
configure_common_compile_task c
|
75
|
+
# Ruby UPB was already compiled with different flags.
|
76
|
+
c.exclude << "/range2-neon.c"
|
77
|
+
c.exclude << "/range2-sse.c"
|
78
|
+
c.exclude << "/naive.c"
|
79
|
+
c.exclude << "/ruby-upb.c"
|
80
|
+
end
|
81
|
+
|
82
|
+
# Setup dependencies so that the .o files generated by building ffi-upb are
|
83
|
+
# available to link here.
|
84
|
+
# TODO Can this be simplified? Can the single shared library be used
|
85
|
+
# instead of the object files?
|
86
|
+
protobuf_c_task = Rake::Task[:default]
|
87
|
+
protobuf_c_shared_lib_task = Rake::Task[protobuf_c_task.prereqs.last]
|
88
|
+
ruby_upb_shared_lib_task = Rake::Task[:"ffi-upb:default"].prereqs.first
|
89
|
+
Rake::Task[ruby_upb_shared_lib_task].prereqs.each do |dependency|
|
90
|
+
protobuf_c_shared_lib_task.prereqs.prepend dependency
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
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.0.rc.1
|
5
5
|
platform: x86_64-linux
|
6
6
|
authors:
|
7
7
|
- Protobuf Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-16 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
|
@@ -64,11 +106,13 @@ executables: []
|
|
64
106
|
extensions: []
|
65
107
|
extra_rdoc_files: []
|
66
108
|
files:
|
109
|
+
- ext/google/protobuf_c/Rakefile
|
67
110
|
- ext/google/protobuf_c/convert.c
|
68
111
|
- ext/google/protobuf_c/convert.h
|
69
112
|
- ext/google/protobuf_c/defs.c
|
70
113
|
- ext/google/protobuf_c/defs.h
|
71
114
|
- ext/google/protobuf_c/extconf.rb
|
115
|
+
- ext/google/protobuf_c/glue.c
|
72
116
|
- ext/google/protobuf_c/map.c
|
73
117
|
- ext/google/protobuf_c/map.h
|
74
118
|
- ext/google/protobuf_c/message.c
|
@@ -79,6 +123,10 @@ files:
|
|
79
123
|
- ext/google/protobuf_c/repeated_field.h
|
80
124
|
- ext/google/protobuf_c/ruby-upb.c
|
81
125
|
- ext/google/protobuf_c/ruby-upb.h
|
126
|
+
- ext/google/protobuf_c/shared_convert.c
|
127
|
+
- ext/google/protobuf_c/shared_convert.h
|
128
|
+
- ext/google/protobuf_c/shared_message.c
|
129
|
+
- ext/google/protobuf_c/shared_message.h
|
82
130
|
- ext/google/protobuf_c/third_party/utf8_range/LICENSE
|
83
131
|
- ext/google/protobuf_c/third_party/utf8_range/naive.c
|
84
132
|
- ext/google/protobuf_c/third_party/utf8_range/range2-neon.c
|
@@ -96,6 +144,21 @@ files:
|
|
96
144
|
- lib/google/protobuf/descriptor_pb.rb
|
97
145
|
- lib/google/protobuf/duration_pb.rb
|
98
146
|
- lib/google/protobuf/empty_pb.rb
|
147
|
+
- lib/google/protobuf/ffi/descriptor.rb
|
148
|
+
- lib/google/protobuf/ffi/descriptor_pool.rb
|
149
|
+
- lib/google/protobuf/ffi/enum_descriptor.rb
|
150
|
+
- lib/google/protobuf/ffi/ffi.rb
|
151
|
+
- lib/google/protobuf/ffi/field_descriptor.rb
|
152
|
+
- lib/google/protobuf/ffi/file_descriptor.rb
|
153
|
+
- lib/google/protobuf/ffi/internal/arena.rb
|
154
|
+
- lib/google/protobuf/ffi/internal/convert.rb
|
155
|
+
- lib/google/protobuf/ffi/internal/pointer_helper.rb
|
156
|
+
- lib/google/protobuf/ffi/internal/type_safety.rb
|
157
|
+
- lib/google/protobuf/ffi/map.rb
|
158
|
+
- lib/google/protobuf/ffi/message.rb
|
159
|
+
- lib/google/protobuf/ffi/object_cache.rb
|
160
|
+
- lib/google/protobuf/ffi/oneof_descriptor.rb
|
161
|
+
- lib/google/protobuf/ffi/repeated_field.rb
|
99
162
|
- lib/google/protobuf/field_mask_pb.rb
|
100
163
|
- lib/google/protobuf/message_exts.rb
|
101
164
|
- lib/google/protobuf/object_cache.rb
|
@@ -107,11 +170,14 @@ files:
|
|
107
170
|
- lib/google/protobuf/type_pb.rb
|
108
171
|
- lib/google/protobuf/well_known_types.rb
|
109
172
|
- lib/google/protobuf/wrappers_pb.rb
|
173
|
+
- lib/google/protobuf_ffi.rb
|
174
|
+
- lib/google/protobuf_native.rb
|
175
|
+
- lib/google/tasks/ffi.rake
|
110
176
|
homepage: https://developers.google.com/protocol-buffers
|
111
177
|
licenses:
|
112
178
|
- BSD-3-Clause
|
113
179
|
metadata:
|
114
|
-
source_code_uri: https://github.com/protocolbuffers/protobuf/tree/v3.
|
180
|
+
source_code_uri: https://github.com/protocolbuffers/protobuf/tree/v3.25.0-rc1/ruby
|
115
181
|
post_install_message:
|
116
182
|
rdoc_options: []
|
117
183
|
require_paths:
|
@@ -126,9 +192,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
126
192
|
version: 3.3.dev
|
127
193
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
194
|
requirements:
|
129
|
-
- - "
|
195
|
+
- - ">"
|
130
196
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
197
|
+
version: 1.3.1
|
132
198
|
requirements: []
|
133
199
|
rubygems_version: 3.3.26
|
134
200
|
signing_key:
|