Run of fresh-releases for ruby-thrift

Merge these changes:

git pull https://janitor.debian.net/git/ruby-thrift fresh-releases/main
git pull https://janitor.debian.net/git/ruby-thrift fresh-releases/pristine-tar
git pull https://janitor.debian.net/git/ruby-thrift fresh-releases/upstream

Summary

Merged new upstream version: 0.16.0 (was: 0.14.0).

Diff

Branch: main

diff --git a/debian/changelog b/debian/changelog
index 1fa9578..5f89fe4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+ruby-thrift (0.16.0-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Mon, 16 May 2022 14:56:56 -0000
+
 ruby-thrift (0.14.0-3) unstable; urgency=medium
 
   * Team upload
diff --git a/ext/compact_protocol.c b/ext/compact_protocol.c
index c0f46b9..fab2170 100644
--- a/ext/compact_protocol.c
+++ b/ext/compact_protocol.c
@@ -567,6 +567,7 @@ VALUE rb_thrift_compact_proto_read_binary(VALUE self) {
 
 static void Init_constants() {
   thrift_compact_protocol_class = rb_const_get(thrift_module, rb_intern("CompactProtocol"));
+  rb_global_variable(&thrift_compact_protocol_class);
 
   VERSION = rb_num2ll(rb_const_get(thrift_compact_protocol_class, rb_intern("VERSION")));
   VERSION_MASK = rb_num2ll(rb_const_get(thrift_compact_protocol_class, rb_intern("VERSION_MASK")));
diff --git a/ext/struct.c b/ext/struct.c
index e3aa855..79cbabe 100644
--- a/ext/struct.c
+++ b/ext/struct.c
@@ -698,14 +698,23 @@ void Init_struct() {
   rb_define_method(struct_module, "read", rb_thrift_struct_read, 1);
 
   thrift_union_class = rb_const_get(thrift_module, rb_intern("Union"));
+  rb_global_variable(&thrift_union_class);
 
   rb_define_method(thrift_union_class, "write", rb_thrift_union_write, 1);
   rb_define_method(thrift_union_class, "read", rb_thrift_union_read, 1);
 
   setfield_id = rb_intern("@setfield");
+  rb_global_variable(&setfield_id);
+
   setvalue_id = rb_intern("@value");
+  rb_global_variable(&setvalue_id);
 
   to_s_method_id = rb_intern("to_s");
+  rb_global_variable(&to_s_method_id);
+
   name_to_id_method_id = rb_intern("name_to_id");
+  rb_global_variable(&name_to_id_method_id);
+
   sorted_field_ids_method_id = rb_intern("sorted_field_ids");
+  rb_global_variable(&sorted_field_ids_method_id);
 }
diff --git a/ext/thrift_native.c b/ext/thrift_native.c
index 3430b7c..d535454 100644
--- a/ext/thrift_native.c
+++ b/ext/thrift_native.c
@@ -112,10 +112,19 @@ VALUE protocol_exception_class;
 void Init_thrift_native() {
   // cached classes
   thrift_module = rb_const_get(rb_cObject, rb_intern("Thrift"));
+  rb_global_variable(&thrift_module);
+
   thrift_bytes_module = rb_const_get(thrift_module, rb_intern("Bytes"));
+  rb_global_variable(&thrift_bytes_module);
+
   thrift_types_module = rb_const_get(thrift_module, rb_intern("Types"));
+  rb_global_variable(&thrift_types_module);
+
   rb_cSet = rb_const_get(rb_cObject, rb_intern("Set"));
+  rb_global_variable(&rb_cSet);
+
   protocol_exception_class = rb_const_get(thrift_module, rb_intern("ProtocolException"));
+  rb_global_variable(&protocol_exception_class);
 
   // Init ttype constants
   TTYPE_BOOL = FIX2INT(rb_const_get(thrift_types_module, rb_intern("BOOL")));
@@ -194,6 +203,14 @@ void Init_thrift_native() {
   class_sym = ID2SYM(rb_intern("class"));
   binary_sym = ID2SYM(rb_intern("binary"));
 
+  rb_global_variable(&type_sym);
+  rb_global_variable(&name_sym);
+  rb_global_variable(&key_sym);
+  rb_global_variable(&value_sym);
+  rb_global_variable(&element_sym);
+  rb_global_variable(&class_sym);
+  rb_global_variable(&binary_sym);
+
   Init_struct();
   Init_binary_protocol_accelerated();
   Init_compact_protocol();
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 5bf98d0..7c16507 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -62,3 +62,8 @@ end
 
 $:.unshift File.join(File.dirname(__FILE__), *%w[gen-rb/flat])
 
+if defined?(GC.verify_compaction_references) == 'method'
+  # This method was added in Ruby 3.0.0. Calling it this way asks the GC to
+  # move objects around, helping to find object movement bugs.
+  GC.verify_compaction_references(double_heap: true, toward: :empty)
+end
diff --git a/thrift.gemspec b/thrift.gemspec
index 4a056b4..9a2f8d9 100644
Binary files a/thrift.gemspec and b/thrift.gemspec differ

Branch: pristine-tar

diff --git a/ruby-thrift_0.16.0.orig.tar.gz.delta b/ruby-thrift_0.16.0.orig.tar.gz.delta
new file mode 100644
index 0000000..9a21fc4
Binary files /dev/null and b/ruby-thrift_0.16.0.orig.tar.gz.delta differ
diff --git a/ruby-thrift_0.16.0.orig.tar.gz.id b/ruby-thrift_0.16.0.orig.tar.gz.id
new file mode 100644
index 0000000..89103f1
--- /dev/null
+++ b/ruby-thrift_0.16.0.orig.tar.gz.id
@@ -0,0 +1 @@
+59b458a298d3934a546cf554c0ed5c3bf3ceeb38

Branch: upstream

Tag: upstream/0.16.0
diff --git a/ext/compact_protocol.c b/ext/compact_protocol.c
index c0f46b9..fab2170 100644
--- a/ext/compact_protocol.c
+++ b/ext/compact_protocol.c
@@ -567,6 +567,7 @@ VALUE rb_thrift_compact_proto_read_binary(VALUE self) {
 
 static void Init_constants() {
   thrift_compact_protocol_class = rb_const_get(thrift_module, rb_intern("CompactProtocol"));
+  rb_global_variable(&thrift_compact_protocol_class);
 
   VERSION = rb_num2ll(rb_const_get(thrift_compact_protocol_class, rb_intern("VERSION")));
   VERSION_MASK = rb_num2ll(rb_const_get(thrift_compact_protocol_class, rb_intern("VERSION_MASK")));
diff --git a/ext/struct.c b/ext/struct.c
index e3aa855..79cbabe 100644
--- a/ext/struct.c
+++ b/ext/struct.c
@@ -698,14 +698,23 @@ void Init_struct() {
   rb_define_method(struct_module, "read", rb_thrift_struct_read, 1);
 
   thrift_union_class = rb_const_get(thrift_module, rb_intern("Union"));
+  rb_global_variable(&thrift_union_class);
 
   rb_define_method(thrift_union_class, "write", rb_thrift_union_write, 1);
   rb_define_method(thrift_union_class, "read", rb_thrift_union_read, 1);
 
   setfield_id = rb_intern("@setfield");
+  rb_global_variable(&setfield_id);
+
   setvalue_id = rb_intern("@value");
+  rb_global_variable(&setvalue_id);
 
   to_s_method_id = rb_intern("to_s");
+  rb_global_variable(&to_s_method_id);
+
   name_to_id_method_id = rb_intern("name_to_id");
+  rb_global_variable(&name_to_id_method_id);
+
   sorted_field_ids_method_id = rb_intern("sorted_field_ids");
+  rb_global_variable(&sorted_field_ids_method_id);
 }
diff --git a/ext/thrift_native.c b/ext/thrift_native.c
index 3430b7c..d535454 100644
--- a/ext/thrift_native.c
+++ b/ext/thrift_native.c
@@ -112,10 +112,19 @@ VALUE protocol_exception_class;
 void Init_thrift_native() {
   // cached classes
   thrift_module = rb_const_get(rb_cObject, rb_intern("Thrift"));
+  rb_global_variable(&thrift_module);
+
   thrift_bytes_module = rb_const_get(thrift_module, rb_intern("Bytes"));
+  rb_global_variable(&thrift_bytes_module);
+
   thrift_types_module = rb_const_get(thrift_module, rb_intern("Types"));
+  rb_global_variable(&thrift_types_module);
+
   rb_cSet = rb_const_get(rb_cObject, rb_intern("Set"));
+  rb_global_variable(&rb_cSet);
+
   protocol_exception_class = rb_const_get(thrift_module, rb_intern("ProtocolException"));
+  rb_global_variable(&protocol_exception_class);
 
   // Init ttype constants
   TTYPE_BOOL = FIX2INT(rb_const_get(thrift_types_module, rb_intern("BOOL")));
@@ -194,6 +203,14 @@ void Init_thrift_native() {
   class_sym = ID2SYM(rb_intern("class"));
   binary_sym = ID2SYM(rb_intern("binary"));
 
+  rb_global_variable(&type_sym);
+  rb_global_variable(&name_sym);
+  rb_global_variable(&key_sym);
+  rb_global_variable(&value_sym);
+  rb_global_variable(&element_sym);
+  rb_global_variable(&class_sym);
+  rb_global_variable(&binary_sym);
+
   Init_struct();
   Init_binary_protocol_accelerated();
   Init_compact_protocol();
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 5bf98d0..7c16507 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -62,3 +62,8 @@ end
 
 $:.unshift File.join(File.dirname(__FILE__), *%w[gen-rb/flat])
 
+if defined?(GC.verify_compaction_references) == 'method'
+  # This method was added in Ruby 3.0.0. Calling it this way asks the GC to
+  # move objects around, helping to find object movement bugs.
+  GC.verify_compaction_references(double_heap: true, toward: :empty)
+end
diff --git a/thrift.gemspec b/thrift.gemspec
index 4a056b4..9a2f8d9 100644
Binary files a/thrift.gemspec and b/thrift.gemspec differ

Publish Blockers

  • ☑ run was successful
  • ☑ package has not been removed from the archive
  • ☑ command has not changed
  • ☒ not yet reviewed, but review needed
  • ☑ 0 publish attempts so far.not currently attempting to back off
  • ☒ merge proposals for the package maintainer are currently being rate-limited (open: 1258, max open: 200)
  • ☑ change set 8d55b0df-48d0-42e2-b383-06ba7e30bfe9 is ready

Resulting package

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-releases ruby-thrift-dbgsymapt install -t fresh-releases ruby-thrift

Lintian Result

Full worker log Full build log