Skip to content

Commit

Permalink
Update supported Ruby versions #110
Browse files Browse the repository at this point in the history
  • Loading branch information
maxirmx committed Jan 26, 2024
1 parent ed37c86 commit 6f4d308
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
env:
- { CC: gcc, CXX: g++, ALPINE_VER: "3.17" }
- { CC: clang, CXX: clang++, ALPINE_VER: "3.17" }
package_ruby_ver: [ '3.1.4', '3.2.2' ]
package_ruby_ver: [ '3.1.4', '3.2.3' ]
env: ${{ matrix.env }}
steps:
- name: Install packages
Expand Down Expand Up @@ -132,7 +132,7 @@ jobs:
env:
- { CC: gcc, CXX: g++, ALPINE_VER: "3.17" }
- { CC: clang, CXX: clang++, ALPINE_VER: "3.17" }
package_ruby_ver: [ '3.1.4', '3.2.2' ]
package_ruby_ver: [ '3.1.4', '3.2.3' ]
env: ${{ matrix.env }}
steps:
- name: Install packages
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
fail-fast: false
matrix:
os: [ macos-11.0 ]
package_ruby_ver: [ '3.1.4', '3.2.2' ]
package_ruby_ver: [ '3.1.4', '3.2.3' ]
steps:
- name: Checkout tebako packaging environment
uses: actions/checkout@v3
Expand All @@ -112,7 +112,7 @@ jobs:
fail-fast: false
matrix:
os: [ macos-11.0 ]
package_ruby_ver: [ '3.1.4', '3.2.2' ]
package_ruby_ver: [ '3.1.4', '3.2.3' ]
steps:
- name: Checkout tebako packaging environment
uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-20.04 ]
package_ruby_ver: [ '2.7.7', '3.0.6', '3.1.4', '3.2.2' ]
package_ruby_ver: [ '2.7.8', '3.0.6', '3.1.4', '3.2.3' ]
env:
- { CC: gcc-10, CXX: g++-10 }
- { CC: clang-12, CXX: clang++-12 }
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-20.04 ]
package_ruby_ver: [ '2.7.7', '3.0.6', '3.1.4', '3.2.2' ]
package_ruby_ver: [ '2.7.8', '3.0.6', '3.1.4', '3.2.3' ]
env:
- { CC: gcc-10, CXX: g++-10 }
- { CC: clang-12, CXX: clang++-12 }
Expand Down
18 changes: 9 additions & 9 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ In the future:

The Tebako packager is tested on the following platforms:

* Linux: Ubuntu 20.04; Alpine 3.16
* Linux: Ubuntu 20.04; Alpine 3.17
* macOS: macOS 11.0 (Monterey)
* Windows: TBD

== Supported Ruby versions

The Tebako packager supports the following versions of Ruby for packaging:

* 2.7.7
* 2.7.8
* 3.0.6
* 3.1.4
* 3.2.2
* 3.2.3

Support of specific version including minor release requires some effort, sometimes extensive
but our goal is to be able to package all maintained Ruby releases.
Expand All @@ -53,7 +53,7 @@ but our goal is to be able to package all maintained Ruby releases.

=== Ubuntu

==== GNU C/C++ 9+ or Clang C/C++ 11+
==== GNU C/C++ 10+ or Clang C/C++ 12+

==== CMake version 3.20+

Expand Down Expand Up @@ -120,7 +120,7 @@ export TZ=Etc/UTC
apt-get update
apt-get install -y software-properties-common
add-apt-repository -y ppa:ubuntu-toolchain-r/test
apt-get install -y gcc-9 g++-9
apt-get install -y gcc-10 g++-10
apt-get install -y curl git ruby ruby-dev pkg-config bison flex make autoconf
curl https://apt.kitware.com/kitware-archive.sh | bash
Expand Down Expand Up @@ -164,7 +164,7 @@ cmmands below.
----
tebako press \
[-p|--prefix=<tebako-root-folder>] \
[-R|--Ruby=<2.7.7|3.0.6|3.1.4|3.2.2>] \
[-R|--Ruby=<2.7.8|3.0.6|3.1.4|3.2.3>] \
-r|--root=<project-root-folder> \
-e|--entry-point=<entry-point> \
[-o|--output=<packaged file name>] \
Expand All @@ -176,7 +176,7 @@ Where:
* `<tebako-root-folder>`, the Tebako setup folder (optional, defaults to current
folder)

* `Ruby` parameter defines Ruby version that will be packaged (optional, defaults to 3.0.6)
* `Ruby` parameter defines Ruby version that will be packaged (optional, defaults to 3.1.4)

* `<project-root>`, a folder at the host source file system where project files
are located
Expand Down Expand Up @@ -214,7 +214,7 @@ invocation of press command.
----
tebako setup \
[-p |--prefix=<tebako-root-folder>] \
[-R |--Ruby=<2.7.7|3.0.6|3.1.4|3.2.2>]
[-R |--Ruby=<2.7.8|3.0.6|3.1.4|3.2.3>]
----

Where:
Expand Down Expand Up @@ -257,7 +257,7 @@ Normally you do not need to do it since tebako packager optimizes artifacts life
----
tebako clean_ruby
[-p|--prefix=<tebako-root-folder>]
[-R|--Ruby=<2.7.7|3.0.6|3.1.4|3.2.2>]
[-R|--Ruby=<2.7.8|3.0.6|3.1.4|3.2.3>]
----

Where:
Expand Down
1 change: 0 additions & 1 deletion exe/tebako-packager
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ begin
Tebako::Packager.init(ARGV[1], ARGV[2], ARGV[3], ARGV[4])
# Assume that "<TARGET_BIN_DIR (TBD)>" is <DATA_SRC_DIR>/bin"
# That shall match CMakeLists.txt settings
# Tebako::Packager.update("#{ARGV[1]}/bin", "2.7.7")
Tebako::Packager.deploy(ARGV[2], "#{ARGV[2]}/bin", ARGV[5])
else
raise Tebako::Error, "tebako-packager cannot process #{ARGV[0]} command"
Expand Down
5 changes: 3 additions & 2 deletions lib/tebako/cli_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ def deps
end

RUBY_VERSIONS = {
"2.7.7" => "e10127db691d7ff36402cfe88f418c8d025a3f1eea92044b162dd72f0b8c7b90",
"2.7.8" => "c2dab63cbc8f2a05526108ad419efa63a67ed4074dbbcf9fc2b1ca664cb45ba0",
"3.0.6" => "6e6cbd490030d7910c0ff20edefab4294dfcd1046f0f8f47f78b597987ac683e",
"3.1.4" => "a3d55879a0dfab1d7141fdf10d22a07dbf8e5cdc4415da1bde06127d5cc3c7b6",
"3.2.2" => "96c57558871a6748de5bc9f274e93f4b5aad06cd8f37befa0e8d94e7b8a423bc"
"3.2.3" => "af7f1757d9ddb630345988139211f1fd570ff5ba830def1cc7c468ae9b65c9ba",
"3.3.0" => "96518814d9832bece92a85415a819d4893b307db5921ae1f0f751a9a89a56b7d"
}.freeze

DEFAULT_RUBY_VERSION = "3.1.4"
Expand Down
2 changes: 1 addition & 1 deletion lib/tebako/packager/pass2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def mlibs(ostype, deps_lib_dir, ruby_ver)
# rubocop:enable Metrics/MethodLength

def mlibs_subst(ostype, deps_lib_dir, ruby_ver)
yjit_libs = PatchHelpers.ruby32?(ruby_ver) ? "$(YJIT_LIBS) " : ""
yjit_libs = PatchHelpers.ruby32only?(ruby_ver) ? "$(YJIT_LIBS) " : ""
{
"MAINLIBS = #{yjit_libs}@MAINLIBS@" =>
"# -- Start of tebako patch -- \n" \
Expand Down
8 changes: 8 additions & 0 deletions lib/tebako/packager/patch_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ def ruby32?(ruby_ver)
ruby3x?(ruby_ver) && ruby_ver[2].to_i >= 2
end

def ruby32only?(ruby_ver)
ruby3x?(ruby_ver) && ruby_ver[2].to_i == 2
end

def ruby33?(ruby_ver)
ruby3x?(ruby_ver) && ruby_ver[2].to_i >= 3
end

# Sets up temporary environment variables and yields to the
# block. When the block exits, the environment variables are set
# back to their original values.
Expand Down

0 comments on commit 6f4d308

Please sign in to comment.