tebako 0.5.2 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/CMakeLists.txt +24 -34
  3. data/README.adoc +53 -28
  4. data/Rakefile +1 -1
  5. data/common.env +2 -2
  6. data/exe/tebako-packager +5 -3
  7. data/lib/tebako/cli.rb +23 -0
  8. data/lib/tebako/cli_helpers.rb +3 -3
  9. data/lib/tebako/packager/pass1.rb +3 -1
  10. data/lib/tebako/packager/pass2.rb +68 -284
  11. data/{tests-2/fixtures/gems-expressir/gems-expressir.rb → lib/tebako/packager/patch_helpers.rb} +34 -5
  12. data/lib/tebako/packager/patch_literals.rb +277 -0
  13. data/lib/tebako/packager.rb +47 -16
  14. data/lib/tebako/version.rb +1 -1
  15. data/tebako.gemspec +1 -1
  16. data/version.txt +1 -1
  17. metadata +4 -63
  18. data/cmake/def_tty_colours.cmake +0 -19
  19. data/tests/scripts/cross-tests.sh +0 -34
  20. data/tests/scripts/functional-tests.sh +0 -335
  21. data/tests/test-00/test.rb +0 -4
  22. data/tests/test-01/tebako-test-run.rb +0 -5
  23. data/tests/test-09/tebako-test-0.0.1.gem +0 -0
  24. data/tests/test-11/bin/tebako-test-run.rb +0 -10
  25. data/tests/test-11/lib/tebako-test.rb +0 -20
  26. data/tests/test-11/tebako-test.gemspec +0 -15
  27. data/tests/test-12/tebako-test-a.gemspec +0 -15
  28. data/tests/test-12/tebako-test-b.gemspec +0 -15
  29. data/tests/test-13/bin/tebako-test-run.rb +0 -10
  30. data/tests/test-13/lib/tebako-test.rb +0 -20
  31. data/tests/test-13/tebako-test.gemspec +0 -15
  32. data/tests/test-15/Gemfile +0 -8
  33. data/tests/test-15/Rakefile +0 -4
  34. data/tests/test-15/bin/tebako-test-run.rb +0 -10
  35. data/tests/test-15/lib/tebako/bundle/test/version.rb +0 -9
  36. data/tests/test-15/lib/tebako/bundle/test.rb +0 -29
  37. data/tests/test-15/tebako-bundle-test.gemspec +0 -30
  38. data/tests/test-16/Gemfile +0 -8
  39. data/tests/test-16/Rakefile +0 -4
  40. data/tests/test-16/bin/tebako-test-run.rb +0 -10
  41. data/tests/test-16/lib/tebako/bundle/test/version.rb +0 -9
  42. data/tests/test-16/lib/tebako/bundle/test.rb +0 -29
  43. data/tests/test-16/tebako-bundle-test.gemspec +0 -24
  44. data/tests/test-18/Gemfile +0 -5
  45. data/tests/test-18/tebako-test-run.rb +0 -12
  46. data/tests/test-19/Gemfile +0 -6
  47. data/tests/test-19/tebako-test-run.rb +0 -11
  48. data/tests-2/fixtures/gems-bundler/Gemfile +0 -4
  49. data/tests-2/fixtures/gems-bundler/gems-bundler.rb +0 -34
  50. data/tests-2/fixtures/gems-byebug/Gemfile +0 -5
  51. data/tests-2/fixtures/gems-byebug/gems-byebug.rb +0 -31
  52. data/tests-2/fixtures/gems-expressir/Gemfile +0 -7
  53. data/tests-2/fixtures/gems-libmspack/Gemfile +0 -5
  54. data/tests-2/fixtures/gems-libmspack/gems-libmspack.rb +0 -91
  55. data/tests-2/fixtures/gems-sassc/Gemfile +0 -6
  56. data/tests-2/fixtures/gems-sassc/base_style/all.scss +0 -1
  57. data/tests-2/fixtures/gems-sassc/base_style/reset.scss +0 -100
  58. data/tests-2/fixtures/gems-sassc/gems-sassc.rb +0 -129
  59. data/tests-2/fixtures/gems-seven-zip/Gemfile +0 -7
  60. data/tests-2/fixtures/gems-seven-zip/gems-seven-zip.rb +0 -53
  61. data/tests-2/fixtures/launcher-coreincl/launcher-coreincl.rb +0 -29
  62. data/tests-2/fixtures/launcher-package/launcher-package.rb +0 -29
  63. data/tests-2/fixtures/launcher-pwd/launcher-pwd.rb +0 -28
  64. data/tests-2/fixtures/launcher-stdinredir/input.txt +0 -1
  65. data/tests-2/fixtures/launcher-stdinredir/launcher-stdinredir.rb +0 -31
  66. data/tests-2/fixtures/launcher-stdoutredir/launcher-stdoutredir.rb +0 -28
  67. data/tests-2/fixtures/patches-dir/level-1/level-2/file-1.txt +0 -1
  68. data/tests-2/fixtures/patches-dir/level-1/level-2/file-2.txt +0 -1
  69. data/tests-2/fixtures/patches-dir/level-1/level-2/file-3.txt +0 -1
  70. data/tests-2/fixtures/patches-dir/patches-dir.rb +0 -154
  71. data/tests-2/fixtures/patches-io-and-file/level-1/level-2/file-1.txt +0 -1
  72. data/tests-2/fixtures/patches-io-and-file/level-1/level-2/file-2.txt +0 -2
  73. data/tests-2/fixtures/patches-io-and-file/level-1/level-2/file-3.txt +0 -1
  74. data/tests-2/fixtures/patches-io-and-file/level-1/link-3 +0 -1
  75. data/tests-2/fixtures/patches-io-and-file/patches-io-and-file.rb +0 -87
  76. data/tests-2/fixtures/patches-main/patches-main.rb +0 -6
  77. data/tests-2/tebako-test.rb +0 -313
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97effadb1d79ead536d7307438fce1d4e41b352c9f202e34f6d37986f350215d
4
- data.tar.gz: c01f702f67e2bec7a2224ebc73aea1e0d583922936707c973e86cdb59cafea9a
3
+ metadata.gz: b93ceda3b8a6329b0a332f3ebfbf4c24ff030eda6c1727109623a98bbf868eae
4
+ data.tar.gz: 78e53009d65e1841a8c706b3be9fcbe17f7976864d23e5f70bf07357f3f2701f
5
5
  SHA512:
6
- metadata.gz: 32f7c455cb6c3784cfd1892b06541c639dd43e9cc34711e40cfad0aabc0bad9b71e51046bf06acc5eb0ad5ed72614eed90f76357d310ce7aaaadc79158a2f561
7
- data.tar.gz: ba76a9795e68cd101d68dd5f0824ab73bd3afee6fe717194b46d83c3a670ac57102bc63b06cd15b49516cfaaa5b4a77ac3f7949b99b386fdd295d16e5ac8d15b
6
+ metadata.gz: c256ed82865bea01ac84c9c5bc33f7ef0c99df2d143eb78ac1f6b486492d42affb10fe14f590665a7a00b2c397ae57d9ba7cd3c52b6742b5740965340eeb1c77
7
+ data.tar.gz: 2d5dd78d7ccdf95f06b7453b4939ebc81e759242fbf37259edd95e598901adc6a5af6828cf1c57c081c7c7f487c6a4609e3f1c8d2b59e070a5be0869448781f1
data/CMakeLists.txt CHANGED
@@ -63,23 +63,6 @@ else(MINGW)
63
63
  set(FS_CURRENT ${FS_CURRENT_RAW})
64
64
  endif(MINGW)
65
65
 
66
- # External dependencies
67
- # ---------------------------------------------------------------------------------------------------
68
- # DwarFS dependencies:
69
- # ronn binutils-dev libarchive-dev libevent-dev libjemalloc-dev acl-dev \
70
- # libdouble-conversion-dev libiberty-dev liblz4-dev liblzma-dev libssl-dev \
71
- # libboost-context-dev libboost-filesystem-dev libboost-program-options-dev \
72
- # libboost-regex-dev libboost-system-dev libboost-thread-dev \
73
- # libunwind-dev libdwarf-dev libelf-dev libfmt-dev libfuse3-dev libgoogle-glog-dev \
74
- # bison flex fuse3 pkg-config libsodium-dev
75
- # ---------------------------------------------------------------------------------------------------
76
- # Ruby dependencies:
77
- # libffi-dev libgdbm-dev libyaml-dev libncurses-dev libreadline-dev
78
- # ---------------------------------------------------------------------------------------------------
79
- # For Rails testing only:
80
- # libsqlite3-dev
81
- # ---------------------------------------------------------------------------------------------------
82
-
83
66
  set(RUBY_DEBUG_BUILD OFF)
84
67
 
85
68
  include(ExternalProject)
@@ -90,8 +73,6 @@ include(${CMAKE_SOURCE_DIR}/tools/cmake-scripts/macos-environment.cmake)
90
73
  include(${CMAKE_SOURCE_DIR}/tools/cmake-scripts/msys-environment.cmake)
91
74
  include(${CMAKE_SOURCE_DIR}/tools/cmake-scripts/def-external-project.cmake)
92
75
 
93
- include(${CMAKE_SOURCE_DIR}/cmake/def_tty_colours.cmake)
94
-
95
76
  option(SETUP_MODE "Tebako setup" OFF)
96
77
  if(NOT LOG_LEVEL)
97
78
  set(LOG_LEVEL "error")
@@ -102,7 +83,7 @@ set(START_WITH_PACKAGED_FILESYSTEM OFF CACHE BOOL "Start workflow from 'packaged
102
83
  if (NOT ${SETUP_MODE})
103
84
  message("Running tebako press script")
104
85
  if (${START_WITH_PACKAGED_FILESYSTEM})
105
- message("${ColourBoldRed}*** Starting workflow from 'packaged filesystem' target ***${ColourReset}")
86
+ message("*** Starting workflow from 'packaged filesystem' target ***")
106
87
  endif(${START_WITH_PACKAGED_FILESYSTEM})
107
88
 
108
89
  if ("-${ROOT}" STREQUAL "-")
@@ -191,6 +172,12 @@ elseif("${OSTYPE_TXT}" MATCHES "^msys*")
191
172
  set(RUBY_MAKEFILE "--file=GNUmakefile")
192
173
  elseif("${OSTYPE_TXT}" MATCHES "^darwin.*")
193
174
  set(IS_DARWIN ON)
175
+ if(${RUBY_VER} VERSION_LESS "3.2.0")
176
+ set(OPENSSL_VER "1.1")
177
+ else(${RUBY_VER} VERSION_LESS "3.2.0")
178
+ set(OPENSSL_VER "3")
179
+ endif(${RUBY_VER} VERSION_LESS "3.2.0")
180
+ set(BUILD_OPENSSL_ROOT_DIR "${BUILD_BREW_PREFIX}/opt/openssl@${OPENSSL_VER}")
194
181
  endif()
195
182
 
196
183
  # Various locations for external projects
@@ -210,8 +197,8 @@ set(DATA_RES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/resources)
210
197
  # External projects
211
198
 
212
199
  if ("-${RUBY_VER}" STREQUAL "-" OR "-${RUBY_HASH}" STREQUAL "-")
213
- set(RUBY_VER "3.0.6")
214
- set(RUBY_HASH "6e6cbd490030d7910c0ff20edefab4294dfcd1046f0f8f47f78b597987ac683e")
200
+ set(RUBY_VER "3.1.4")
201
+ set(RUBY_HASH "a3d55879a0dfab1d7141fdf10d22a07dbf8e5cdc4415da1bde06127d5cc3c7b6")
215
202
  message(STATUS "Using default Ruby version ${RUBY_VER}")
216
203
  endif()
217
204
 
@@ -232,12 +219,8 @@ if(IS_MSYS)
232
219
  include(${CMAKE_SOURCE_DIR}/tools/cmake-scripts/setup-openssl.cmake)
233
220
  endif(IS_MSYS)
234
221
 
235
- if(WITH_OPENSSL_BUILD)
236
- def_ext_prj_g(OPENSSL "1.1.1s")
237
- endif(WITH_OPENSSL_BUILD)
238
-
239
222
  def_ext_prj_g(INCBIN "348e36b")
240
- def_ext_prj_g(DWARFS_WR "v0.3.4")
223
+ def_ext_prj_g(DWARFS_WR "v0.3.5")
241
224
 
242
225
  if (DEFINED ENV{BUNDLER_VER})
243
226
  set(BUNDLER_VER $ENV{BUNDLER_VER})
@@ -255,6 +238,11 @@ else()
255
238
  set(WITH_NCURSES_BUILD OFF)
256
239
  endif()
257
240
 
241
+ set(LIBYAML_RUBY_OPTION "")
242
+ if(${RUBY_VER} VERSION_LESS "3.2.0")
243
+ set(LIBYAML_RUBY_OPTION "--enable-bundled-libyaml")
244
+ endif(${RUBY_VER} VERSION_LESS "3.2.0")
245
+
258
246
  message("Configuration summary:")
259
247
  message(STATUS "ruby: v${RUBY_VER} at ${RUBY_SOURCE_DIR}")
260
248
  message(STATUS "bundler version: ${BUNDLER_VER} (${BUNDLER_ANNOTATION})")
@@ -267,6 +255,7 @@ if(WITH_NCURSES_BUILD)
267
255
  else()
268
256
  message(STATUS "ncurses: ${_LIBNCURSES}")
269
257
  endif(WITH_NCURSES_BUILD)
258
+
270
259
  message(STATUS "incbin: @${INCBIN_TAG} at ${INCBIN_SOURCE_DIR}")
271
260
  message(STATUS "dwarfs with tebako wrapper: @${DWARFS_WR_TAG} at ${DWARFS_WR_SOURCE_DIR}")
272
261
 
@@ -318,6 +307,7 @@ ExternalProject_Add(${INCBIN_PRJ}
318
307
  PREFIX ${DEPS}
319
308
  GIT_REPOSITORY https://github.com/graphitemaster/incbin.git
320
309
  GIT_TAG ${INCBIN_TAG}
310
+ BUILD_IN_SOURCE true
321
311
  CONFIGURE_COMMAND ""
322
312
  BUILD_COMMAND ""
323
313
  INSTALL_COMMAND ${CMAKE_COMMAND} -E make_directory ${DEPS_INCLUDE_DIR}/incbin
@@ -424,9 +414,9 @@ endif()
424
414
  set(C_FLAGS_DEST cppflags)
425
415
 
426
416
  if(IS_DARWIN)
427
- string(CONCAT RUBY_C_FLAGS ${RUBY_C_FLAGS} " -I${BUILD_BREW_PREFIX}/include -I/opt/openssl@1.1/include -I${BUILD_BREW_PREFIX}/opt/zlib/include")
428
- string(CONCAT RUBY_L_FLAGS ${RUBY_L_FLAGS} " -L${BUILD_BREW_PREFIX}/lib -L${BUILD_BREW_PREFIX}/opt/openssl@1.1/lib -L${BUILD_BREW_PREFIX}/opt/zlib/lib")
429
- set(OPENSSL_RUBY_OPTION "--with-openssl-dir=${BUILD_BREW_PREFIX}/opt/openssl@1.1")
417
+ string(CONCAT RUBY_C_FLAGS ${RUBY_C_FLAGS} " -I${BUILD_BREW_PREFIX}/opt/openssl@${OPENSSL_VER}/include -I${BUILD_BREW_PREFIX}/opt/zlib/include -I${BUILD_BREW_PREFIX}/include")
418
+ string(CONCAT RUBY_L_FLAGS ${RUBY_L_FLAGS} " -L${BUILD_BREW_PREFIX}/opt/openssl@${OPENSSL_VER}/lib -L${BUILD_BREW_PREFIX}/opt/zlib/lib -L${BUILD_BREW_PREFIX}/lib")
419
+ set(OPENSSL_RUBY_OPTION "--with-openssl-dir=${BUILD_BREW_PREFIX}/opt/openssl@${OPENSSL_VER}")
430
420
  set(C_FLAGS_DEST cflags)
431
421
  endif(IS_DARWIN)
432
422
 
@@ -440,7 +430,8 @@ endif(RB_W32)
440
430
 
441
431
  message(STATUS "Ruby build ${C_FLAGS_DEST}='${RUBY_C_FLAGS}'")
442
432
  message(STATUS "Ruby build LDFLAGS='${RUBY_L_FLAGS}'")
443
- message(STATUS "Openssl Ruby option='${OPENSSL_RUBY_OPTION}'")
433
+ message(STATUS "openssl Ruby option='${OPENSSL_RUBY_OPTION}'")
434
+ message(STATUS "libyaml Ruby option='${LIBYAML_RUBY_OPTION}'")
444
435
 
445
436
  ExternalProject_Add(${RUBY_PRJ}
446
437
  PREFIX ${DEPS}
@@ -450,8 +441,7 @@ ExternalProject_Add(${RUBY_PRJ}
450
441
  SOURCE_DIR ${RUBY_SOURCE_DIR}
451
442
  BUILD_IN_SOURCE true
452
443
  PATCH_COMMAND ruby ${EXE}/tebako-packager pass1 ${OSTYPE_TXT} ${RUBY_SOURCE_DIR} ${FS_MOUNT_POINT} ${DATA_SRC_DIR} ${RUBY_VER}
453
- CONFIGURE_COMMAND ${GNU_BASH} -c "${RUBY_SOURCE_DIR}/configure ${OPENSSL_RUBY_OPTION} \
454
- --enable-bundled-libyaml \
444
+ CONFIGURE_COMMAND ${GNU_BASH} -c "${RUBY_SOURCE_DIR}/configure ${OPENSSL_RUBY_OPTION} ${LIBYAML_RUBY_OPTION} \
455
445
  --without-gmp \
456
446
  --disable-dtrace \
457
447
  --disable-debug-env \
@@ -496,7 +486,7 @@ else (${SETUP_MODE})
496
486
  list(LENGTH GEMS GLENGTH)
497
487
 
498
488
  add_custom_target(clean_filesystem
499
- COMMAND ruby ${EXE}/tebako-packager deploy ${RUBY_STASH_DIR} ${DATA_SRC_DIR} ${DATA_PRE_DIR} ${DATA_BIN_DIR}
489
+ COMMAND ruby ${EXE}/tebako-packager deploy ${RUBY_STASH_DIR} ${DATA_SRC_DIR} ${DATA_PRE_DIR} ${DATA_BIN_DIR} ${TBD} ${TGD}
500
490
  DEPENDS ${RUBY_PRJ}
501
491
  )
502
492
  if(GSLENGTH GREATER 0)
data/README.adoc CHANGED
@@ -40,9 +40,11 @@ The Tebako packager is tested on the following platforms:
40
40
  == Supported Ruby versions
41
41
 
42
42
  The Tebako packager supports the following versions of Ruby for packaging:
43
+
43
44
  * 2.7.7
44
45
  * 3.0.6
45
46
  * 3.1.4
47
+ * 3.2.2
46
48
 
47
49
  Support of specific version including minor release requires some effort, sometimes extensive
48
50
  but our goal is to be able to package all maintained Ruby releases.
@@ -88,13 +90,11 @@ apt-get install -y binutils-dev libarchive-dev libevent-dev libjemalloc-dev acl-
88
90
 
89
91
  === General
90
92
 
91
- Just clone this repository, install Ruby bundle and run `tebako setup` as follows.
93
+ Tebako is distributed as a Ruby gem
92
94
 
93
95
  [source,sh]
94
96
  ----
95
- git clone https://github.com/tamatebako/tebako
96
- bundle install
97
- tebako/exe/tebako setup
97
+ gem install tebako
98
98
  ----
99
99
 
100
100
  === Quick setup on Ubuntu 20.04 on Docker
@@ -122,9 +122,6 @@ apt-get install -y software-properties-common
122
122
  add-apt-repository -y ppa:ubuntu-toolchain-r/test
123
123
  apt-get install -y gcc-9 g++-9
124
124
 
125
- update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100 --slave /usr/bin/g++ g++ /usr/bin/g++-9 --slave /usr/bin/gcov gcov /usr/bin/gcov-9
126
- update-alternatives --set gcc /usr/bin/gcc-9
127
-
128
125
  apt-get install -y curl git ruby ruby-dev pkg-config bison flex make autoconf
129
126
  curl https://apt.kitware.com/kitware-archive.sh | bash
130
127
  apt-get install -y cmake
@@ -134,14 +131,10 @@ apt-get install -y binutils-dev libarchive-dev libevent-dev libjemalloc-dev acl-
134
131
  libboost-context-dev libboost-filesystem-dev libboost-program-options-dev \
135
132
  libboost-regex-dev libboost-system-dev libboost-thread-dev \
136
133
  libunwind-dev libdwarf-dev libelf-dev libfuse-dev libgoogle-glog-dev \
137
- libffi-dev libgdbm-dev libyaml-dev libncurses-dev libreadline-dev \
138
- libsqlite3-dev
134
+ libffi-dev libgdbm-dev libyaml-dev libncurses-dev libreadline-dev libfmt-dev
139
135
 
140
- apt-get install -y libfmt-dev
136
+ gem install tebako
141
137
 
142
- git clone https://github.com/tamatebako/tebako
143
- bundle install
144
- tebako/exe/tebako setup
145
138
  ----
146
139
 
147
140
  == Usage
@@ -167,14 +160,14 @@ itself takes minutes.
167
160
  You can manage setup of packaging environment manually; please refer to description of setup and clean
168
161
  cmmands below.
169
162
 
170
- [source,sh]
163
+ [source]
171
164
  ----
172
- <install-folder>/exe/tebako press \
173
- [-p |--prefix=<tebako-root-folder>] \
174
- [-R | --Ruby=<2.7.7|3.0.6|3.1.4>] \
165
+ tebako press \
166
+ [-p|--prefix=<tebako-root-folder>] \
167
+ [-R|--Ruby=<2.7.7|3.0.6|3.1.4|3.2.2>] \
175
168
  -r|--root=<project-root-folder> \
176
169
  -e|--entry-point=<entry-point> \
177
- [-o |--output=<packaged file name>] \
170
+ [-o|--output=<packaged file name>] \
178
171
  [-l|--log-level=<error|warn|debug|trace>]
179
172
  ----
180
173
 
@@ -200,7 +193,7 @@ point base name`)
200
193
  ====
201
194
  [source,sh]
202
195
  ----
203
- exe/tebako press \
196
+ tebako press \
204
197
  --root='~/projects/myproject' \
205
198
  --entry=start.rb \
206
199
  --output=/temp/myproject.tebako
@@ -217,11 +210,11 @@ directories differ and nultiple Ruby versions within single configuration
217
210
  This command is optional, tebako creates packaging environment automatically upon the first
218
211
  invocation of press command.
219
212
 
220
- [source,sh]
213
+ [source]
221
214
  ----
222
- <install-folder>/exe/tebako setup \
215
+ tebako setup \
223
216
  [-p |--prefix=<tebako-root-folder>] \
224
- [-R | --Ruby=<2.7.7|3.0.6|3.1.4>]
217
+ [-R |--Ruby=<2.7.7|3.0.6|3.1.4|3.2.2>]
225
218
  ----
226
219
 
227
220
  Where:
@@ -229,34 +222,66 @@ Where:
229
222
  * `<tebako-root-folder>`, the Tebako setup folder (optional, defaults to current
230
223
  folder)
231
224
 
232
- * `Ruby` parameter defines Ruby version that will be packaged (optional, defaults to 3.0.6)
233
-
234
-
225
+ * `Ruby` parameter defines Ruby version that will be packaged (optional, defaults to 3.1.4)
235
226
 
236
227
  ==== Clean
237
228
 
238
229
  This command deletes tebako artifacts created by setup and press commands.
239
230
  Normally you do not need to do it since tebako packager optimizes artifacts lifecycle on its own.
240
231
 
232
+ [source]
233
+ ----
234
+ tebako clean \
235
+ [-p|--prefix=<tebako-root-folder>]
236
+ ----
237
+
238
+ Where:
239
+
240
+ * `<tebako-root-folder>`, the Tebako setup folder (optional, defaults to current
241
+ folder)
242
+
243
+ [example]
244
+ ====
241
245
  [source,sh]
242
246
  ----
243
- exe/tebako press \
244
- [-p |--prefix=<tebako-root-folder>]
247
+ tebako clean --prefix='~/.tebako'
248
+ ----
249
+ ====
250
+
251
+ ==== Clean ruby
252
+
253
+ This command deletes tebako Ruby artifacts created by setup and press commands. Dwarfs libraries are not cleaned.
254
+ Normally you do not need to do it since tebako packager optimizes artifacts lifecycle on its own.
255
+
256
+ [source]
257
+ ----
258
+ tebako clean_ruby
259
+ [-p|--prefix=<tebako-root-folder>]
260
+ [-R|--Ruby=<2.7.7|3.0.6|3.1.4|3.2.2>]
245
261
  ----
246
262
 
247
263
  Where:
248
264
 
249
265
  * `<tebako-root-folder>`, the Tebako setup folder (optional, defaults to current
250
266
  folder)
267
+ * `Ruby` parameter defines Ruby version that will cleaned (optional, cleans all versions by default)
251
268
 
252
269
  [example]
253
270
  ====
254
271
  [source,sh]
255
272
  ----
256
- exe/tebako clean --root='~/projects/myproject'
273
+ tebako clean_ruby --prefix='~/.tebako'
257
274
  ----
258
275
  ====
259
276
 
277
+ ==== Build script hash
278
+ Hash command will calculate tebako script hash that may be used as a cache key in CI/CD environment like GitHub Actions
279
+
280
+ [source]
281
+ ----
282
+ tebako hash
283
+ ----
284
+
260
285
  === Exit codes
261
286
 
262
287
  [cols,"a,a"]
data/Rakefile CHANGED
@@ -36,7 +36,7 @@ desc "Generate version.txt"
36
36
  task "generate_version_txt" do
37
37
  require_relative "lib/tebako/version"
38
38
  File.write(File.join(__dir__, "version.txt"), "#{Tebako::VERSION}\n")
39
- puts "Generate version.txt #{Tebako::VERSION} ==> #{File.join(__dir__, "version.txt")}"
39
+ puts "Generating version.txt #{Tebako::VERSION} --> #{File.join(__dir__, "version.txt")}"
40
40
  end
41
41
 
42
42
  task build: :generate_version_txt
data/common.env CHANGED
@@ -1,6 +1,6 @@
1
1
  BUILD_TYPE=Release
2
2
  DEPS=deps
3
3
  INCBIN_TAG=348e36b
4
- DWARFS_WR_TAG=v0.3.4
4
+ DWARFS_WR_TAG=v0.3.5
5
5
  BUNDLER_VER=2.3.22
6
- RUBY_VER=3.0.6
6
+ RUBY_VER=3.1.4
data/exe/tebako-packager CHANGED
@@ -78,11 +78,13 @@ begin
78
78
  # ARGV[2] -- DATA_SRC_DIR
79
79
  # ARGV[3] -- DATA_PRE_DIR
80
80
  # ARGV[4] -- DATA_BIN_DIR
81
- unless ARGV.length == 5
81
+ # ARGV[5] -- TARGET_BIN_DIR (TBD)
82
+ # ARGV[6] -- TARGET_GEM_DIR (TGD)
83
+ unless ARGV.length == 7
82
84
  raise Tebako::Error,
83
- "tebako-packager deploy command expects 5 arguments, #{ARGV.length} has been provided."
85
+ "tebako-packager deploy command expects 7 arguments, #{ARGV.length} has been provided."
84
86
  end
85
- Tebako::Packager.deploy(ARGV[1], ARGV[2], ARGV[3], ARGV[4])
87
+ Tebako::Packager.deploy(ARGV[1], ARGV[2], ARGV[3], ARGV[4], ARGV[5])
86
88
  else
87
89
  raise Tebako::Error, "tebako-packager cannot process #{ARGV[0]} command"
88
90
  end
data/lib/tebako/cli.rb CHANGED
@@ -26,6 +26,7 @@
26
26
  # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
27
  # POSSIBILITY OF SUCH DAMAGE.
28
28
 
29
+ require "digest"
29
30
  require "fileutils"
30
31
  require "thor"
31
32
  require "yaml"
@@ -49,6 +50,28 @@ module Tebako
49
50
  FileUtils.rm_rf([deps, output], secure: true)
50
51
  end
51
52
 
53
+ desc "clean_ruby", "Clean Ruby source from tebako packaging environment"
54
+ method_option :Ruby, type: :string, aliases: "-R", required: false,
55
+ enum: Tebako::CliHelpers::RUBY_VERSIONS.keys,
56
+ desc: "Ruby version to clean, all available versions by default"
57
+ def clean_ruby
58
+ puts "Cleaning Ruby sources from tebako packaging environment"
59
+ if options["Ruby"].nil?
60
+ nmr = "#{deps}/src/_ruby_*"
61
+ nms = "#{deps}/stash_*"
62
+ else
63
+ nmr = "#{deps}/src/_ruby_#{options["Ruby"]}*"
64
+ nms = "#{deps}/stash_#{options["Ruby"]}"
65
+ end
66
+ FileUtils.rm_rf(Dir.glob(nmr), secure: true)
67
+ FileUtils.rm_rf(Dir.glob(nms), secure: true)
68
+ end
69
+
70
+ desc "hash", "Print build script hash (ci cache key)"
71
+ def hash
72
+ print Digest::SHA256.hexdigest File.read File.join(__dir__, "../..", "CMakeLists.txt")
73
+ end
74
+
52
75
  desc "press", "Press tebako image"
53
76
  method_option :"entry-point", type: :string, aliases: ["-e", "--entry"], required: true,
54
77
  desc: "Ruby application entry point"
@@ -63,11 +63,11 @@ module Tebako
63
63
  RUBY_VERSIONS = {
64
64
  "2.7.7" => "e10127db691d7ff36402cfe88f418c8d025a3f1eea92044b162dd72f0b8c7b90",
65
65
  "3.0.6" => "6e6cbd490030d7910c0ff20edefab4294dfcd1046f0f8f47f78b597987ac683e",
66
- "3.1.4" => "a3d55879a0dfab1d7141fdf10d22a07dbf8e5cdc4415da1bde06127d5cc3c7b6"
67
- # "3.2.2" => "96c57558871a6748de5bc9f274e93f4b5aad06cd8f37befa0e8d94e7b8a423bc"
66
+ "3.1.4" => "a3d55879a0dfab1d7141fdf10d22a07dbf8e5cdc4415da1bde06127d5cc3c7b6",
67
+ "3.2.2" => "96c57558871a6748de5bc9f274e93f4b5aad06cd8f37befa0e8d94e7b8a423bc"
68
68
  }.freeze
69
69
 
70
- DEFAULT_RUBY_VERSION = "3.0.6"
70
+ DEFAULT_RUBY_VERSION = "3.1.4"
71
71
 
72
72
  def extend_ruby_version
73
73
  version = options["Ruby"].nil? ? DEFAULT_RUBY_VERSION : options["Ruby"]
@@ -25,6 +25,8 @@
25
25
  # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26
26
  # POSSIBILITY OF SUCH DAMAGE.
27
27
 
28
+ require_relative "patch_helpers"
29
+
28
30
  # Tebako - an executable packager
29
31
  module Tebako
30
32
  module Packager
@@ -111,7 +113,7 @@ module Tebako
111
113
  # ....................................................
112
114
  # autoload :OpenSSL, "openssl"
113
115
  # fails to deal with a default gem from statically linked extension
114
- patch_map.store("lib/rubygems/openssl.rb", RUBYGEM_OPENSSL_RB_PATCH) if ruby_ver[0] == "3"
116
+ patch_map.store("lib/rubygems/openssl.rb", RUBYGEM_OPENSSL_RB_PATCH) if PatchHelpers.ruby3x?(ruby_ver)
115
117
 
116
118
  patch_map
117
119
  end