ffi 1.17.0.rc2-aarch64-linux-musl → 1.17.1-aarch64-linux-musl

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cc62c789e5f462dcccc18b078d45ff2b81db38b52bf7adc9b1f9280307be17fc
4
- data.tar.gz: c85948343ff05b530ea90b526f8d944f3f180628e270c0500ef2cc9e8406a1d9
3
+ metadata.gz: a61fd2afc46a0f80875d1ba9337cdd6b9bef9e42c82be719c367b6801cd672cf
4
+ data.tar.gz: 159da5e93b911f0836672f7c5fe94a30d32b2fb0a48d34294113b0c7e5fd8918
5
5
  SHA512:
6
- metadata.gz: 83519770b1ba42ffc3a2e5cf9649e2c2544c5f48d7d49d1b05b504b8a85b20960ed553e796f46883c5c88eec170bfc306829dd18d558cf01e6d1179ecbe6a916
7
- data.tar.gz: 8cc85e22e507b5202c84623d2a4c3038b13bae1b48ce8807deb6f92ccde84d93c15d7575f91a5605bcbf18f2d774b2c30b7b7d4448dd4aebb36f6eefcefb85be
6
+ metadata.gz: df4c747505a8e8f514752a0bfe76865495ed08b6a83501c148043671628ebb7a327a541d47953716b7316fd012ccbe58104dd37aeeae128a3caa26ba6740b20c
7
+ data.tar.gz: bfb5a48169c350c2eda74dfe06c4313f408b9bc9a4bcf455df75ae1b0f4fa09982c382d6e707f19e1235c88fe6718de2c0fcd7c8bf2f5504d8652287b7171042
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ 1.17.1 / 2024-12-30
2
+ -------------------
3
+
4
+ Fixed:
5
+ * #1117 Restart async callback dispatcher thread after fork.
6
+ * #1133 Add ruby-3.4 native gem.
7
+ * #1134 Fix FFI::DataConverter non-generic usage in RBS files.
8
+
9
+
10
+ 1.17.0 / 2024-06-02
11
+ -------------------
12
+
13
+ Fixed:
14
+ * Add FFI::AbstractMemory#read_array_of_string . It was defined but not exposed to Ruby nor tested. #1070
15
+
16
+
1
17
  1.17.0.rc2 / 2024-04-22
2
18
  -------------------
3
19
 
data/Gemfile CHANGED
@@ -1,11 +1,11 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  group :development do
4
- gem 'bigdecimal' unless RUBY_VERSION =~ /^2\.[4567]|^3\.[012]\./ # necessary on ruby-3.3+
4
+ gem 'bigdecimal' # necessary on ruby-3.3+
5
5
  gem 'bundler', '>= 1.16', '< 3'
6
6
  gem 'rake', '~> 13.0'
7
7
  gem 'rake-compiler', '~> 1.1'
8
- gem 'rake-compiler-dock', '~> 1.0.pre'
8
+ gem 'rake-compiler-dock', '~> 1.7.0'
9
9
  gem 'rspec', '~> 3.0'
10
10
  end
11
11
 
data/Rakefile CHANGED
@@ -136,7 +136,7 @@ namespace "gem" do
136
136
  desc "Build the native gem for #{plat}"
137
137
  task plat => ['prepare', 'build'] do
138
138
  RakeCompilerDock.sh <<-EOT, platform: plat
139
- #{ "sudo apt-get update && sudo apt-get install -y libltdl-dev &&" if plat !~ /linux/ }
139
+ sudo apt-get update && sudo apt-get install -y libltdl-dev &&
140
140
  bundle --local &&
141
141
  rake native:#{plat} pkg/#{gem_spec.full_name}-#{plat}.gem MAKE='nice make -j`nproc`' RUBY_CC_VERSION=${RUBY_CC_VERSION/:2.4.0/}
142
142
  EOT
data/lib/2.5/ffi_c.so CHANGED
Binary file
data/lib/2.6/ffi_c.so CHANGED
Binary file
data/lib/2.7/ffi_c.so CHANGED
Binary file
data/lib/3.0/ffi_c.so CHANGED
Binary file
data/lib/3.1/ffi_c.so CHANGED
Binary file
data/lib/3.2/ffi_c.so CHANGED
Binary file
data/lib/3.3/ffi_c.so CHANGED
Binary file
data/lib/3.4/ffi_c.so ADDED
Binary file
@@ -45,14 +45,6 @@ module FFI
45
45
  # @note WARNING: passing a proc _may_ cause your pointer to never be
46
46
  # GC'd, unless you're careful to avoid trapping a reference to the
47
47
  # pointer in the proc. See the test specs for examples.
48
- # @overload initialize(pointer) { |p| ... }
49
- # @param pointer [Pointer]
50
- # @yieldparam [Pointer] p +pointer+ passed to the block
51
- # @return [self]
52
- # The passed block will be invoked at GC time.
53
- # @note
54
- # WARNING: passing a block will cause your pointer to never be GC'd.
55
- # This is bad.
56
48
  # @overload initialize(pointer)
57
49
  # @param pointer [Pointer]
58
50
  # @return [self]
@@ -75,7 +67,7 @@ module FFI
75
67
  # The last calling idiom (only one parameter) is generally only
76
68
  # going to be useful if you subclass {AutoPointer}, and override
77
69
  # #release, which by default does nothing.
78
- def initialize(ptr, proc=nil, &block)
70
+ def initialize(ptr, proc=nil)
79
71
  raise TypeError, "Invalid pointer" if ptr.nil? || !ptr.kind_of?(Pointer) ||
80
72
  ptr.kind_of?(MemoryPointer) || ptr.kind_of?(AutoPointer)
81
73
  super(ptr.type_size, ptr)
data/lib/ffi/ffi.rb CHANGED
@@ -48,3 +48,62 @@ require 'ffi/variadic'
48
48
  require 'ffi/enum'
49
49
  require 'ffi/version'
50
50
  require 'ffi/function'
51
+
52
+ module FFI
53
+ module ModernForkTracking
54
+ def _fork
55
+ pid = super
56
+ if pid == 0
57
+ FFI._async_cb_dispatcher_atfork_child
58
+ end
59
+ pid
60
+ end
61
+ end
62
+
63
+ module LegacyForkTracking
64
+ module KernelExt
65
+ def fork
66
+ if block_given?
67
+ super do
68
+ FFI._async_cb_dispatcher_atfork_child
69
+ yield
70
+ end
71
+ else
72
+ pid = super
73
+ FFI._async_cb_dispatcher_atfork_child if pid.nil?
74
+ pid
75
+ end
76
+ end
77
+ end
78
+
79
+ module KernelExtPrivate
80
+ include KernelExt
81
+ private :fork
82
+ end
83
+
84
+ module IOExt
85
+ def popen(*args)
86
+ return super unless args[0] == '-'
87
+
88
+ super(*args) do |pipe|
89
+ FFI._async_cb_dispatcher_atfork_child if pipe.nil?
90
+ yield pipe
91
+ end
92
+ end
93
+ ruby2_keywords :popen if respond_to?(:ruby2_keywords)
94
+ end
95
+ end
96
+
97
+ if Process.respond_to?(:_fork)
98
+ # The nice Ruby 3.1+ way of doing things
99
+ ::Process.singleton_class.prepend(ModernForkTracking)
100
+ elsif Process.respond_to?(:fork)
101
+ # Barf. Old CRuby.
102
+ # Most of the inspiration for how to do this was stolen from ActiveSupport.
103
+ ::Object.prepend(LegacyForkTracking::KernelExtPrivate)
104
+ ::Object.singleton_class.prepend(LegacyForkTracking::KernelExt)
105
+ ::Kernel.prepend(LegacyForkTracking::KernelExtPrivate)
106
+ ::Kernel.singleton_class.prepend(LegacyForkTracking::KernelExt)
107
+ ::IO.singleton_class.prepend(LegacyForkTracking::IOExt)
108
+ end
109
+ end
data/lib/ffi/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module FFI
2
- VERSION = '1.17.0.rc2'
2
+ VERSION = '1.17.1'
3
3
  end
@@ -144,6 +144,7 @@ module FFI
144
144
  def read_array_of_float: (Integer length) -> Array[Float]
145
145
  def read_array_of_double: (Integer length) -> Array[Float]
146
146
  def read_array_of_pointer: (Integer length) -> Array[Pointer]
147
+ def read_array_of_string: (?Integer? count) -> Array[String?]
147
148
 
148
149
  def write_array_of_int8: (Array[int] ary) -> self
149
150
  def write_array_of_int16: (Array[int] ary) -> self
@@ -13,7 +13,6 @@ module FFI
13
13
  end
14
14
 
15
15
  def initialize: (Pointer pointer, Method | ^(self) -> void | Releaser::_Proc[self] callable) -> self
16
- # | (Pointer pointer) { (self) -> void } -> self # https://github.com/ffi/ffi/issues/1071
17
16
  | (Pointer pointer) -> self # where class < `def self.release: (instance pointer) -> void`
18
17
 
19
18
  extend DataConverter[Pointer, instance, nil]
data/sig/ffi/library.rbs CHANGED
@@ -33,7 +33,7 @@ module FFI
33
33
  def find_type: (ffi_lib_type t) -> Type
34
34
  def freeze: () -> void
35
35
  def function_names: (_ToS name, Array[Type | singleton(Struct)] arg_types) -> Array[String]
36
- def typedef: [T < Type] (T old, Symbol | DataConverter add, ?untyped) -> T
36
+ def typedef: [T < Type, N, R, C] (T old, Symbol | DataConverter[N, R, C] add, ?untyped) -> T
37
37
  | (Symbol old, Symbol add, ?untyped) -> (Type | Enum)
38
38
  | [X < DataConverter[N, R, C], N, R, C] (X old, Symbol add, ?untyped) -> Type::Mapped[X, N, R, C]
39
39
  | (:enum old, Array[Symbol | Integer] add, ?untyped) -> Enum
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.17.0.rc2
4
+ version: 1.17.1
5
5
  platform: aarch64-linux-musl
6
6
  authors:
7
7
  - Wayne Meissner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-22 00:00:00.000000000 Z
11
+ date: 2024-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -87,6 +87,7 @@ files:
87
87
  - lib/3.1/ffi_c.so
88
88
  - lib/3.2/ffi_c.so
89
89
  - lib/3.3/ffi_c.so
90
+ - lib/3.4/ffi_c.so
90
91
  - lib/ffi.rb
91
92
  - lib/ffi/abstract_memory.rb
92
93
  - lib/ffi/autopointer.rb
@@ -227,12 +228,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
227
228
  version: '2.5'
228
229
  - - "<"
229
230
  - !ruby/object:Gem::Version
230
- version: 3.4.dev
231
+ version: 3.5.dev
231
232
  required_rubygems_version: !ruby/object:Gem::Requirement
232
233
  requirements:
233
- - - ">"
234
- - !ruby/object:Gem::Version
235
- version: 1.3.1
236
234
  - - ">="
237
235
  - !ruby/object:Gem::Version
238
236
  version: 3.3.22