public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rubygem-http_parser.rb] rawhide: Backport upstream patch to use TypedData API needed for ruby4.1
@ 2026-10-28 14:39 Mamoru TASAKA
0 siblings, 0 replies; only message in thread
From: Mamoru TASAKA @ 2026-10-28 14:39 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/rubygem-http_parser.rb
Branch : rawhide
Commit : eea928e179b0dc9f9c0d67d168855bae1d4ae250
Author : Mamoru TASAKA <mtasaka@fedoraproject.org>
Date : 2026-10-28T23:39:04+09:00
Stats : +64/-1 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/rubygem-http_parser.rb/c/eea928e179b0dc9f9c0d67d168855bae1d4ae250?branch=rawhide
Log:
Backport upstream patch to use TypedData API needed for ruby4.1
---
diff --git a/http_parser.rb-pr87-TypedData.patch b/http_parser.rb-pr87-TypedData.patch
new file mode 100644
index 0000000..810206b
--- /dev/null
+++ b/http_parser.rb-pr87-TypedData.patch
@@ -0,0 +1,57 @@
+From c95152cc1529424f80ca6b6a3890e06e91fab0b2 Mon Sep 17 00:00:00 2001
+From: Nobuyoshi Nakada <nobu@ruby-lang.org>
+Date: Mon, 22 Dec 2025 22:27:50 +0900
+Subject: [PATCH] Use typed data APIs
+
+Untyped data APIs are deprecated.
+---
+ ext/ruby_http_parser/ext_help.h | 7 ++++++-
+ ext/ruby_http_parser/ruby_http_parser.c | 10 +++++++++-
+ 2 files changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/ext/ruby_http_parser/ext_help.h b/ext/ruby_http_parser/ext_help.h
+index a919dff..f9a0bf6 100644
+--- a/ext/ruby_http_parser/ext_help.h
++++ b/ext/ruby_http_parser/ext_help.h
+@@ -2,7 +2,12 @@
+ #define ext_help_h
+
+ #define RAISE_NOT_NULL(T) if(T == NULL) rb_raise(rb_eArgError, "NULL found for " # T " when shouldn't be.");
+-#define DATA_GET(from,type,name) Data_Get_Struct(from,type,name); RAISE_NOT_NULL(name);
++#ifdef TypedData_Get_Struct
++#define DATA_GET_STRUCT(from,type,name) TypedData_Get_Struct(from,type,&type##_type,name)
++#else
++#define DATA_GET_STRUCT(from,type,name) Data_Get_Struct(from,type,name)
++#endif
++#define DATA_GET(from,type,name) DATA_GET_STRUCT(from,type,name); RAISE_NOT_NULL(name);
+ #define REQUIRE_TYPE(V, T) if(TYPE(V) != T) rb_raise(rb_eTypeError, "Wrong argument type for " # V " required " # T);
+
+ /* for compatibility with Ruby 1.8.5, which doesn't declare RSTRING_PTR */
+diff --git a/ext/ruby_http_parser/ruby_http_parser.c b/ext/ruby_http_parser/ruby_http_parser.c
+index e30f349..c506e22 100644
+--- a/ext/ruby_http_parser/ruby_http_parser.c
++++ b/ext/ruby_http_parser/ruby_http_parser.c
+@@ -81,6 +81,14 @@ void ParserWrapper_free(void *data) {
+ }
+ }
+
++static const rb_data_type_t ParserWrapper_type = {
++ "ParserWrapper",
++ {
++ ParserWrapper_mark,
++ ParserWrapper_free,
++ },
++};
++
+ static VALUE cParser;
+ static VALUE cRequestParser;
+ static VALUE cResponseParser;
+@@ -293,7 +301,7 @@ VALUE Parser_alloc_by_type(VALUE klass, enum ryah_http_parser_type type) {
+
+ ParserWrapper_init(wrapper);
+
+- return Data_Wrap_Struct(klass, ParserWrapper_mark, ParserWrapper_free, wrapper);
++ return TypedData_Wrap_Struct(klass, &ParserWrapper_type, wrapper);
+ }
+
+ VALUE Parser_alloc(VALUE klass) {
diff --git a/rubygem-http_parser.rb.spec b/rubygem-http_parser.rb.spec
index e3ad0df..8902cbb 100644
--- a/rubygem-http_parser.rb.spec
+++ b/rubygem-http_parser.rb.spec
@@ -2,7 +2,7 @@
Name: rubygem-%{gem_name}
Version: 0.8.0
-Release: 12%{?dist}
+Release: 13%{?dist}
Summary: Simple callback-based HTTP request/response parser
License: MIT
URL: https://github.com/tmm1/http_parser.rb
@@ -10,6 +10,9 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# https://github.com/tmm1/http_parser.rb/pull/86
# Support ruby3_5 Ractor change
Patch0: http_parser.rb-pr86-ruby35-Ractor-change.patch
+# https://github.com/tmm1/http_parser.rb/pull/87
+# Use TypedData API, needed for ruby4.1
+Patch1: http_parser.rb-pr87-TypedData.patch
BuildRequires: gcc
BuildRequires: rubygems-devel
BuildRequires: ruby-devel
@@ -82,6 +85,9 @@ popd
%{gem_instdir}/tasks
%changelog
+* Wed Oct 28 2026 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.8.0-13
+- Backport upstream patch to use TypedData API needed for ruby4.1
+
* Fri Jul 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-28 14:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-28 14:39 [rpms/rubygem-http_parser.rb] rawhide: Backport upstream patch to use TypedData API needed for ruby4.1 Mamoru TASAKA
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox