Skip to content

Commit

Permalink
Upgrade rb-sys and use RakeCompilerDock.ruby_cc_version
Browse files Browse the repository at this point in the history
  • Loading branch information
stanhu committed Jan 30, 2025
1 parent 3ddf3ed commit a3a37b6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-3.2.0
ruby-3.4.1
11 changes: 4 additions & 7 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

require "bundler/gem_tasks"
require "rubygems/package_task"
require "rake_compiler_dock"
require "rake/testtask"
require "rake/extensiontask"
require "rb_sys"

cross_rubies = %w[3.4.0 3.3.5 3.2.0 3.1.0]
ruby_cc_version = RakeCompilerDock.ruby_cc_version(">= 3.1")
cross_platforms = %w[
aarch64-linux-gnu
aarch64-linux-musl
Expand Down Expand Up @@ -41,15 +42,11 @@ namespace "gem" do
cross_platforms.each do |plat|
desc "Build the native gem for #{plat}"
task plat => "prepare" do
require "rake_compiler_dock"

# rbsys doesn't ship an alias -gnu image yet
rcd_plat = plat.gsub(/-gnu$/, '')
ENV["RCD_IMAGE"] = "rbsys/#{rcd_plat}:#{RbSys::VERSION}"
ENV["RCD_IMAGE"] = "rbsys/#{plat}:#{RbSys::VERSION}"

RakeCompilerDock.sh <<~SH, platform: plat
bundle && \
RUBY_CC_VERSION="#{cross_rubies.join(":")}" \
RUBY_CC_VERSION="#{ruby_cc_version}"
rake native:#{plat} pkg/#{spec.full_name}-#{plat}.gem
SH
end
Expand Down
3 changes: 1 addition & 2 deletions y-rb.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,10 @@ Gem::Specification.new do |spec|
spec.metadata["rubygems_mfa_required"] = "true"

spec.add_dependency "rake", "~> 13.2"
spec.add_dependency "rb_sys", "~> 0.9.86"
spec.add_dependency "rb_sys", "~> 0.9.109"

spec.add_development_dependency "base64"
spec.add_development_dependency "rake-compiler", "~> 1.2.1"
spec.add_development_dependency "rake-compiler-dock", "~> 1.9.1"

spec.extensions = ["ext/yrb/extconf.rb"]
end

0 comments on commit a3a37b6

Please sign in to comment.