tebako 0.7.0 → 0.7.2.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0c260fa919b77603c20cc5db12e51595c0a0fd0da649dd6f64d2022bebc50dc
4
- data.tar.gz: 1bd24a7fa0d74fb44b95f0b5f41f736323553725741327b130cfadc36cb45cb6
3
+ metadata.gz: 9814ddc341bfd35eda55c9622169d70a833f244925ca8f5e49e401e0dd73f930
4
+ data.tar.gz: 2df44f4d1a0c899d6d432f33ec69b5abf6642c0d83621382eb8eb9aec0a08b80
5
5
  SHA512:
6
- metadata.gz: 145fe0a5fe1cb275c21db9e9d4b9092e7c7b342ee43e232d1a6e61a5bc606c62329c9a6a0082843a8b7c017667fda09317c1faa2f3371687e5e64c4a49a176b2
7
- data.tar.gz: 4708ff850fc763b41d7e1d8e84bee81d4c6a17f1653ac6f697f39e7146fe8acb60ca7922ac1ff7693086fae3f5216d82d83bd1cb97b596c9607769ce022c00f0
6
+ metadata.gz: 1952f88ddc52932de24a43ff8899296021cd91494bdbc45ed9617401fef8a16d25523c45fb8bd9e92c8cba89bb83e528f47111884ecb8e3ab9b9ebb9cb01c4f8
7
+ data.tar.gz: 1acfc8e2974572083e5d12aa436da559a2c2190fb4598c8190ac7829332d5b1d51af8c652ffb5ef499ae0fbca181bb508ab90c8ece1ae89b5631bd354ec8a495
data/CMakeLists.txt CHANGED
@@ -117,6 +117,7 @@ set(IS_MSYS OFF)
117
117
  set(IS_DARWIN OFF)
118
118
  set(RB_W32 OFF)
119
119
  set(FORCE_RUBY_PLATFORM "false")
120
+ set(NOKOGIRI_OPTION "--no-use-system-libraries")
120
121
  set(RUBY_WITHOUT_EXT "dbm,win32,win32ole")
121
122
  set(RUBY_NAME "ruby")
122
123
  set(RUBY_SUFFIX "")
@@ -132,6 +133,7 @@ if("${OSTYPE_TXT}" MATCHES "^linux-musl.*")
132
133
  elseif("${OSTYPE_TXT}" MATCHES "^msys*")
133
134
  set(IS_MSYS ON)
134
135
  set(FORCE_RUBY_PLATFORM "true")
136
+ set(NOKOGIRI_OPTION "--use-system-libraries")
135
137
  # set(DWARFS_PRELOAD ON)
136
138
  set(RB_W32 ON)
137
139
  set(RUBY_WITHOUT_EXT "dbm,syslog,pty,gdbm,readline")
@@ -368,6 +370,7 @@ message(STATUS "Ruby build ${C_FLAGS_DEST}='${RUBY_C_FLAGS}'")
368
370
  message(STATUS "Ruby build LDFLAGS='${RUBY_L_FLAGS}'")
369
371
  message(STATUS "openssl Ruby option='${OPENSSL_RUBY_OPTION}'")
370
372
  message(STATUS "libyaml Ruby option='${LIBYAML_RUBY_OPTION}'")
373
+ message(STATUS "nokogiri build option='${NOKOGIRI_OPTION}'")
371
374
 
372
375
  ExternalProject_Add(${RUBY_PRJ}
373
376
  PREFIX ${DEPS}
@@ -438,7 +441,7 @@ else (${SETUP_MODE})
438
441
  COMMAND ${CMAKE_COMMAND} -E chdir ${DATA_PRE_DIR} ${CMAKE_COMMAND} -E env --unset=GEM_HOME --unset=GEM_PATH TEBAKO_PASS_THROUGH=1
439
442
  ${TBD}/bundle${BAT_SUFFIX} config set --local build.ffi --disable-system-libffi
440
443
  COMMAND ${CMAKE_COMMAND} -E chdir ${DATA_PRE_DIR} ${CMAKE_COMMAND} -E env --unset=GEM_HOME --unset=GEM_PATH TEBAKO_PASS_THROUGH=1
441
- ${TBD}/bundle${BAT_SUFFIX} config set --local build.nokogiri --use-system-libraries
444
+ ${TBD}/bundle${BAT_SUFFIX} config set --local build.nokogiri ${NOKOGIRI_OPTION}
442
445
  COMMAND ${CMAKE_COMMAND} -E chdir ${DATA_PRE_DIR} ${CMAKE_COMMAND} -E env --unset=GEM_HOME --unset=GEM_PATH TEBAKO_PASS_THROUGH=1
443
446
  ${TBD}/bundle${BAT_SUFFIX} config set --local force_ruby_platform ${FORCE_RUBY_PLATFORM}
444
447
  COMMAND ${CMAKE_COMMAND} -E chdir ${DATA_PRE_DIR} ${CMAKE_COMMAND} -E env --unset=GEM_HOME --unset=GEM_PATH TEBAKO_PASS_THROUGH=1
@@ -480,16 +483,16 @@ else (${SETUP_MODE})
480
483
  COMMAND test -f ${FS_ROOT}/${FS_ENTRANCE} ||
481
484
  (${CMAKE_COMMAND} -E echo "Entry point ${FS_ROOT}/${FS_ENTRANCE} does not exist or is not accessible" &&
482
485
  ${CMAKE_COMMAND} -E false )
483
- COMMAND ${CMAKE_COMMAND} -E make_directory ${TLD}
484
- COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${FS_ROOT} -DTARGET_DIR=${TLD} -P ${CMAKE_SOURCE_DIR}/cmake/copy_dir.cmake
485
- COMMAND ${CMAKE_COMMAND} -E chdir ${TLD} ${CMAKE_COMMAND} -E env --unset=GEM_HOME --unset=GEM_PATH TEBAKO_PASS_THROUGH=1
486
- ${TBD}/bundle${BAT_SUFFIX} config set --local build.ffi --disable-system-libffi
486
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${TLD}
487
+ COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${FS_ROOT} -DTARGET_DIR=${TLD} -P ${CMAKE_SOURCE_DIR}/cmake/copy_dir.cmake
488
+ COMMAND ${CMAKE_COMMAND} -E chdir ${TLD} ${CMAKE_COMMAND} -E env --unset=GEM_HOME --unset=GEM_PATH TEBAKO_PASS_THROUGH=1
489
+ ${TBD}/bundle${BAT_SUFFIX} config set --local build.ffi --disable-system-libffi
490
+ COMMAND ${CMAKE_COMMAND} -E chdir ${TLD} ${CMAKE_COMMAND} -E env --unset=GEM_HOME --unset=GEM_PATH TEBAKO_PASS_THROUGH=1
491
+ ${TBD}/bundle${BAT_SUFFIX} config set --local build.nokogiri ${NOKOGIRI_OPTION}
492
+ COMMAND ${CMAKE_COMMAND} -E chdir ${TLD} ${CMAKE_COMMAND} -E env --unset=GEM_HOME --unset=GEM_PATH TEBAKO_PASS_THROUGH=1
493
+ ${TBD}/bundle${BAT_SUFFIX} config set --local force_ruby_platform ${FORCE_RUBY_PLATFORM}
487
494
  COMMAND ${CMAKE_COMMAND} -E chdir ${TLD} ${CMAKE_COMMAND} -E env --unset=GEM_HOME --unset=GEM_PATH TEBAKO_PASS_THROUGH=1
488
- ${TBD}/bundle${BAT_SUFFIX} config set --local build.nokogiri --use-system-libraries
489
- COMMAND ${CMAKE_COMMAND} -E chdir ${TLD} ${CMAKE_COMMAND} -E env --unset=GEM_HOME --unset=GEM_PATH TEBAKO_PASS_THROUGH=1
490
- ${TBD}/bundle${BAT_SUFFIX} config set --local force_ruby_platform ${FORCE_RUBY_PLATFORM}
491
- COMMAND ${CMAKE_COMMAND} -E chdir ${TLD} ${CMAKE_COMMAND} -E env --unset=GEM_HOME --unset=GEM_PATH TEBAKO_PASS_THROUGH=1
492
- ${TBD}/bundle${BAT_SUFFIX} install --jobs=${NCORES}
495
+ ${TBD}/bundle${BAT_SUFFIX} install --jobs=${NCORES}
493
496
  # COMMAND_EXPAND_LISTS
494
497
  # [TODO] Open question - how to deploy a project to source filesystem
495
498
  # ruby packer does bundle install --deployment --binstubs
data/README.adoc CHANGED
@@ -119,7 +119,7 @@ apk --no-cache --upgrade add build-base cmake git bash autoconf boost-static \
119
119
  brotli-static jemalloc-dev fmt-dev xz-static
120
120
  ----
121
121
 
122
- === macOS 12 (Monterey)
122
+ === macOS 12 (Monterey) through macOS 14 (Sonoma)
123
123
 
124
124
  [source,sh]
125
125
  ----
@@ -211,6 +211,23 @@ gem install tebako
211
211
  gem install tebako
212
212
  ----
213
213
 
214
+ === Tebako Root Folder (aka Prefix) Selection
215
+
216
+ The prefix in Tebako determines the base directory for the Tebako setup. It is an essential part of configuring how Tebako operates within your system.
217
+ The selection of the prefix follows a specific order of precedence to ensure flexibility and ease of use:
218
+
219
+ . *User-Specified Prefix*: The most direct way to set the root folder is by specifying it through an option. This can be done via command-line argument.
220
+
221
+ . *Current Working Directory (PWD)*: If the prefix option is explicitly set to "PWD", Tebako uses the current working directory as Tebako root folder.
222
+
223
+ . *Environment Variable (TEBAKO_PREFIX)*: In the absence of a user-specified option, Tebako looks for an environment variable named `TEBAKO_PREFIX`. If found, its value is used as the root folder.
224
+
225
+ . *Default Value*: If no prefix is specified and the `TEBAKO_DIR` environment variable is not set, Tebako defaults to using a directory named `.tebako` in the user's home directory.
226
+
227
+
228
+ Path Expansion: Regardless of the method used to set the prefix, Tebako expands the provided path to an absolute path. This expansion includes resolving relative paths based on the current working
229
+ directory and expanding user directory shortcuts like `~`.
230
+
214
231
  ==== Press
215
232
 
216
233
  This command "presses" a Ruby project using the Tebako setup from the Tebako root
@@ -227,7 +244,7 @@ cmmands below.
227
244
  ----
228
245
  tebako press \
229
246
  [-p|--prefix=<tebako-root-folder>] \
230
- [-R|--Ruby=<2.7.8|3.0.6|3.1.4|3.2.3>] \
247
+ [-R|--Ruby=<2.7.8|3.0.7|3.1.4|3.1.5|3.1.6|3.2.3|3.2.4>] \
231
248
  -r|--root=<project-root-folder> \
232
249
  -e|--entry-point=<entry-point> \
233
250
  [-o|--output=<packaged file name>] \
@@ -236,10 +253,9 @@ tebako press \
236
253
 
237
254
  Where:
238
255
 
239
- * `<tebako-root-folder>`, the Tebako setup folder (optional, defaults to current
240
- folder)
256
+ * `<tebako-root-folder>`, the Tebako root folder (see details in the Tebako Root Folder Selection section)
241
257
 
242
- * `Ruby` parameter defines Ruby version that will be packaged (optional, defaults to 3.1.4)
258
+ * `Ruby` parameter defines Ruby version that will be packaged (optional, defaults to 3.1.6)
243
259
 
244
260
  * `<project-root>`, a folder at the host source file system where project files
245
261
  are located
@@ -284,8 +300,7 @@ tebako setup \
284
300
 
285
301
  Where:
286
302
 
287
- * `<tebako-root-folder>`, the Tebako setup folder (optional, defaults to current
288
- folder)
303
+ * `<tebako-root-folder>`, the Tebako root folder (see details in the Tebako Root Folder Selection section)
289
304
 
290
305
  * `Ruby` parameter defines Ruby version that will be packaged (optional, defaults to 3.1.6)
291
306
 
@@ -302,8 +317,7 @@ tebako clean \
302
317
 
303
318
  Where:
304
319
 
305
- * `<tebako-root-folder>`, the Tebako setup folder (optional, defaults to current
306
- folder)
320
+ * `<tebako-root-folder>`, the Tebako root folder (see details in the Tebako Root Folder Selection section)
307
321
 
308
322
  [example]
309
323
  ====
@@ -322,7 +336,7 @@ Normally you do not need to do it since tebako packager optimizes artifacts life
322
336
  ----
323
337
  tebako clean_ruby
324
338
  [-p|--prefix=<tebako-root-folder>]
325
- [-R|--Ruby=<2.7.8|3.0.6|3.1.4|3.2.3>]
339
+ [-R|--Ruby=<2.7.8|3.0.7|3.1.4|3.1.5|3.1.6|3.2.3|3.2.4>]
326
340
  ----
327
341
 
328
342
  Where:
data/Rakefile CHANGED
@@ -35,8 +35,9 @@ task default: %i[rubocop]
35
35
  desc "Generate version.txt"
36
36
  task "generate_version_txt" do
37
37
  require_relative "lib/tebako/version"
38
- File.write(File.join(__dir__, "version.txt"), "#{Tebako::VERSION}\n")
39
- puts "Generating #{File.join(__dir__, "version.txt")}; version = #{Tebako::VERSION}"
38
+ version_without_rc = Tebako::VERSION.gsub(/\.rc\d+/, "")
39
+ File.write(File.join(__dir__, "version.txt"), "#{version_without_rc}\n")
40
+ puts "Generating #{File.join(__dir__, "version.txt")}; version = #{version_without_rc}"
40
41
  end
41
42
 
42
43
  task build: :generate_version_txt
data/exe/tebako-packager CHANGED
@@ -110,7 +110,7 @@ begin
110
110
  Tebako::Packager.create_implib(ARGV[2], ARGV[4], File.basename(ARGV[8]), ARGV[9]) if ARGV[1] =~ /msys/
111
111
  # Assume that "<TARGET_BIN_DIR (TBD)>" is <DATA_SRC_DIR>/bin"
112
112
  # That shall match CMakeLists.txt settings
113
- Tebako::Packager.deploy(ARGV[4], "#{ARGV[4]}/bin", ARGV[7])
113
+ Tebako::Packager.deploy(ARGV[4], ARGV[9], ARGV[7])
114
114
 
115
115
  else
116
116
  raise Tebako::Error, "tebako-packager cannot process #{ARGV[0]} command"
data/lib/tebako/cli.rb CHANGED
@@ -35,6 +35,7 @@ require "yaml"
35
35
  require_relative "cli_helpers"
36
36
  require_relative "cli_rubies"
37
37
  require_relative "error"
38
+ require_relative "version"
38
39
 
39
40
  # Tebako - an executable packager
40
41
  # Implementation of tebako command-line interface
@@ -45,12 +46,12 @@ module Tebako
45
46
  package_name "Tebako"
46
47
  class_option :prefix, type: :string, aliases: "-p", required: false,
47
48
  desc: "A path to tebako packaging environment, '~/.tebako' ('$HOME/.tebako') by default"
49
+ class_option :devmode, type: :boolean, aliases: "-D", required: false,
50
+ desc: "Developer mode, please do not use if unsure"
48
51
 
49
52
  desc "clean", "Clean tebako packaging environment"
50
53
  def clean
51
- puts "Cleaning tebako packaging environment"
52
- # Using File.join(deps, "") to ensure that the slashes are appropriate
53
- FileUtils.rm_rf([File.join(deps, ""), File.join(output, "")], secure: true)
54
+ clean_cache
54
55
  end
55
56
 
56
57
  desc "clean_ruby", "Clean Ruby source from tebako packaging environment"
@@ -68,7 +69,7 @@ module Tebako
68
69
 
69
70
  desc "hash", "Print build script hash (ci cache key)"
70
71
  def hash
71
- print Digest::SHA256.hexdigest File.read File.join(__dir__, "../..", "CMakeLists.txt")
72
+ print Digest::SHA256.hexdigest File.read File.join(source, "CMakeLists.txt")
72
73
  end
73
74
 
74
75
  desc "press", "Press tebako image"
@@ -83,8 +84,11 @@ module Tebako
83
84
  enum: Tebako::CliRubies::RUBY_VERSIONS.keys,
84
85
  desc: "Tebako package Ruby version, #{Tebako::CliRubies::DEFAULT_RUBY_VERSION} by default"
85
86
  def press
87
+ (clean_output unless version_match?) unless options[:devmode]
88
+
86
89
  puts press_announce
87
90
  do_press
91
+ ensure_version_file
88
92
  rescue Tebako::Error => e
89
93
  puts "Tebako script failed: #{e.message} [#{e.error_code}]"
90
94
  exit e.error_code
@@ -95,8 +99,11 @@ module Tebako
95
99
  enum: Tebako::CliRubies::RUBY_VERSIONS.keys,
96
100
  desc: "Tebako package Ruby version, #{Tebako::CliRubies::DEFAULT_RUBY_VERSION} by default."
97
101
  def setup
102
+ (clean_output unless version_match?) unless options[:devmode]
103
+
98
104
  puts "Setting up tebako packaging environment"
99
105
  do_setup
106
+ ensure_version_file
100
107
  rescue Tebako::Error => e
101
108
  puts "Tebako script failed: #{e.message} [#{e.error_code}]"
102
109
  exit e.error_code
@@ -107,6 +114,13 @@ module Tebako
107
114
  end
108
115
 
109
116
  no_commands do
117
+ def initialize(*args)
118
+ super
119
+ return if args[2][:current_command].name.include?("hash")
120
+
121
+ puts "Tebako executable packager version #{Tebako::VERSION}"
122
+ end
123
+
110
124
  def options
111
125
  original_options = super
112
126
 
@@ -37,6 +37,7 @@ require_relative "version"
37
37
  # Tebako - an executable packager
38
38
  # Command-line interface methods
39
39
  module Tebako
40
+ E_VERSION_FILE = ".environment.version"
40
41
  # Cli helpers
41
42
  module CliHelpers
42
43
  def b_env
@@ -57,10 +58,33 @@ module Tebako
57
58
  "-DDEPS:STRING=\"#{deps}\" -G \"#{m_files}\" -B \"#{output}\" -S \"#{source}\""
58
59
  end
59
60
 
61
+ def clean_cache
62
+ puts "Cleaning tebako packaging environment"
63
+ # Using File.join(deps, "") to ensure that the slashes are appropriate
64
+ FileUtils.rm_rf([File.join(deps, ""), File.join(output, "")], secure: true)
65
+ end
66
+
67
+ def clean_output
68
+ puts "Cleaning CMake cache"
69
+ # Using File.join(output, "") to ensure that the slashes are appropriate
70
+ FileUtils.rm_rf(File.join(output, ""), secure: true)
71
+ end
72
+
60
73
  def deps
61
74
  @deps ||= File.join(prefix, "deps")
62
75
  end
63
76
 
77
+ def ensure_version_file
78
+ version_file_path = File.join(prefix, E_VERSION_FILE)
79
+
80
+ begin
81
+ File.write(version_file_path, version_key)
82
+ # puts "Set version information for tebako packaging environment to #{Tebako::VERSION}"
83
+ rescue StandardError => e
84
+ puts "An error occurred while creating or updating #{E_VERSION_FILE}: #{e.message}"
85
+ end
86
+ end
87
+
64
88
  def fs_current
65
89
  fs_current = Dir.pwd
66
90
  if RUBY_PLATFORM =~ /msys|mingw|cygwin/
@@ -115,10 +139,20 @@ module Tebako
115
139
  end
116
140
  end
117
141
 
142
+ def handle_nil_prefix
143
+ env_prefix = ENV.fetch("TEBAKO_PREFIX", nil)
144
+ if env_prefix.nil?
145
+ puts "No prefix specified, using ~/.tebako"
146
+ File.expand_path("~/.tebako")
147
+ else
148
+ puts "Using TEBAKO_PREFIX environment variable as prefix"
149
+ File.expand_path(env_prefix)
150
+ end
151
+ end
152
+
118
153
  def prefix
119
154
  @prefix ||= if options["prefix"].nil?
120
- puts "No prefix specified, using ~/.tebako"
121
- File.expand_path("~/.tebako")
155
+ handle_nil_prefix
122
156
  elsif options["prefix"] == "PWD"
123
157
  Dir.pwd
124
158
  else
@@ -159,5 +193,25 @@ module Tebako
159
193
  c_path = Pathname.new(__FILE__).realpath
160
194
  @source ||= File.expand_path("../../..", c_path)
161
195
  end
196
+
197
+ def version_key
198
+ @version_key ||= "#{Tebako::VERSION} at #{source}"
199
+ end
200
+
201
+ def version_match? # rubocop:disable Metrics/MethodLength
202
+ begin
203
+ version_file_path = File.join(prefix, E_VERSION_FILE)
204
+ file_version = File.open(version_file_path, &:readline).strip
205
+ rs = file_version == version_key
206
+ unless rs
207
+ puts "CMake cache was created by a gem version #{file_version} " \
208
+ "and cannot be used for gem version #{version_key}"
209
+ end
210
+ rescue StandardError
211
+ # In case of any error (e.g., file not readable), return false
212
+ rs = false
213
+ end
214
+ rs
215
+ end
162
216
  end
163
217
  end
@@ -59,12 +59,6 @@ module Tebako
59
59
  thread_pthread.c
60
60
  ].freeze
61
61
 
62
- DEPLOY_ENV = {
63
- "GEM_HOME" => nil,
64
- "GEM_PATH" => nil,
65
- "TEBAKO_PASS_THROUGH" => "1"
66
- }.freeze
67
-
68
62
  # Magic version numbers used to ensure compatibility for Ruby 2.7.x, 3.0.x
69
63
  # These are the minimal versions required to provide linux-gnu / linux-musl differentiation by bundler
70
64
  # Ruby 3.1+ default rubygems versions work correctly out of the box
@@ -83,13 +77,19 @@ module Tebako
83
77
  end
84
78
 
85
79
  # Deploy
86
- def deploy(src_dir, tbd, gflength)
80
+ def deploy(target_dir, ruby_ver, gflength)
87
81
  puts "-- Running deploy script"
88
82
 
89
- ruby_ver = ruby_version(tbd)
90
- update_rubygems(tbd, "#{src_dir}/lib", ruby_ver, RUBYGEMS_VERSION) unless PatchHelpers.ruby31?(ruby_ver)
91
- install_gem tbd, "tebako-runtime"
92
- install_gem(tbd, "bundler", BUNDLER_VERSION) if gflength.to_i != 0
83
+ ruby_api_ver = ruby_api_version(ruby_ver)
84
+ gem_home = "#{target_dir}/lib/ruby/gems/#{ruby_api_ver}"
85
+
86
+ deploy_env = { "GEM_HOME" => gem_home, "GEM_PATH" => gem_home, "TEBAKO_PASS_THROUGH" => "1" }
87
+
88
+ PatchHelpers.with_env(deploy_env) do
89
+ update_rubygems(target_dir, ruby_api_ver, RUBYGEMS_VERSION) unless PatchHelpers.ruby31?(ruby_ver)
90
+ install_gem(target_dir, "tebako-runtime")
91
+ install_gem(target_dir, "bundler", BUNDLER_VERSION) if gflength.to_i != 0
92
+ end
93
93
  end
94
94
 
95
95
  # Init
@@ -174,21 +174,24 @@ module Tebako
174
174
  File.join(src_dir, "lib", "libx64-ucrt-ruby#{ruby_ver[0]}#{ruby_ver[2]}0.a")
175
175
  end
176
176
 
177
- def install_gem(tbd, name, ver = nil)
177
+ def install_gem(target_dir, name, ver = nil)
178
178
  puts " ... installing #{name} gem#{" version #{ver}" if ver}"
179
- PatchHelpers.with_env(DEPLOY_ENV) do
180
- params = ["#{tbd}/gem", "install", name.to_s]
181
- params.push("-v", ver.to_s) if ver
182
179
 
183
- out, st = Open3.capture2e(*params)
184
- raise Tebako::Error, "Failed to install #{name} (#{st}):\n #{out}" unless st.exitstatus.zero?
185
- end
180
+ params = ["#{target_dir}/bin/gem", "install", name.to_s]
181
+ params.push("-v", ver.to_s) if ver
182
+
183
+ out, st = Open3.capture2e(*params)
184
+ raise Tebako::Error, "Failed to install #{name} (#{st}):\n #{out}" unless st.exitstatus.zero?
186
185
  end
187
186
 
188
187
  def do_patch(patch_map, root)
189
188
  patch_map.each { |fname, mapping| PatchHelpers.patch_file("#{root}/#{fname}", mapping) }
190
189
  end
191
190
 
191
+ def ruby_api_version(ruby_ver)
192
+ "#{ruby_ver.split(".")[0..1].join(".")}.0"
193
+ end
194
+
192
195
  def ruby_version(tbd)
193
196
  ruby_version = nil
194
197
  PatchHelpers.with_env(DEPLOY_ENV) do
@@ -203,16 +206,14 @@ module Tebako
203
206
  ruby_version
204
207
  end
205
208
 
206
- def update_rubygems(tbd, tld, ruby_ver, gem_ver)
209
+ def update_rubygems(target_dir, ruby_api_ver, gem_ver)
207
210
  puts " ... updating rubygems to #{gem_ver}"
208
- PatchHelpers.with_env(DEPLOY_ENV) do
209
- out, st = Open3.capture2e("#{tbd}/gem", "update", "--no-doc", "--system", gem_ver.to_s)
210
- raise Tebako::Error, "Failed to update rubugems to #{gem_ver} (#{st}):\n #{out}" unless st.exitstatus.zero?
211
- end
212
- ruby_api_ver = ruby_ver.split(".")[0..1].join(".")
211
+ out, st = Open3.capture2e("#{target_dir}/bin/gem", "update", "--no-doc", "--system", gem_ver.to_s)
212
+ raise Tebako::Error, "Failed to update rubugems to #{gem_ver} (#{st}):\n #{out}" unless st.exitstatus.zero?
213
+
213
214
  # Autoload cannot handle statically linked openssl extension
214
215
  # Changing it to require seems to be the simplest solution
215
- PatchHelpers.patch_file("#{tld}/ruby/site_ruby/#{ruby_api_ver}.0/rubygems/openssl.rb",
216
+ PatchHelpers.patch_file("#{target_dir}/lib/ruby/site_ruby/#{ruby_api_ver}/rubygems/openssl.rb",
216
217
  { "autoload :OpenSSL, \"openssl\"" => "require \"openssl\"" })
217
218
  end
218
219
  end
@@ -26,5 +26,5 @@
26
26
  # POSSIBILITY OF SUCH DAMAGE.
27
27
 
28
28
  module Tebako
29
- VERSION = "0.7.0"
29
+ VERSION = "0.7.2.rc1"
30
30
  end
data/version.txt CHANGED
@@ -1 +1 @@
1
- 0.7.0
1
+ 0.7.2
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tebako
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.2.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-28 00:00:00.000000000 Z
11
+ date: 2024-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor