Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update supported Ruby version; upgrade rubygems when Ruby 3.0 or 2.7 is used for packaging #121

Merged
merged 2 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
1 change: 0 additions & 1 deletion .github/workflows/gem-test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ jobs:
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VER }}
bundler: ${{ env.BUNDLER_VER }}
bundler-cache: true

- name: Build gem
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: 2 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021-2023 [Ribose Inc](https://www.ribose.com).
# Copyright (c) 2021-2024 [Ribose Inc](https://www.ribose.com).
# All rights reserved.
# This file is a part of tebako
#
Expand Down Expand Up @@ -245,14 +245,6 @@ endif(IS_MSYS)
def_ext_prj_g(INCBIN "348e36b")
def_ext_prj_g(DWARFS_WR "v0.4.0")

if (DEFINED ENV{BUNDLER_VER})
set(BUNDLER_VER $ENV{BUNDLER_VER})
set(BUNDLER_ANNOTATION "environment")
else()
set(BUNDLER_VER "2.3.22")
set(BUNDLER_ANNOTATION "default")
endif()

find_library(_LIBNCURSES "libncurses.a")
if(${_LIBNCURSES} STREQUAL "_LIBNCURSES-NOTFOUND")
set(WITH_NCURSES_BUILD ON)
Expand All @@ -268,7 +260,6 @@ endif(${RUBY_VER} VERSION_LESS "3.2.0")

message("Configuration summary:")
message(STATUS "ruby: v${RUBY_VER} at ${RUBY_SOURCE_DIR}")
message(STATUS "bundler version: ${BUNDLER_VER} (${BUNDLER_ANNOTATION})")
if(WITH_OPENSSL_BUILD)
message(STATUS "openssl: building @${OPENSSL_TAG} at ${OPENSSL_SOURCE_DIR}")
endif(WITH_OPENSSL_BUILD)
Expand Down Expand Up @@ -511,7 +502,7 @@ else (${SETUP_MODE})
list(LENGTH GEMS GLENGTH)

add_custom_target(clean_filesystem
COMMAND ruby ${EXE}/tebako-packager deploy ${RUBY_STASH_DIR} ${DATA_SRC_DIR} ${DATA_PRE_DIR} ${DATA_BIN_DIR} ${TBD} ${TGD}
COMMAND ruby ${EXE}/tebako-packager deploy ${RUBY_STASH_DIR} ${DATA_SRC_DIR} ${DATA_PRE_DIR} ${DATA_BIN_DIR} ${GFLENGTH}
DEPENDS ${RUBY_PRJ}
)
if(GSLENGTH GREATER 0)
Expand All @@ -527,8 +518,6 @@ else (${SETUP_MODE})
add_custom_target(source_filesystem
COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${FS_ROOT} -DTARGET_DIR=${DATA_PRE_DIR} -P ${CMAKE_SOURCE_DIR}/cmake/copy_dir.cmake
COMMAND ${CMAKE_COMMAND} -E make_directory ${TGD}
COMMAND ${CMAKE_COMMAND} -E chdir ${DATA_PRE_DIR} ${CMAKE_COMMAND} -E env --unset=GEM_HOME --unset=GEM_PATH TEBAKO_PASS_THROUGH=1
${TBD}/gem${CMD_SUFFIX} install bundler -v '${BUNDLER_VER}' --source 'https://rubygems.org/' --no-document --install-dir ${TGD}
COMMAND ${CMAKE_COMMAND} -E chdir ${DATA_PRE_DIR} ${CMAKE_COMMAND} -E env --unset=GEM_HOME --unset=GEM_PATH TEBAKO_PASS_THROUGH=1
${TBD}/bundle${CMD_SUFFIX} config set --local force_ruby_platform ${FORCE_RUBY_PLATFORM}
COMMAND ${CMAKE_COMMAND} -E chdir ${DATA_PRE_DIR} ${CMAKE_COMMAND} -E env --unset=GEM_HOME --unset=GEM_PATH TEBAKO_PASS_THROUGH=1
Expand Down Expand Up @@ -572,9 +561,6 @@ else (${SETUP_MODE})
${CMAKE_COMMAND} -E false )
COMMAND ${CMAKE_COMMAND} -E make_directory ${TLD}
COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${FS_ROOT} -DTARGET_DIR=${TLD} -P ${CMAKE_SOURCE_DIR}/cmake/copy_dir.cmake
COMMAND ${CMAKE_COMMAND} -E chdir ${TLD} ${CMAKE_COMMAND} -E env --unset=GEM_HOME --unset=GEM_PATH TEBAKO_PASS_THROUGH=1
${TBD}/gem${CMD_SUFFIX} install bundler -v '${BUNDLER_VER}'
--source 'https://rubygems.org/' --no-document --install-dir ${TGD}
COMMAND ${CMAKE_COMMAND} -E chdir ${TLD} ${CMAKE_COMMAND} -E env --unset=GEM_HOME --unset=GEM_PATH TEBAKO_PASS_THROUGH=1
${TBD}/bundle${CMD_SUFFIX} config build.ffi --disable-system-libffi
COMMAND ${CMAKE_COMMAND} -E chdir ${TLD} ${CMAKE_COMMAND} -E env --unset=GEM_HOME --unset=GEM_PATH TEBAKO_PASS_THROUGH=1
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 common.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ BUILD_TYPE=Release
DEPS=deps
INCBIN_TAG=348e36b
DWARFS_WR_TAG=v0.4.0
BUNDLER_VER=2.3.22
RUBY_VER=3.1.4
14 changes: 8 additions & 6 deletions exe/tebako-packager
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

# Copyright (c) 2023 [Ribose Inc](https://www.ribose.com).
# Copyright (c) 2023-2024 [Ribose Inc](https://www.ribose.com).
# All rights reserved.
# This file is a part of tebako
#
Expand Down Expand Up @@ -78,13 +78,15 @@ begin
# ARGV[2] -- DATA_SRC_DIR
# ARGV[3] -- DATA_PRE_DIR
# ARGV[4] -- DATA_BIN_DIR
# ARGV[5] -- TARGET_BIN_DIR (TBD)
# ARGV[6] -- TARGET_GEM_DIR (TGD)
unless ARGV.length == 7
# ARGV[5] -- GFLENGTH
unless ARGV.length == 6
raise Tebako::Error,
"tebako-packager deploy command expects 7 arguments, #{ARGV.length} has been provided."
"tebako-packager deploy command expects 6 arguments, #{ARGV.length} has been provided."
end
Tebako::Packager.deploy(ARGV[1], ARGV[2], ARGV[3], ARGV[4], ARGV[5])
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.deploy(ARGV[2], "#{ARGV[2]}/bin", ARGV[5])
else
raise Tebako::Error, "tebako-packager cannot process #{ARGV[0]} command"
end
Expand Down
8 changes: 5 additions & 3 deletions lib/tebako/cli_helpers.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

# Copyright (c) 2023 [Ribose Inc](https://www.ribose.com).
# Copyright (c) 2023-2024 [Ribose Inc](https://www.ribose.com).
# All rights reserved.
# This file is a part of tebako
#
Expand Down 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 Expand Up @@ -130,6 +131,7 @@ def packaging_error(code)

def prefix
@prefix ||= if options["prefix"].nil?
puts "No prefix specified, using ~/.tebako"
File.expand_path("~/.tebako")
elsif options["prefix"] == "PWD"
Dir.pwd
Expand Down
Loading