From 099b87be3f282dc6870e378eda8a21abb49e0de9 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 18 Oct 2025 17:41:20 +0900 Subject: [PATCH 1/2] Totally disable the DFLTCC extension before tests --- Rakefile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Rakefile b/Rakefile index fdab5bb..fa6f9da 100644 --- a/Rakefile +++ b/Rakefile @@ -1,16 +1,15 @@ require "bundler/gem_tasks" require "rake/testtask" -desc "Run tests" -task :test do +if RUBY_PLATFORM.include?("s390x") # Avoid possible test failures with the zlib applying the following patch on # s390x CPU architecture. # https://github.com/madler/zlib/pull/410 - ENV["DFLTCC"] = "0" if RUBY_PLATFORM =~ /s390x/ - Rake::Task["test_internal"].invoke + ENV["DFLTCC"] = "0" end -Rake::TestTask.new(:test_internal) do |t| +desc "Run tests" +Rake::TestTask.new do |t| t.libs << "test/lib" t.ruby_opts << "-rhelper" t.test_files = FileList["test/**/test_*.rb"] From f623720c4942be1be7efd660bc3af52f4b418bc4 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 9 Oct 2025 08:49:06 +0900 Subject: [PATCH 2/2] Use ruby-core-tasks gem --- .gitignore | 1 + Gemfile | 2 +- Rakefile | 7 ++++--- rakelib/epoch.rake | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 rakelib/epoch.rake diff --git a/.gitignore b/.gitignore index cc4b63a..6451220 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ *.bundle *.so *.dll +/.build/ diff --git a/Gemfile b/Gemfile index c39582a..65b9529 100644 --- a/Gemfile +++ b/Gemfile @@ -6,4 +6,4 @@ gem "bundler" gem "test-unit" gem "test-unit-ruby-core" gem "rake" -gem "rake-compiler" +gem "ruby-core-tasks", github: "ruby/ruby-core-tasks" diff --git a/Rakefile b/Rakefile index fa6f9da..855ea02 100644 --- a/Rakefile +++ b/Rakefile @@ -1,5 +1,6 @@ require "bundler/gem_tasks" require "rake/testtask" +require "ruby-core/extensiontask" if RUBY_PLATFORM.include?("s390x") # Avoid possible test failures with the zlib applying the following patch on @@ -8,14 +9,14 @@ if RUBY_PLATFORM.include?("s390x") ENV["DFLTCC"] = "0" end +extask = RubyCore::ExtensionTask.new(Bundler::GemHelper.instance.gemspec) + desc "Run tests" Rake::TestTask.new do |t| t.libs << "test/lib" + t.libs.concat(extask.libs) t.ruby_opts << "-rhelper" t.test_files = FileList["test/**/test_*.rb"] end -require 'rake/extensiontask' -Rake::ExtensionTask.new("zlib") - task :default => [:compile, :test] diff --git a/rakelib/epoch.rake b/rakelib/epoch.rake new file mode 100644 index 0000000..5275d2f --- /dev/null +++ b/rakelib/epoch.rake @@ -0,0 +1 @@ +require 'ruby-core/epoch'