Skip to content

Commit

Permalink
feat: support Ruby 3.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
maxirmx committed Jan 29, 2025
1 parent 2022630 commit 6f1883c
Show file tree
Hide file tree
Showing 12 changed files with 97 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ test_task_template: &TEST_TASK_TEMPLATE
RUBY_VER=3.2.6 tests/scripts/functional-tests.sh
testset-1-app_script: |
RUBY_VER=3.3.6 MODE=app tests/scripts/functional-tests.sh
RUBY_VER=3.3.7 MODE=app tests/scripts/functional-tests.sh
testset-2_script: |
RUBY_VER=3.2.6 ruby tests-2/tebako-test.rb
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ concurrency:
cancel-in-progress: true

env:
CACHE_VER: 16
CACHE_VER: 17
TZ: "Etc/UTC"
VERBOSE: no

Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:
env:
- { CC: gcc, CXX: g++, ALPINE_VER: "3.17" }
- { CC: clang, CXX: clang++, ALPINE_VER: "3.17" }
package_ruby_ver: [ '3.2.6', '3.3.6', '3.4.1' ]
package_ruby_ver: [ '3.2.6', '3.3.7', '3.4.1' ]
env: ${{ matrix.env }}
steps:
- name: Install packages
Expand Down Expand Up @@ -178,7 +178,7 @@ jobs:
env:
- { CC: gcc, CXX: g++, ALPINE_VER: "3.17" }
- { CC: clang, CXX: clang++, ALPINE_VER: "3.17" }
package_ruby_ver: [ '3.2.6', '3.3.6', '3.4.1' ]
package_ruby_ver: [ '3.2.6', '3.3.7', '3.4.1' ]
env: ${{ matrix.env }}
steps:
- name: Install packages
Expand Down Expand Up @@ -234,7 +234,7 @@ jobs:
env:
- { CC: gcc, CXX: g++, ALPINE_VER: "3.17" }
- { CC: clang, CXX: clang++, ALPINE_VER: "3.17" }
package_ruby_ver: [ '3.2.6', '3.3.6', '3.4.1']
package_ruby_ver: [ '3.2.6', '3.3.7', '3.4.1']
env: ${{ matrix.env }}
steps:
- name: Install packages
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ concurrency:
cancel-in-progress: true

env:
CACHE_VER: 16
CACHE_VER: 17
VERBOSE: no

jobs:
Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:
- { os: macos-14, xcode: 15.4 }
- { os: macos-15, xcode: 16.1 }

package_ruby_ver: [ '3.2.6', '3.3.6', '3.4.1' ]
package_ruby_ver: [ '3.2.6', '3.3.7', '3.4.1' ]
ruby_ver: ['3.2.6']
steps:
- name: Checkout tebako packaging environment
Expand Down Expand Up @@ -167,7 +167,7 @@ jobs:
- { os: macos-14, xcode: 15.4 }
- { os: macos-15, xcode: 16.1 }

package_ruby_ver: [ '3.3.6', '3.4.1' ]
package_ruby_ver: [ '3.3.7', '3.4.1' ]
ruby_ver: ['3.2.6']
steps:
- name: Checkout tebako packaging environment
Expand Down Expand Up @@ -218,7 +218,7 @@ jobs:
- { os: macos-14, xcode: 15.0.1, LG_VADDR: 39}
- { os: macos-14, xcode: 15.4 }
- { os: macos-15, xcode: 16.1 }
package_ruby_ver: [ '3.2.6', '3.3.6', '3.4.1' ]
package_ruby_ver: [ '3.2.6', '3.3.7', '3.4.1' ]
ruby_ver: ['3.2.6']
steps:
- name: Checkout tebako packaging environment
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ concurrency:
cancel-in-progress: true

env:
CACHE_VER: 16
CACHE_VER: 17
DEBIAN_FRONTEND: "noninteractive"
TZ: "Etc/UTC"
# show cmake output (yes/no)
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
strategy:
fail-fast: false
matrix:
package_ruby_ver: [ '2.7.8', '3.0.7', '3.1.6', '3.2.4', '3.2.5', '3.2.6', '3.3.3', '3.3.4', '3.3.5', '3.3.6', '3.4.1' ]
package_ruby_ver: [ '2.7.8', '3.0.7', '3.1.6', '3.2.4', '3.2.5', '3.2.6', '3.3.3', '3.3.4', '3.3.5', '3.3.6', '3.3.7', '3.4.1' ]
env:
- { os: ubuntu-20.04, CC: gcc-10, CXX: g++-10 }
- { os: ubuntu-20.04, CC: clang-12, CXX: clang++-12 }
Expand Down Expand Up @@ -162,7 +162,7 @@ jobs:
strategy:
fail-fast: false
matrix:
package_ruby_ver: [ '2.7.8', '3.0.7', '3.1.6', '3.2.4', '3.2.5', '3.2.6', '3.3.3', '3.3.4', '3.3.5', '3.3.6', '3.4.1' ]
package_ruby_ver: [ '2.7.8', '3.0.7', '3.1.6', '3.2.4', '3.2.5', '3.2.6', '3.3.3', '3.3.4', '3.3.5', '3.3.6', '3.3.7', '3.4.1' ]
env:
- { os: ubuntu-20.04, CC: gcc-10, CXX: g++-10 }
- { os: ubuntu-20.04, CC: clang-12, CXX: clang++-12 }
Expand Down Expand Up @@ -211,7 +211,7 @@ jobs:
strategy:
fail-fast: false
matrix:
package_ruby_ver: [ '2.7.8', '3.0.7', '3.1.6', '3.2.4', '3.2.5', '3.2.6', '3.3.3', '3.3.4', '3.3.5', '3.3.6', '3.4.1' ]
package_ruby_ver: [ '2.7.8', '3.0.7', '3.1.6', '3.2.4', '3.2.5', '3.2.6', '3.3.3', '3.3.4', '3.3.5', '3.3.6', '3.3.7', '3.4.1' ]
env:
- { os: ubuntu-20.04, CC: gcc-10, CXX: g++-10 }
- { os: ubuntu-20.04, CC: clang-12, CXX: clang++-12 }
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/windows-msys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ concurrency:
cancel-in-progress: true

env:
CACHE_VER: 16
CACHE_VER: 17
VERBOSE: no

jobs:
Expand Down Expand Up @@ -149,7 +149,7 @@ jobs:
- sys: ucrt64
CC: gcc
CXX: g++
package_ruby_ver: [ '3.2.6', '3.3.6', '3.4.1' ]
package_ruby_ver: [ '3.2.6', '3.3.6', '3.3.7', '3.4.1' ]
script: ['bundle', 'app']
env: ${{ matrix.env }}

Expand Down Expand Up @@ -232,7 +232,7 @@ jobs:
- sys: ucrt64
CC: gcc
CXX: g++
package_ruby_ver: [ '3.2.6', '3.3.6', '3.4.1' ]
package_ruby_ver: [ '3.2.6', '3.3.6', '3.3.7', '3.4.1' ]
env: ${{ matrix.env }}

defaults:
Expand Down
1 change: 1 addition & 0 deletions Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ brew "fmt"
brew "glog"
brew "gnu-sed"
brew "bash"
brew "brotli"
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ higher.
| 3.0.7 | Linux, macOS
| 3.1.6 | Linux, macOS, Windows
| 3.2.{4,5,6} | Linux, macOS, Windows
| 3.3.{3,4,5,6} | Linux, macOS, Windows
| 3.3.{3,4,5,6,7} | Linux, macOS, Windows
| 3.4.1 | Linux, macOS, Windows

|===
Expand Down
4 changes: 2 additions & 2 deletions lib/tebako/packager/pass1_patch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ class Pass1MSysPatch < Pass1Patch

WIN32_WINMAIN_C_PATCH = {
"WinMain(HINSTANCE current, HINSTANCE prev, LPSTR cmdline, int showcmd)" =>
"wWinMain(HINSTANCE current, HINSTANCE prev, LPWSTR cmdline, int showcmd)"
"wWinMain(HINSTANCE current, HINSTANCE prev, LPWSTR cmdline, int showcmd) /* tebako patched */"
}.freeze

def patch_map
Expand Down Expand Up @@ -288,7 +288,7 @@ def msys_base_patches
def msys_patches
pm = msys_base_patches

if @ruby_ver.ruby34?
if @ruby_ver.ruby337?
# ....................................................
# RUBY_EXTERN shall be extern for static build but is set to __declspec(dllimport) for encodin libarary
pm.store("include/ruby/onigmo.h", INCLUDE_RUBY_ONIGMO_H_PATCH)
Expand Down
5 changes: 5 additions & 0 deletions lib/tebako/ruby_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class RubyVersion
"3.3.4" => "fe6a30f97d54e029768f2ddf4923699c416cdbc3a6e96db3e2d5716c7db96a34",
"3.3.5" => "3781a3504222c2f26cb4b9eb9c1a12dbf4944d366ce24a9ff8cf99ecbce75196",
"3.3.6" => "8dc48fffaf270f86f1019053f28e51e4da4cce32a36760a0603a9aee67d7fd8d",
"3.3.7" => "9c37c3b12288c7aec20ca121ce76845be5bb5d77662a24919651aaf1d12c8628",
"3.4.1" => "3d385e5d22d368b064c817a13ed8e3cc3f71a7705d7ed1bae78013c33aa7c87f"
}.freeze

Expand Down Expand Up @@ -89,6 +90,10 @@ def ruby33?
@ruby33 ||= ruby3x? && @ruby_version[2].to_i >= 3
end

def ruby337?
@ruby337 ||= ruby34? || (ruby33? && @ruby_version[2] == "3" && @ruby_version[4].to_i >= 7)
end

def ruby34?
@ruby34 ||= ruby3x? && @ruby_version[2].to_i >= 4
end
Expand Down
2 changes: 1 addition & 1 deletion lib/tebako/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@
# POSSIBILITY OF SUCH DAMAGE.

module Tebako
VERSION = "0.12.8"
VERSION = "0.12.9"
end
21 changes: 19 additions & 2 deletions spec/packager/pass1_patch_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,28 @@
end
end

context "when ruby_ver is ruby34" do
context "when ruby version is 3.3.7" do
let(:ruby_ver) { Tebako::RubyVersion.new("3.3.7") }
let(:patch) { described_class.new(mountpoint, ruby_ver) }

it "includes additional patches for MSys and ruby 3.3.7" do
expected_patch_map = base_patch_map.merge(
"ext/bigdecimal/bigdecimal.h" => described_class::EXT_BIGDECIMAL_BIGDECIMAL_H_PATCH,
"cygwin/GNUmakefile.in" => patch.send(:gnumakefile_in_patch_p1),
"ext/openssl/extconf.rb" => described_class::OPENSSL_EXTCONF_RB_PATCH,
"lib/rubygems/openssl.rb" => described_class::RUBYGEM_OPENSSL_RB_PATCH,
"include/ruby/onigmo.h" => described_class::INCLUDE_RUBY_ONIGMO_H_PATCH,
"win32/winmain.c" => described_class::WIN32_WINMAIN_C_PATCH
)
expect(patch.patch_map).to eq(expected_patch_map)
end
end

context "when ruby version is 3.4.1" do
let(:ruby_ver) { Tebako::RubyVersion.new("3.4.1") }
let(:patch) { described_class.new(mountpoint, ruby_ver) }

it "includes additional patches for MSys and ruby34" do
it "includes additional patches for MSys and ruby 3.4.1" do
expected_patch_map = base_patch_map.merge(
"cygwin/GNUmakefile.in" => patch.send(:gnumakefile_in_patch_p1),
"ext/openssl/extconf.rb" => described_class::OPENSSL_EXTCONF_RB_PATCH,
Expand Down
52 changes: 52 additions & 0 deletions spec/ruby_version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@
expect(version.ruby33?).to be false
end

it "returns false for ruby337?" do
expect(version.ruby337?).to be false
end

it "returns false for ruby34?" do
expect(version.ruby34?).to be false
end
Expand Down Expand Up @@ -151,6 +155,50 @@
expect(version.ruby33?).to be true
end

it "returns false for ruby337?" do
expect(version.ruby337?).to be false
end

it "returns false for ruby34?" do
expect(version.ruby34?).to be false
end

it "returns '3.3.0' for api_version" do
expect(version.api_version).to eq("3.3.0")
end

it "returns '330' for lib_version" do
expect(version.lib_version).to eq("330")
end
end

context "with version 3.3.7" do
let(:version) { Tebako::RubyVersion.new("3.3.7") }

it "returns true for ruby3x?" do
expect(version.ruby3x?).to be true
end

it "returns true for ruby31?" do
expect(version.ruby31?).to be true
end

it "returns true for ruby32?" do
expect(version.ruby32?).to be true
end

it "returns false for ruby32only?" do
expect(version.ruby32only?).to be false
end

it "returns true for ruby33?" do
expect(version.ruby33?).to be true
end

it "returns true for ruby337?" do
expect(version.ruby337?).to be true
end

it "returns false for ruby34?" do
expect(version.ruby34?).to be false
end
Expand Down Expand Up @@ -187,6 +235,10 @@
expect(version.ruby33?).to be true
end

it "returns true for ruby337?" do
expect(version.ruby337?).to be true
end

it "returns true for ruby34?" do
expect(version.ruby34?).to be true
end
Expand Down

0 comments on commit 6f1883c

Please sign in to comment.