From a5cdb5c7d9d73884b2a2f25165d46ebbc61720c9 Mon Sep 17 00:00:00 2001 From: Vernes Pendic Date: Thu, 3 Sep 2026 14:24:17 +0200 Subject: [PATCH 1/2] Fix GCC 15 compile error from RUBY_METHOD_FUNC Pass arity -1 methods to rb_define_singleton_method without the cast so heroku-26 / GCC 15 no longer treats the pointer type as an error. This is the original Ruby C API and stays compatible with GCC 13 and clang. --- CHANGELOG.md | 5 +++++ Gemfile.lock | 2 +- ext/page_print/page_print.c | 4 ++-- lib/page_print/version.rb | 2 +- page_print.gemspec | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..845fb65 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +## 0.1.11 + +- Register `PagePrint.render` and `PagePrint.render_to_file` with the original `rb_define_singleton_method` function-pointer API instead of `RUBY_METHOD_FUNC`. That removes a GCC 15 / C23 incompatible-pointer-types error that blocked source builds on Heroku-26, while remaining compatible with older compilers such as GCC 13 on Heroku-24 and macOS clang. diff --git a/Gemfile.lock b/Gemfile.lock index 370c8b6..8d297f0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - page_print (0.1.10) + page_print (0.1.11) GEM remote: https://rubygems.org/ diff --git a/ext/page_print/page_print.c b/ext/page_print/page_print.c index cabe92d..5e02f50 100644 --- a/ext/page_print/page_print.c +++ b/ext/page_print/page_print.c @@ -996,6 +996,6 @@ void Init_page_print(void) { id_mm = rb_intern_const("mm"); id_px = rb_intern_const("px"); - rb_define_singleton_method(mPagePrint, "render_to_file", RUBY_METHOD_FUNC(pageprint_render_to_file), -1); - rb_define_singleton_method(mPagePrint, "render", RUBY_METHOD_FUNC(pageprint_render), -1); + rb_define_singleton_method(mPagePrint, "render_to_file", pageprint_render_to_file, -1); + rb_define_singleton_method(mPagePrint, "render", pageprint_render, -1); } diff --git a/lib/page_print/version.rb b/lib/page_print/version.rb index e6a6a2e..19a2bcd 100644 --- a/lib/page_print/version.rb +++ b/lib/page_print/version.rb @@ -1,3 +1,3 @@ module PagePrint - VERSION = '0.1.10' + VERSION = '0.1.11' end diff --git a/page_print.gemspec b/page_print.gemspec index e51cab8..3c9c365 100644 --- a/page_print.gemspec +++ b/page_print.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |spec| File.directory?(path) || path.start_with?('lib/page_print/vendor/') || path.match?(%r{/(?:Makefile|mkmf\.log|.*\.(?:o|bundle))\z}) - end + Dir.glob('docs/*.md') + ['README.md', 'LICENSE'] + end + Dir.glob('docs/*.md') + ['README.md', 'CHANGELOG.md', 'LICENSE'] spec.bindir = 'exe' spec.executables = [] spec.require_paths = ['lib'] From 55fbb94d0d9ef67d31ed3923dc351e514cda1b5e Mon Sep 17 00:00:00 2001 From: Vernes Pendic Date: Thu, 3 Sep 2026 14:59:58 +0200 Subject: [PATCH 2/2] Drop version bump and changelog from the GCC 15 fix Leave only the C API change; the version will be bumped in the deploy script. Co-authored-by: Cursor --- CHANGELOG.md | 5 ----- Gemfile.lock | 2 +- lib/page_print/version.rb | 2 +- page_print.gemspec | 2 +- 4 files changed, 3 insertions(+), 8 deletions(-) delete mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 845fb65..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -# Changelog - -## 0.1.11 - -- Register `PagePrint.render` and `PagePrint.render_to_file` with the original `rb_define_singleton_method` function-pointer API instead of `RUBY_METHOD_FUNC`. That removes a GCC 15 / C23 incompatible-pointer-types error that blocked source builds on Heroku-26, while remaining compatible with older compilers such as GCC 13 on Heroku-24 and macOS clang. diff --git a/Gemfile.lock b/Gemfile.lock index 8d297f0..370c8b6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - page_print (0.1.11) + page_print (0.1.10) GEM remote: https://rubygems.org/ diff --git a/lib/page_print/version.rb b/lib/page_print/version.rb index 19a2bcd..e6a6a2e 100644 --- a/lib/page_print/version.rb +++ b/lib/page_print/version.rb @@ -1,3 +1,3 @@ module PagePrint - VERSION = '0.1.11' + VERSION = '0.1.10' end diff --git a/page_print.gemspec b/page_print.gemspec index 3c9c365..e51cab8 100644 --- a/page_print.gemspec +++ b/page_print.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |spec| File.directory?(path) || path.start_with?('lib/page_print/vendor/') || path.match?(%r{/(?:Makefile|mkmf\.log|.*\.(?:o|bundle))\z}) - end + Dir.glob('docs/*.md') + ['README.md', 'CHANGELOG.md', 'LICENSE'] + end + Dir.glob('docs/*.md') + ['README.md', 'LICENSE'] spec.bindir = 'exe' spec.executables = [] spec.require_paths = ['lib']