tebako 0.12.15 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CMakeLists.txt +3 -3
- data/CODE_OF_CONDUCT.adoc +128 -0
- data/CONTRIBUTING.adoc +294 -0
- data/Gemfile +1 -1
- data/INSTALLATION.adoc +231 -0
- data/LICENSE.md +33 -0
- data/README.adoc +463 -533
- data/Rakefile +1 -1
- data/cmake/copy_dir.cmake +1 -1
- data/common.env +1 -1
- data/exe/tebako +1 -1
- data/exe/tebako-packager +1 -16
- data/include/tebako/tebako-fs.h +1 -1
- data/include/tebako/tebako-main.h +1 -1
- data/lib/tebako/build_helpers.rb +1 -1
- data/lib/tebako/cache_manager.rb +1 -1
- data/lib/tebako/cli.rb +1 -1
- data/lib/tebako/cli_helpers.rb +34 -8
- data/lib/tebako/codegen.rb +1 -1
- data/lib/tebako/deploy_helper.rb +8 -7
- data/lib/tebako/error.rb +1 -1
- data/lib/tebako/options_manager.rb +29 -9
- data/lib/tebako/package_descriptor.rb +1 -1
- data/lib/tebako/packager/pass1_patch.rb +1 -1
- data/lib/tebako/packager/pass1a_patch.rb +1 -1
- data/lib/tebako/packager/pass2_patch.rb +1 -1
- data/lib/tebako/packager/pass2_patch_crt.rb +1 -1
- data/lib/tebako/packager/pass2msys_patch.rb +1 -1
- data/lib/tebako/packager/patch.rb +1 -1
- data/lib/tebako/packager/patch_buildsystem.rb +1 -1
- data/lib/tebako/packager/patch_helpers.rb +1 -1
- data/lib/tebako/packager/patch_libraries.rb +1 -1
- data/lib/tebako/packager/patch_literals.rb +1 -1
- data/lib/tebako/packager/patch_main.rb +1 -1
- data/lib/tebako/packager/rubygems_patch.rb +1 -1
- data/lib/tebako/packager.rb +4 -4
- data/lib/tebako/packager_lite.rb +3 -3
- data/lib/tebako/ruby_builder.rb +4 -4
- data/lib/tebako/ruby_version.rb +3 -2
- data/lib/tebako/scenario_manager.rb +9 -1
- data/lib/tebako/stripper.rb +1 -1
- data/lib/tebako/version.rb +2 -2
- data/lib/tebako.rb +1 -1
- data/src/tebako-main.cpp +1 -1
- data/tebako.gemspec +1 -1
- data/tools/.github/workflows/build-containers.yml +190 -0
- data/tools/.github/workflows/lint.yml +3 -3
- data/tools/.github/workflows/test.yml +150 -11
- data/tools/ci-scripts/arm-brew-install.sh +1 -1
- data/tools/ci-scripts/arm-brew-setup.sh +1 -1
- data/tools/ci-scripts/level-up.sh +1 -1
- data/tools/ci-scripts/patch-fbthrift.sh +1 -1
- data/tools/ci-scripts/patch-folly.sh +2 -2
- data/tools/ci-scripts/tools.sh +1 -1
- data/tools/ci-scripts/x86-brew-install.sh +1 -1
- data/tools/ci-scripts/x86-brew-setup.sh +1 -1
- data/tools/cmake-scripts/def-external-project.cmake +1 -1
- data/tools/cmake-scripts/macos-environment.cmake +2 -2
- data/tools/cmake-scripts/msys-environment.cmake +1 -1
- data/tools/cmake-scripts/setup-libarchive.cmake +1 -1
- data/tools/cmake-scripts/setup-libfmt.cmake +1 -1
- data/tools/cmake-scripts/setup-libhowardhinnerdate.cmake +1 -1
- data/tools/cmake-scripts/setup-libutfcpp.cmake +2 -2
- data/tools/cmake-scripts/setup-openssl-1.1.1.cmake +1 -1
- data/tools/docker/alpine-3.17-dev.Dockerfile +49 -0
- data/tools/docker/tools/tools.sh +66 -0
- data/tools/docker/ubuntu-20.04-dev.Dockerfile +51 -0
- data/tools/dwarfs-test-helper/CMakeLists.txt +1 -1
- data/tools/include/pro-statvfs.h +1 -1
- data/tools/tests/cmake/CMakeLists.txt +1 -1
- data/tools/tests/setup-libfmt/CMakeLists.txt +1 -1
- data/tools/tests/setup-libhowardhinnerdate/CMakeLists.txt +1 -1
- data/tools/tests/setup-librachive/CMakeLists.txt +1 -1
- data/tools/tests/setup-libutfcpp/CMakeLists.txt +1 -1
- data/tools/tests/setup-openssl/CMakeLists.txt +1 -1
- metadata +10 -2
data/README.adoc
CHANGED
@@ -1,20 +1,38 @@
|
|
1
1
|
= Tebako: An advanced image packager for interpretive languages
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
.Continuous Integration Status
|
4
|
+
[cols="1,1,3"]
|
5
|
+
|===
|
6
|
+
|*Platform Tests* |Architecture |Status
|
7
|
+
|
8
|
+
.2+|Ubuntu
|
9
|
+
|amd64 | image:https://github.com/tamatebako/tebako/actions/workflows/ubuntu.yml/badge.svg["Ubuntu amd64", link="https://github.com/tamatebako/tebako/actions/workflows/ubuntu.yml"]
|
10
|
+
|arm64 |image:https://api.cirrus-ci.com/github/tamatebako/tebako.svg?branch=main&task=ubuntu-aarch64["Ubuntu aarch64", link="https://cirrus-ci.com/github/tamatebako/tebako"]
|
11
|
+
|
12
|
+
|Alpine
|
13
|
+
|amd64 |image:https://github.com/tamatebako/tebako/actions/workflows/alpine.yml/badge.svg["Alpine", link="https://github.com/tamatebako/tebako/actions/workflows/alpine.yml"]
|
14
|
+
|
15
|
+
|macOS
|
16
|
+
|amd64 + arm64
|
17
|
+
|image:https://github.com/tamatebako/tebako/actions/workflows/macos.yml/badge.svg["macOS amd64 + arm64", link="https://github.com/tamatebako/tebako/actions/workflows/macos.yml"]
|
18
|
+
|
19
|
+
|Windows MSYS2
|
20
|
+
|amd64 |image:https://github.com/tamatebako/tebako/actions/workflows/windows-msys.yml/badge.svg["Windows MSYS2", link="https://github.com/tamatebako/tebako/actions/workflows/windows-msys.yml"]
|
8
21
|
|
9
|
-
|
10
|
-
image:https://api.cirrus-ci.com/github/tamatebako/tebako.svg?branch=main&task=ubuntu-aarch64["Ubuntu aarch64", link="https://cirrus-ci.com/github/tamatebako/tebako"]
|
22
|
+
3+|*Tools Tests*
|
11
23
|
|
12
|
-
|
13
|
-
image:https://github.com/tamatebako/tebako-ci-containers/actions/workflows/build-containers.yml/badge.svg["Tebako
|
24
|
+
|Tebako containers
|
25
|
+
| |image:https://github.com/tamatebako/tebako-ci-containers/actions/workflows/build-containers.yml/badge.svg["Tebako containers", link="https://github.com/tamatebako/tebako-ci-containers/actions/workflows/build-containers.yml"]
|
26
|
+
|
27
|
+
3+|*Quality*
|
28
|
+
|
29
|
+
|Lint and RSpec
|
30
|
+
| |image:https://github.com/tamatebako/tebako/actions/workflows/lint-and-rspec.yml/badge.svg["Lint and RSpec", link="https://github.com/tamatebako/tebako/actions/workflows/lint-and-rspec.yml"]
|
31
|
+
|
32
|
+
|Code Coverage
|
33
|
+
| |image:https://codecov.io/gh/tamatebako/tebako/graph/badge.svg?token=XD3emQ5qsY["Tebako CLI RSpec coverage", link="https://codecov.io/gh/tamatebako/tebako"]
|
34
|
+
|===
|
14
35
|
|
15
|
-
Quality:
|
16
|
-
image:https://github.com/tamatebako/tebako/actions/workflows/lint-and-rspec.yml/badge.svg["lint and rspec", link="https://github.com/tamatebako/tebako/actions/workflows/lint-and-rspec.yml"]
|
17
|
-
image:https://codecov.io/gh/tamatebako/tebako/graph/badge.svg?token=XD3emQ5qsY["Tebako cli rspec coverage", link="https://codecov.io/gh/tamatebako/tebako"]
|
18
36
|
|
19
37
|
== Purpose
|
20
38
|
|
@@ -56,6 +74,8 @@ architectures.
|
|
56
74
|
|
57
75
|
3+| **Linux**
|
58
76
|
| Ubuntu 20.04 | amd64, aarch64 | gcc/g+\+: 10; clang/clang++: 12
|
77
|
+
| Ubuntu 22.04 | amd64, aarch64 | gcc/g+\+: 10; clang/clang++: 12
|
78
|
+
| Ubuntu 24.04 | amd64, aarch64 | gcc/g+\+: 10; clang/clang++: 12
|
59
79
|
| Alpine 3.17 | amd64 | gcc/g+\+: default; clang/clang++: default
|
60
80
|
|
61
81
|
3+| **macOS**
|
@@ -106,7 +126,7 @@ higher.
|
|
106
126
|
| 3.1.6 | Linux, macOS, Windows
|
107
127
|
| 3.2.{4,5,6,7} | Linux, macOS, Windows
|
108
128
|
| 3.3.{3,4,5,6,7} | Linux, macOS, Windows
|
109
|
-
| 3.4.1 | Linux, macOS, Windows
|
129
|
+
| 3.4.{1,2} | Linux, macOS, Windows
|
110
130
|
|
111
131
|
|===
|
112
132
|
|
@@ -131,7 +151,8 @@ macOS packages are forward portable across different macOS versions.
|
|
131
151
|
A Tebako executable package built on macOS 13 (Ventura) can be executed on
|
132
152
|
macOS 14 (Sonoma), but not vice versa.
|
133
153
|
|
134
|
-
`x86_64`
|
154
|
+
macOS packages compiled on `x86_64` can be run on Apple M (ARM64/aarch64)
|
155
|
+
systems.
|
135
156
|
|
136
157
|
|
137
158
|
=== Linux distributions using `musl`
|
@@ -286,453 +307,79 @@ single, performant, executable binary.
|
|
286
307
|
|===
|
287
308
|
|
288
309
|
|
289
|
-
== Usage
|
290
|
-
|
291
|
-
=== Command-line interface
|
292
|
-
|
293
|
-
Tebako works by packaging your project into a single executable binary that
|
294
|
-
includes all the necessary dependencies.
|
295
|
-
|
296
|
-
The way to work with Tebako is through its command-line interface (CLI).
|
297
|
-
It provides the following commands:
|
298
|
-
|
299
|
-
`setup`::
|
300
|
-
Prepares the Tebako packaging environment.
|
301
|
-
|
302
|
-
`press`::
|
303
|
-
Packages a project into a single executable binary.
|
304
|
-
|
305
|
-
`clean`::
|
306
|
-
Removes Tebako artifacts.
|
307
|
-
|
308
|
-
`clean_ruby`::
|
309
|
-
Removes Tebako Ruby artifacts.
|
310
|
-
|
311
|
-
`hash`::
|
312
|
-
Calculates the Tebako script hash for use as a cache key in CI/CD environments.
|
313
|
-
|
314
|
-
`version`::
|
315
|
-
Displays the Tebako version.
|
316
|
-
|
317
|
-
`help`::
|
318
|
-
Displays the help message.
|
319
|
-
|
320
|
-
|
321
|
-
== Usage
|
322
|
-
|
323
|
-
=== General
|
324
|
-
|
325
|
-
Tebako can be used in two ways:
|
326
|
-
|
327
|
-
* Through the Tebako container
|
328
|
-
* Local installation
|
329
|
-
|
330
|
-
Please refer to the <<installation>> section on how to install Tebako.
|
331
|
-
|
332
|
-
|
333
|
-
[[installation]]
|
334
310
|
== Installation
|
335
311
|
|
336
312
|
=== General
|
337
313
|
|
338
|
-
|
339
|
-
|
340
|
-
There is no need to install anything for users who run the packaged application.
|
341
|
-
|
342
|
-
|
343
|
-
=== Using Docker
|
344
|
-
|
345
|
-
==== General
|
346
|
-
|
347
|
-
If you have Docker installed and available, the easiest way to run Tebako is
|
348
|
-
through the official Docker containers.
|
349
|
-
|
350
|
-
Docker containers with preinstalled Tebako packaging environments for Ubuntu and
|
351
|
-
Alpine Linux are available at
|
352
|
-
https://github.com/tamatebako/tebako-ci-containers[tebako-ci-containers].
|
353
|
-
|
354
|
-
|
355
|
-
==== Pull the container
|
356
|
-
|
357
|
-
Pull the Tebako container image.
|
358
|
-
|
359
|
-
[source,sh]
|
360
|
-
----
|
361
|
-
docker pull ghcr.io/tamatebako/tebako-<container_tag>:latest
|
362
|
-
----
|
363
|
-
|
364
|
-
`<container_tag>`:: is the desired image tag (e.g., `ubuntu-20.04` or `alpine-3.17`).
|
365
|
-
|
366
|
-
|
367
|
-
==== Running Tebako commands in the container
|
368
|
-
|
369
|
-
Simply prefix the Tebako command with `docker run` and the container image.
|
370
|
-
|
371
|
-
[source,sh]
|
372
|
-
----
|
373
|
-
docker run -v <application_folder>:/mnt/w \
|
374
|
-
-t ghcr.io/tamatebako/tebako-<container_tag>:latest \
|
375
|
-
tebako {command} {parameters}
|
376
|
-
----
|
377
|
-
|
378
|
-
==== Packaging from outside the container
|
379
|
-
|
380
|
-
To package your application from outside the container, just run a single Docker
|
381
|
-
command.
|
382
|
-
|
383
|
-
This command mounts the application folder into the container and runs the
|
384
|
-
`tebako press` command, specifying the application root, entry point, output
|
385
|
-
location, and Ruby version.
|
386
|
-
|
387
|
-
[source,sh]
|
388
|
-
----
|
389
|
-
docker run -v <application_folder>:/mnt/w \
|
390
|
-
-t ghcr.io/tamatebako/tebako-<container_tag>:latest \
|
391
|
-
tebako press <tebako-press-parameters>
|
392
|
-
----
|
393
|
-
|
394
|
-
`<application_folder>`:: is the path to your application folder.
|
395
|
-
|
396
|
-
`<container_tag>`:: is the desired image tag (e.g., `ubuntu-20.04` or `alpine-3.17`).
|
397
|
-
|
398
|
-
|
399
|
-
[example]
|
400
|
-
====
|
401
|
-
Assume that you have a Ruby application in the `fontist` folder of the current
|
402
|
-
directory.
|
403
|
-
|
404
|
-
You can package it to `./fontist-package` using the following command:
|
405
|
-
|
406
|
-
[source,sh]
|
407
|
-
----
|
408
|
-
docker run -v $PWD:/mnt/w \
|
409
|
-
-t ghcr.io/tamatebako/tebako-ubuntu-20.04:latest \
|
410
|
-
tebako press --root=/mnt/w/fontist --entry-point=fontist --output=/mnt/w/fontist-package --Ruby=3.2.4
|
411
|
-
----
|
412
|
-
====
|
413
|
-
|
414
|
-
==== Packaging from inside the container
|
415
|
-
|
416
|
-
It is also possible to package an application from inside the Tebako container.
|
417
|
-
|
418
|
-
Start and enter the container interactively.
|
419
|
-
|
420
|
-
[source,sh]
|
421
|
-
----
|
422
|
-
docker run -it --rm -v <application_folder>:/mnt/w \
|
423
|
-
ghcr.io/tamatebako/tebako-<container_tag>:latest bash
|
424
|
-
----
|
425
|
-
|
426
|
-
`<application_folder>`:: is the path to your application folder.
|
427
|
-
|
428
|
-
`<container_tag>`:: is the desired image tag (e.g., `ubuntu-20.04` or `alpine-3.17`).
|
314
|
+
Tebako installation is only required for packaging applications.
|
429
315
|
|
316
|
+
Users who run packaged applications do not need to install anything.
|
430
317
|
|
431
|
-
|
318
|
+
Tebako can be used for packaging in two ways:
|
432
319
|
|
433
|
-
[
|
434
|
-
|
435
|
-
tebako press <tebako press parameters>
|
436
|
-
----
|
437
|
-
|
438
|
-
[example]
|
439
|
-
====
|
440
|
-
Assume that you have a Ruby application in the `fontist` folder of the current
|
441
|
-
directory.
|
442
|
-
|
443
|
-
You can package it to `./fontist-package` using the following command:
|
444
|
-
|
445
|
-
[source,sh]
|
446
|
-
----
|
447
|
-
$ docker run -it --rm -v $PWD:/mnt/w ghcr.io/tamatebako/tebako-<container_tag>:latest bash
|
448
|
-
|
449
|
-
# Inside the container:
|
450
|
-
$ tebako press --root=/mnt/w/fontist --entry-point=fontist --output=/mnt/w/fontist-package --Ruby=3.2.4
|
451
|
-
----
|
452
|
-
====
|
320
|
+
* Through the link:https://github.com/tamatebako/tebako-ci-containers[Tebako CI docker containers]
|
321
|
+
* Through local installation
|
453
322
|
|
323
|
+
Installation for both GNU and musl Linux distributions may heavily depend on the OS version,
|
324
|
+
so we recommend using link:https://github.com/tamatebako/tebako-ci-containers[Tebako CI docker containers]
|
325
|
+
for Linux packaging.
|
454
326
|
|
455
327
|
=== Local installation
|
456
328
|
|
457
|
-
|
458
|
-
|
459
|
-
There are cases where Docker may not be suitable for your needs, such as:
|
460
|
-
|
461
|
-
. Admin privileges: Running Docker requires administrative privileges, which
|
462
|
-
means Docker may not be available to users on their machines.
|
463
|
-
|
464
|
-
. Performance penalty: Docker introduces a performance penalty due to the
|
465
|
-
overhead of running containers. This can be a concern when packaging complex
|
466
|
-
applications that require heavy memory usage.
|
467
|
-
|
468
|
-
In such cases, you can choose to install Tebako locally.
|
469
|
-
|
470
|
-
Tebako is distributed as a Ruby gem. A Ruby environment is necessary.
|
471
|
-
|
472
|
-
|
473
|
-
[source,sh]
|
474
|
-
----
|
475
|
-
$ gem install tebako
|
476
|
-
----
|
477
|
-
|
478
|
-
|
479
|
-
==== Prerequisites
|
480
|
-
|
481
|
-
These prerequisites are needed only for users who want to install Tebako on
|
482
|
-
their machine and build all Tebako components locally.
|
483
|
-
|
484
|
-
If you use Docker, there is no need to set up these prerequisites.
|
485
|
-
|
486
|
-
===== Ubuntu 20.04
|
487
|
-
|
488
|
-
====== General
|
489
|
-
|
490
|
-
There are several prerequisites that need to be installed on Ubuntu 20.04 for
|
491
|
-
Tebako to work correctly.
|
492
|
-
|
493
|
-
|
494
|
-
====== GNU C/C++ 10+ or Clang C/C++ 12+
|
495
|
-
|
496
|
-
[source,sh]
|
497
|
-
----
|
498
|
-
apt install -y gcc-10 g++-10
|
499
|
-
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
|
500
|
-
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
|
501
|
-
----
|
502
|
-
|
503
|
-
or
|
504
|
-
|
505
|
-
[source,sh]
|
506
|
-
----
|
507
|
-
apt install -y clang-12
|
508
|
-
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-12 150
|
509
|
-
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-12 150
|
510
|
-
----
|
511
|
-
|
512
|
-
====== CMake version 3.20+
|
513
|
-
|
514
|
-
Tebako requires CMake at a version of at least 3.20+.
|
515
|
-
|
516
|
-
If such CMake version is not available as a default package, set it up as
|
517
|
-
follows.
|
518
|
-
|
519
|
-
.Installing CMake 3.20+
|
520
|
-
[source,sh]
|
521
|
-
----
|
522
|
-
apt-get remove --purge --auto-remove cmake
|
523
|
-
apt-get update
|
524
|
-
apt-get install -y software-properties-common lsb-release curl
|
525
|
-
apt-get clean all
|
526
|
-
curl https://apt.kitware.com/kitware-archive.sh | bash
|
527
|
-
apt-get install cmake
|
528
|
-
----
|
529
|
-
|
530
|
-
====== Other development tools and libraries
|
531
|
-
|
532
|
-
[source,sh]
|
533
|
-
----
|
534
|
-
apt-get -y install sudo git curl build-essential pkg-config bison flex autoconf \
|
535
|
-
binutils-dev libevent-dev acl-dev libfmt-dev libjemalloc-dev libiberty-dev \
|
536
|
-
libdouble-conversion-dev liblz4-dev liblzma-dev libssl-dev libunwind-dev \
|
537
|
-
libboost-filesystem-dev libboost-program-options-dev libboost-system-dev \
|
538
|
-
libboost-iostreams-dev libboost-date-time-dev libboost-context-dev \
|
539
|
-
libboost-regex-dev libboost-thread-dev libbrotli-dev libdwarf-dev libelf-dev \
|
540
|
-
libgoogle-glog-dev libffi-dev libgdbm-dev libyaml-dev libncurses-dev \
|
541
|
-
libreadline-dev libncurses-dev libreadline-dev ruby-dev ruby-bundler \
|
542
|
-
libutfcpp-dev
|
543
|
-
----
|
544
|
-
|
545
|
-
===== Alpine 3.17
|
546
|
-
|
547
|
-
====== General
|
548
|
-
|
549
|
-
There are several prerequisites that need to be installed on Alpine 3.17 for
|
550
|
-
Tebako to work correctly.
|
329
|
+
To use Tebako on macOS or Windows, you need to install it locally.
|
551
330
|
|
552
|
-
|
331
|
+
On Linux, there may be cases where Docker is not suitable for your needs, such as:
|
553
332
|
|
554
|
-
|
333
|
+
1. Administrative privileges: Running Docker requires administrative privileges,
|
334
|
+
which may not be available to all users on their machines.
|
555
335
|
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
boost-dev flex-dev bison make binutils-dev libevent-dev acl-dev sed python3 \
|
560
|
-
pkgconfig lz4-dev openssl-dev zlib-dev xz ninja zip unzip curl libdwarf-dev \
|
561
|
-
libunwind-dev gflags-dev elfutils-dev libevent-static openssl-libs-static \
|
562
|
-
lz4-static xz-dev zlib-static libunwind-static acl-static tar libffi-dev \
|
563
|
-
gdbm-dev yaml-dev yaml-static ncurses-dev ncurses-static readline-dev \
|
564
|
-
readline-static p7zip ruby-dev gcompat gettext-dev gperf brotli-dev \
|
565
|
-
brotli-static jemalloc-dev fmt-dev xz-static
|
566
|
-
----
|
567
|
-
|
568
|
-
===== macOS
|
569
|
-
|
570
|
-
====== General
|
571
|
-
|
572
|
-
There are several prerequisites that need to be installed on macOS for Tebako to work correctly.
|
573
|
-
|
574
|
-
The following instructions work for:
|
575
|
-
|
576
|
-
* macOS 13 (Ventura) through macOS 15 (Sequoia)
|
577
|
-
|
578
|
-
|
579
|
-
====== Homebrew packages
|
580
|
-
|
581
|
-
We use Homebrew to install the necessary packages on macOS.
|
582
|
-
|
583
|
-
[source,sh]
|
584
|
-
----
|
585
|
-
brew update
|
586
|
-
brew install gnu-sed bash pkg-config bison flex binutils libffi gdbm zlib \
|
587
|
-
ncurses double-conversion boost jemalloc fmt glog libevent libsodium lz4 xz \
|
588
|
-
libyaml openssl@3
|
589
|
-
brew bundle
|
590
|
-
----
|
591
|
-
|
592
|
-
Additionaly tebako repository includes `Brewfile` that can be used with
|
593
|
-
`brew bundle` command.
|
594
|
-
|
595
|
-
[source,sh]
|
596
|
-
----
|
597
|
-
brew bundle
|
598
|
-
----
|
599
|
-
|
600
|
-
====== Bison 3+
|
601
|
-
|
602
|
-
Tebako requires Bison 3+.
|
603
|
-
|
604
|
-
On macOS 14, the default Bison version is 2.3, and the Homebrew formula is
|
605
|
-
keg-only, which means that the full path to the Bison binary must be used to
|
606
|
-
utilize the correct version.
|
607
|
-
|
608
|
-
Run the following command prior to using Tebako, or add it into your shell
|
609
|
-
profile.
|
610
|
-
|
611
|
-
[source,sh]
|
612
|
-
----
|
613
|
-
export PATH="$(brew --prefix bison)/bin:$PATH"
|
614
|
-
----
|
615
|
-
|
616
|
-
====== jemalloc library build
|
617
|
-
|
618
|
-
On macOS, the `libdwarfs` build script creates an additional `jemalloc`
|
619
|
-
installation. This is done to satisfy the magic applied by folly during linking
|
620
|
-
but uses a static library.
|
621
|
-
|
622
|
-
If the `jemalloc` library is built within an emulated environment (QEMU,
|
623
|
-
Rosetta, etc.), there are known issues
|
624
|
-
(link:https://github.com/jemalloc/jemalloc/issues/1997[jemalloc issue #1997])
|
625
|
-
where `jemalloc` incorrectly detects the number of significant virtual address
|
626
|
-
bits and therefore defines them wrongly (`lg-vaddr` parameter).
|
627
|
-
|
628
|
-
Technically, these issues can be fixed by explicitly setting the
|
629
|
-
`--with-lg-vaddr` parameter for the `jemalloc` build. However, we decided not to
|
630
|
-
automate this since we do not feel that we can provide reasonable test coverage.
|
631
|
-
|
632
|
-
Instead, our build script accepts the `LG_VADDR` environment variable and passes
|
633
|
-
it to the jemalloc build as `--with-lg-vaddr=${LG_VADDR}`.
|
336
|
+
2. Performance impact: Docker introduces performance overhead due to
|
337
|
+
containerization. This can be a concern when packaging complex
|
338
|
+
applications that require significant memory resources.
|
634
339
|
|
635
|
-
|
636
|
-
bits, which can vary based on the CPU architecture and emulation status.
|
637
|
-
|
638
|
-
This is a simple example script to set `LG_VADDR`.
|
639
|
-
|
640
|
-
NOTE: This is provided for illustration only.
|
641
|
-
|
642
|
-
[example]
|
643
|
-
====
|
644
|
-
[source,sh]
|
645
|
-
----
|
646
|
-
#!/bin/bash
|
647
|
-
|
648
|
-
# Check the CPU architecture
|
649
|
-
ARCH=$(uname -m)
|
650
|
-
|
651
|
-
# Check if running under Rosetta 2 emulation
|
652
|
-
if [[ "$ARCH" == "x86_64" && $(sysctl -n sysctl.proc_translated) == "1" ]]; then
|
653
|
-
echo "Running on Apple Silicon under Rosetta 2 emulation"
|
654
|
-
export LG_VADDR=39
|
655
|
-
elif [[ "$ARCH" == "arm64" ]]; then
|
656
|
-
echo "Running on Apple Silicon"
|
657
|
-
export LG_VADDR=39
|
658
|
-
else
|
659
|
-
echo "Running on Intel Silicon"
|
660
|
-
export LG_VADDR=48
|
661
|
-
fi
|
662
|
-
|
663
|
-
echo "Setting lg-vaddr to $LG_VADDR"
|
664
|
-
----
|
665
|
-
====
|
666
|
-
|
667
|
-
|
668
|
-
===== Windows
|
669
|
-
|
670
|
-
====== General
|
671
|
-
|
672
|
-
The following instructions work for:
|
673
|
-
|
674
|
-
* Windows 10, 11
|
675
|
-
* Windows Server 2019, 2022
|
676
|
-
|
677
|
-
====== Ruby
|
678
|
-
|
679
|
-
To run Tebako you need to have Ruby installed.
|
680
|
-
It is simplest to use the Ruby development environment provided by
|
681
|
-
https://rubyinstaller.org[RubyInstaller].
|
682
|
-
|
683
|
-
For example, Ruby+Devkit 3.1.4-1.
|
684
|
-
|
685
|
-
====== MinGW ucrt64
|
686
|
-
|
687
|
-
Enable MinGW ucrt64 and install the necessary packages.
|
688
|
-
|
689
|
-
The `ridk` command originates from the RubyInstaller installation.
|
690
|
-
|
691
|
-
[source,sh]
|
692
|
-
----
|
693
|
-
$ ridk enable ucrt64
|
694
|
-
$ pacman -S git tar bison flex toolchain make cmake
|
695
|
-
boost diffutils libevent double-conversion
|
696
|
-
fmt glog dlfcn gtest autotools ncurses libyaml
|
697
|
-
----
|
340
|
+
In such cases, you can choose to install Tebako locally on Linux as well.
|
698
341
|
|
342
|
+
Please refer to the separate document link:INSTALLATION.adoc[INSTALLATION.adoc]
|
343
|
+
for instructions on how to install Tebako.
|
699
344
|
|
345
|
+
== Usage
|
700
346
|
|
701
|
-
|
347
|
+
=== Command-line interface
|
702
348
|
|
703
|
-
|
704
|
-
|
349
|
+
Tebako works by packaging your project into a single executable binary that
|
350
|
+
includes all the necessary dependencies.
|
705
351
|
|
706
|
-
|
352
|
+
You interact with Tebako through its command-line interface (CLI),
|
353
|
+
which provides the following commands:
|
707
354
|
|
708
|
-
|
355
|
+
Basic use:
|
709
356
|
|
710
|
-
|
711
|
-
|
357
|
+
`press`::
|
358
|
+
Packages a project into a single executable binary.
|
359
|
+
See <<press>> section for details.
|
712
360
|
|
713
|
-
|
714
|
-
The most direct way to set the root folder is by specifying it through a
|
715
|
-
command-line argument.
|
361
|
+
Advanced use:
|
716
362
|
|
717
|
-
|
718
|
-
|
719
|
-
|
363
|
+
`setup`::
|
364
|
+
Runs post-install setup and creates the Tebako packaging environment.
|
365
|
+
See <<setup>> section for details.
|
720
366
|
|
721
|
-
|
722
|
-
|
723
|
-
|
367
|
+
`clean`::
|
368
|
+
Removes Tebako artifacts.
|
369
|
+
See <<clean>> section for details.
|
724
370
|
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
directory.
|
371
|
+
`clean_ruby`::
|
372
|
+
Removes Tebako Ruby artifacts.
|
373
|
+
See <<clean_ruby>> section for details.
|
729
374
|
|
375
|
+
`hash`::
|
376
|
+
Calculates the Tebako script hash for use as a cache key in CI/CD environments.
|
377
|
+
See <<hash>> section for details.
|
730
378
|
|
731
|
-
|
732
|
-
|
733
|
-
relative paths based on the current working directory and expanding user
|
734
|
-
directory shortcuts like `~`.
|
379
|
+
`help`::
|
380
|
+
Displays the help message.
|
735
381
|
|
382
|
+
== Packaging
|
736
383
|
|
737
384
|
=== Commands
|
738
385
|
|
@@ -766,7 +413,7 @@ tebako press \
|
|
766
413
|
[-R|--Ruby=<ruby-version>] \
|
767
414
|
[-o|--output=<packaged-file-name>] \
|
768
415
|
[-l|--log-level=<error|warn|debug|trace>] \
|
769
|
-
[-c|--cwd=<package
|
416
|
+
[-c|--cwd=<package-current-working-directory>] \
|
770
417
|
[-D|--devmode] \
|
771
418
|
[-P|--patchelf] \
|
772
419
|
[-m|--mode=<bundle|both|application|runtime>] \
|
@@ -776,56 +423,70 @@ tebako press \
|
|
776
423
|
|
777
424
|
Where:
|
778
425
|
|
779
|
-
|
426
|
+
`--entry-point=<entry-point>`::
|
427
|
+
an executable file (binary executable or script) that shall be started when
|
428
|
+
packaged file is called. This parameter is not required if the operation mode is `runtime`.
|
429
|
+
|
430
|
+
`--prefix=<tebako-root-folder>`::
|
780
431
|
the Tebako root folder (see details: <<root-folder-selection>>)
|
781
432
|
|
782
|
-
|
433
|
+
`--Ruby=<ruby-version>`::
|
783
434
|
this parameter defines Ruby version that will be packaged (optional, defaults to
|
784
435
|
`3.3.7`)
|
785
436
|
|
786
|
-
|
437
|
+
`--root=<project-root-folder>`::
|
787
438
|
a folder at the host source file system where project files are located.
|
788
439
|
This parameter is not required if the operation mode is `runtime`.
|
789
440
|
|
790
|
-
|
791
|
-
an executable file (binary executable or script) that shall be started when
|
792
|
-
packaged file is called. This parameter is not required if the operation mode is `runtime`.
|
793
|
-
|
794
|
-
`output`::
|
441
|
+
`--output=<packaged-file-name>`::
|
795
442
|
(optional)
|
796
443
|
the output file name.
|
797
444
|
+
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
445
|
+
On Windows, the output file is automatically appended the `.exe` extension.
|
446
|
+
|
447
|
+
** If the `-o` option is not specified:
|
448
|
+
|
449
|
+
*** in `runtime` mode, the runtime package is created at `tebako-runtime`.
|
450
|
+
*** in `application` mode, the application package is created at `<current-folder>/<entry-point-base-name>`.
|
451
|
+
*** in `bundle` mode, the bundled package is created at `<current-folder>/<entry-point-base-name>`.
|
452
|
+
*** in `both` mode, the runtime package is created at `<current-folder>/<entry-point-base-name>`,
|
453
|
+
and the application package is created at `<current-folder>/<entry-point-base-name>.tebako`.
|
803
454
|
|
804
|
-
`
|
805
|
-
|
455
|
+
** If the `-o` option is specified:
|
456
|
+
|
457
|
+
*** in `runtime` mode, the runtime package is named according to the `-o` option.
|
458
|
+
*** in `application` mode, the application package is named according to the `-o` option.
|
459
|
+
*** in `bundle` mode, the bundled package is named according to the `-o` option.
|
460
|
+
*** in `both` mode, the runtime package is named according to the `-o` option,
|
461
|
+
and the application package is named according to the `-o` option with the `.tebako` extension.
|
462
|
+
|
463
|
+
|
464
|
+
`--log-level=<error|warn|debug|trace>`::
|
806
465
|
(optional, defaults to `error`)
|
466
|
+
logging level for the Tebako built-in memory filesystem driver.
|
807
467
|
|
808
|
-
|
468
|
+
`--cwd=<package-current-working-directory>`::
|
809
469
|
(optional)
|
810
|
-
|
470
|
+
A folder within Tebako memfs where the packaged application will start. This
|
471
|
+
folder should be specified relative to the memfs root.
|
811
472
|
+
|
812
473
|
If not provided, the application will start within the current folder of the
|
813
474
|
host (i.e., at `$PWD`).
|
814
475
|
+
|
815
476
|
This argument is required because it is not possible to change the directory to
|
816
477
|
a memfs folder until the package is started, as opposed to any host folder that
|
817
|
-
can be set as the current directory before Tebako package invocation.
|
478
|
+
can be set as the current directory before Tebako package invocation. Tebako
|
818
479
|
saves the original working directory in a global Ruby variable
|
819
480
|
`$tebako_original_pwd`.
|
820
481
|
|
821
|
-
|
482
|
+
`--devmode`:: flag that activates development mode, in which Tebako's cache and
|
822
483
|
packaging consistency checks are relaxed.
|
823
484
|
|
824
|
-
|
485
|
+
`--patchelf`::
|
825
486
|
Allows forward-compatibility of Tebako packages with Linux GNU distributions.
|
826
487
|
+
|
827
488
|
Specifically, this is a flag that removes a reference to the `GLIBC_PRIVATE`
|
828
|
-
version of `libpthread` from a Tebako package.
|
489
|
+
version of `libpthread` from a Tebako package. This allows Linux GNU packages
|
829
490
|
to run against versions of `libpthread` that differ from the version used for
|
830
491
|
packaging.
|
831
492
|
+
|
@@ -836,32 +497,36 @@ For example, a package created at Ubuntu 20 system can be used on Ubuntu 22.
|
|
836
497
|
+
|
837
498
|
NOTE: The feature is exeprimental, we may consider another approach in the future.
|
838
499
|
|
839
|
-
|
840
|
-
|
500
|
+
`--mode=<mode>`::
|
501
|
+
(optional, defaults to `bundle`)
|
502
|
+
Package output mode, determines whether the runtime and/or application are
|
503
|
+
to be separately packaged.
|
504
|
+
|
505
|
+
`bundle`::: Create a single package bundling both the runtime and application. The output file is named according to the `-o` option.
|
506
|
+
`both`::: Create separate packages for the runtime and application. Outputs two separate files: one for the runtime at the location specified at the `-o {filename}` and one for the application at `{filename}.package`.
|
507
|
+
`application`::: Create the application package only. The output file is named according to the `-o` option.
|
508
|
+
`runtime`::: Create the runtime package only. The output file is named according to the `-o` option.
|
841
509
|
|
842
|
-
`
|
843
|
-
`both`::: create both run-rime and application
|
844
|
-
`application`::: create appplication only
|
845
|
-
`runtime`::: create runtime only
|
510
|
+
More information on the `mode` option is available in the <<Tebako runtime and application packages. Splitting and bundling.>> section.
|
846
511
|
|
847
|
-
|
512
|
+
`--ref`::
|
848
513
|
(optional)
|
849
514
|
Defaults to `tebako-runtime`.
|
850
515
|
When a Tebako application package is created on Windows, it is linked against a
|
851
516
|
Tebako runtime file name. The `ref` parameter allows to specify the name of the
|
852
517
|
runtime file.
|
853
518
|
+
|
854
|
-
NOTE: The
|
519
|
+
NOTE: The `--ref` option specifies the name of the runtime -- the runtime file
|
855
520
|
can be recreated or changed but not renamed.
|
856
521
|
|
857
|
-
|
522
|
+
`--tebafile=<path>`::
|
858
523
|
the tebako configuration file (optional, defaults to `$PWD/.tebako.yml`).
|
859
524
|
Please refer to the separate section below for description of the tebafile.
|
860
525
|
+
|
861
526
|
NOTE: Development mode is *not intended for production use* and should only be
|
862
527
|
used during development.
|
863
528
|
+
|
864
|
-
NOTE:
|
529
|
+
NOTE: `--entry-point` and `--project-root-folder` are required parameters and may be
|
865
530
|
provided either via command-line or in the tebafile.
|
866
531
|
|
867
532
|
[example]
|
@@ -877,21 +542,20 @@ tebako press \
|
|
877
542
|
|
878
543
|
==== Setup
|
879
544
|
|
880
|
-
|
545
|
+
Tebako requires post-install setup after gem installation .
|
546
|
+
Post-intall setup is called automatically during the first packaging.
|
547
|
+
There is no need run setup manually unless you need pristine Tebako
|
548
|
+
packaging environment to implement caching strategy.
|
549
|
+
We recommended to build cache based on `tebako setup` output. Building cache
|
550
|
+
based on `tebako press` may create inconsistent environment upon restore.
|
551
|
+
|
881
552
|
|
882
|
-
|
553
|
+
Setup collects required packages, builds the and creates packaging environment. This
|
883
554
|
is a lengthy task that can take significant time, up to 1 hour.
|
884
555
|
|
885
556
|
Tebako supports several configurations at a single system given that their root
|
886
557
|
directories differ and multiple Ruby versions within single configuration
|
887
558
|
|
888
|
-
This command is optional, tebako creates packaging environment automatically
|
889
|
-
upon the first invocation of press command.
|
890
|
-
|
891
|
-
However, if you plan to use tebako in CI/CD environment with caching it is
|
892
|
-
highly recommended to build cache based on `tebako setup` output. Building cache
|
893
|
-
based on `tebako press` may create inconsistent environment upon restore.
|
894
|
-
|
895
559
|
[source,sh]
|
896
560
|
----
|
897
561
|
$ tebako setup \
|
@@ -903,16 +567,18 @@ $ tebako setup \
|
|
903
567
|
|
904
568
|
Where:
|
905
569
|
|
906
|
-
|
570
|
+
`--prefix=<tebako-root-folder>`:: the Tebako root folder (see details: <<root-folder-selection>>)
|
907
571
|
|
908
|
-
|
909
|
-
|
572
|
+
`--Ruby=<ruby-version>`::
|
573
|
+
parameter defines package Ruby version (optional).
|
574
|
+
This version is used in conjunction with requirements from the `Gemfile` as
|
575
|
+
explained below in <<ruby-and-bundler-versions>>.
|
910
576
|
|
911
|
-
|
577
|
+
`--tebafile=<path>`::
|
912
578
|
the tebako configuration file (optional, defaults to `$PWD/.tebako.yml`).
|
913
579
|
Please refer to the separate section below for tebafile description.
|
914
580
|
|
915
|
-
|
581
|
+
`--devmode`:: flag activates development mode, in which Tebako's cache and packaging consistency checks are relaxed.
|
916
582
|
Please note that this mode is not intended for production use and should only be used during development.
|
917
583
|
|
918
584
|
==== Clean
|
@@ -931,9 +597,9 @@ $ tebako clean \
|
|
931
597
|
|
932
598
|
Where:
|
933
599
|
|
934
|
-
|
600
|
+
`--prefix=<tebako-root-folder>`:: the Tebako root folder (see details: <<root-folder-selection>>)
|
935
601
|
|
936
|
-
|
602
|
+
`--tebafile=<path>`::
|
937
603
|
the tebako configuration file (optional, defaults to `$PWD/.tebako.yml`).
|
938
604
|
Please refer to the separate section below for tebafile description.
|
939
605
|
|
@@ -945,7 +611,7 @@ tebako clean --prefix='~/.tebako'
|
|
945
611
|
----
|
946
612
|
====
|
947
613
|
|
948
|
-
|
614
|
+
<<clean_ruby>>
|
949
615
|
==== Clean Ruby
|
950
616
|
|
951
617
|
This command cleans up only the Ruby artifacts from the specified prefix
|
@@ -968,13 +634,14 @@ $ tebako clean_ruby
|
|
968
634
|
|
969
635
|
Where:
|
970
636
|
|
971
|
-
|
637
|
+
`--prefix=<tebako-root-folder>`::
|
972
638
|
the Tebako setup folder (optional, defaults to current folder)
|
973
639
|
|
974
|
-
|
975
|
-
|
640
|
+
`--Ruby=<ruby-version>`::
|
641
|
+
(optional, cleans all versions by default)
|
642
|
+
defines Ruby version that will be cleaned.
|
976
643
|
|
977
|
-
|
644
|
+
`--tebafile=<path>`::
|
978
645
|
the tebako configuration file (optional, defaults to `$PWD/.tebako.yml`).
|
979
646
|
Please refer to the separate section below for tebafile description.
|
980
647
|
|
@@ -986,6 +653,7 @@ tebako clean_ruby --prefix='~/.tebako'
|
|
986
653
|
----
|
987
654
|
====
|
988
655
|
|
656
|
+
<<hash>>
|
989
657
|
==== Build script hash
|
990
658
|
|
991
659
|
This command outputs a hash value for the Tebako build script, which can be used
|
@@ -996,6 +664,117 @@ as a cache key in CI/CD pipelines.
|
|
996
664
|
$ tebako hash
|
997
665
|
----
|
998
666
|
|
667
|
+
=== Using Docker
|
668
|
+
|
669
|
+
==== General
|
670
|
+
|
671
|
+
If you have Docker installed and available, the easiest way to run Tebako is
|
672
|
+
through the official Docker containers.
|
673
|
+
|
674
|
+
Docker containers with preinstalled Tebako packaging environments for Ubuntu and
|
675
|
+
Alpine Linux are available at
|
676
|
+
https://github.com/tamatebako/tebako-ci-containers[tebako-ci-containers].
|
677
|
+
|
678
|
+
|
679
|
+
==== Pull the container
|
680
|
+
|
681
|
+
Pull the Tebako container image.
|
682
|
+
|
683
|
+
[source,sh]
|
684
|
+
----
|
685
|
+
docker pull ghcr.io/tamatebako/tebako-<container_tag>:latest
|
686
|
+
----
|
687
|
+
|
688
|
+
`<container_tag>`:: is the desired image tag (e.g., `ubuntu-20.04` or `alpine-3.17`).
|
689
|
+
|
690
|
+
|
691
|
+
==== Running Tebako commands in the container
|
692
|
+
|
693
|
+
Simply prefix the Tebako command with `docker run` and the container image.
|
694
|
+
|
695
|
+
[source,sh]
|
696
|
+
----
|
697
|
+
docker run -v <application_folder>:/mnt/w \
|
698
|
+
-t ghcr.io/tamatebako/tebako-<container_tag>:latest \
|
699
|
+
tebako {command} {parameters}
|
700
|
+
----
|
701
|
+
|
702
|
+
==== Packaging from outside the container
|
703
|
+
|
704
|
+
To package your application from outside the container, just run a single Docker
|
705
|
+
command.
|
706
|
+
|
707
|
+
This command mounts the application folder into the container and runs the
|
708
|
+
`tebako press` command, specifying the application root, entry point, output
|
709
|
+
location, and Ruby version.
|
710
|
+
|
711
|
+
[source,sh]
|
712
|
+
----
|
713
|
+
docker run -v <application_folder>:/mnt/w \
|
714
|
+
-t ghcr.io/tamatebako/tebako-<container_tag>:latest \
|
715
|
+
tebako press <tebako-press-parameters>
|
716
|
+
----
|
717
|
+
|
718
|
+
`<application_folder>`:: is the path to your application folder.
|
719
|
+
|
720
|
+
`<container_tag>`:: is the desired image tag (e.g., `ubuntu-20.04` or `alpine-3.17`).
|
721
|
+
|
722
|
+
|
723
|
+
[example]
|
724
|
+
====
|
725
|
+
Assume that you have a Ruby application in the `fontist` folder of the current
|
726
|
+
directory.
|
727
|
+
|
728
|
+
You can package it to `./fontist-package` using the following command:
|
729
|
+
|
730
|
+
[source,sh]
|
731
|
+
----
|
732
|
+
docker run -v $PWD:/mnt/w \
|
733
|
+
-t ghcr.io/tamatebako/tebako-ubuntu-20.04:latest \
|
734
|
+
tebako press --root=/mnt/w/fontist --entry-point=fontist --output=/mnt/w/fontist-package --Ruby=3.2.4
|
735
|
+
----
|
736
|
+
====
|
737
|
+
|
738
|
+
==== Packaging from inside the container
|
739
|
+
|
740
|
+
It is also possible to package an application from inside the Tebako container.
|
741
|
+
|
742
|
+
Start and enter the container interactively.
|
743
|
+
|
744
|
+
[source,sh]
|
745
|
+
----
|
746
|
+
docker run -it --rm -v <application_folder>:/mnt/w \
|
747
|
+
ghcr.io/tamatebako/tebako-<container_tag>:latest bash
|
748
|
+
----
|
749
|
+
|
750
|
+
`<application_folder>`:: is the path to your application folder.
|
751
|
+
|
752
|
+
`<container_tag>`:: is the desired image tag (e.g., `ubuntu-20.04` or `alpine-3.17`).
|
753
|
+
|
754
|
+
|
755
|
+
Once inside, run the `tebako press` command:
|
756
|
+
|
757
|
+
[source,sh]
|
758
|
+
----
|
759
|
+
tebako press <tebako press parameters>
|
760
|
+
----
|
761
|
+
|
762
|
+
[example]
|
763
|
+
====
|
764
|
+
Assume that you have a Ruby application in the `fontist` folder of the current
|
765
|
+
directory.
|
766
|
+
|
767
|
+
You can package it to `./fontist-package` using the following command:
|
768
|
+
|
769
|
+
[source,sh]
|
770
|
+
----
|
771
|
+
$ docker run -it --rm -v $PWD:/mnt/w ghcr.io/tamatebako/tebako-<container_tag>:latest bash
|
772
|
+
|
773
|
+
# Inside the container:
|
774
|
+
$ tebako press --root=/mnt/w/fontist --entry-point=fontist --output=/mnt/w/fontist-package --Ruby=3.2.4
|
775
|
+
----
|
776
|
+
====
|
777
|
+
|
999
778
|
=== Tebako configuration file
|
1000
779
|
|
1001
780
|
It is possible to provide all or some options for the `tebako
|
@@ -1026,7 +805,20 @@ options:
|
|
1026
805
|
----
|
1027
806
|
====
|
1028
807
|
|
1029
|
-
|
808
|
+
[[root-folder-selection]]
|
809
|
+
=== Tebako root folder (aka prefix) selection
|
810
|
+
|
811
|
+
The Tebako prefix determines the base directory for the tebako packaging environment. It contain build artifacts for
|
812
|
+
Tebako run-time, libraries and other components and is an essential part of configuring how Tebako operates within your system.
|
813
|
+
|
814
|
+
The selection of the Tebako prefix follows a specific order of precedence to
|
815
|
+
ensure flexibility and ease of use as described in the next section.
|
816
|
+
|
817
|
+
Please do not use Tebako prefix under your application root (`--root` parameter). It is not an error
|
818
|
+
but it will cause Tebako to place all build-time artifacts to tebako package dramatically increasing its size.
|
819
|
+
You do not need it unless under very special circumstances like tebako packaging tebako itself.
|
820
|
+
|
821
|
+
=== Options preference order
|
1030
822
|
|
1031
823
|
Tebako supports several methods to set options. The table below show preference order and limitations for specific options.
|
1032
824
|
samller order means higher proirity.
|
@@ -1036,11 +828,11 @@ samller order means higher proirity.
|
|
1036
828
|
| Order | Mode | Option source | Applicability
|
1037
829
|
|
1038
830
|
| 1 | All | Command-line | All options
|
1039
|
-
| 2 | All |Tebako configuration file | All option except
|
1040
|
-
.2+| 3 .2+| All .2+| Environment variable | TEBAKO_PREFIX to set
|
1041
|
-
| LG_VADDR to set
|
1042
|
-
.2+| 4 |
|
1043
|
-
|
|
831
|
+
| 2 | All |Tebako configuration file | All option except `--tebafile` (you can not specify new tebafile in a tebafile)
|
832
|
+
.2+| 3 .2+| All .2+| Environment variable | TEBAKO_PREFIX to set `--prefix` option
|
833
|
+
| LG_VADDR to set `--with-lg-vaddr` jemalloc parameter
|
834
|
+
.2+| 4 | `runtime` | Tebako defaults | All options except `--entry-point` and `--root` that are mandatory
|
835
|
+
| `bundle`, `both`, `application` | Tebako defaults | All options
|
1044
836
|
|
1045
837
|
|===
|
1046
838
|
|
@@ -1075,6 +867,7 @@ operation. The following table lists the possible exit codes and their meanings.
|
|
1075
867
|
| 116 | Ruby version does not satify Gemfile requirements
|
1076
868
|
|===
|
1077
869
|
|
870
|
+
[[ruby-and-bundler-versions]]
|
1078
871
|
== Ruby and bundler versions selection
|
1079
872
|
|
1080
873
|
During packaging tebako creates its own Ruby execution environment that is independent from the host Ruby environment.
|
@@ -1191,88 +984,220 @@ Here is a summary of the scenarios:
|
|
1191
984
|
|
1192
985
|
These scenarios determine how the project is packaged and where the entry point is located within the packaged filesystem.
|
1193
986
|
|
1194
|
-
==
|
987
|
+
== Tebako runtime and application packages. Splitting and bundling.
|
1195
988
|
|
1196
989
|
=== General
|
1197
990
|
|
1198
|
-
|
991
|
+
Tebako provides a method either to create a single bundle package that contains Ruby run-time and the application or create separate
|
992
|
+
reusable runtime package and application package that can be deployed without a runtime.
|
993
|
+
|
994
|
+
=== Creating a bundle package
|
995
|
+
|
996
|
+
Tebako provides a method to create and manage a bundle package, which simplifies
|
997
|
+
the process of packaging dependencies along with the application.
|
998
|
+
|
999
|
+
[source,sh]
|
1000
|
+
----
|
1001
|
+
$ tebako bundle create -o <bundle-package> -r <project-root-folder> [-R <ruby-version>]
|
1002
|
+
----
|
1003
|
+
|
1004
|
+
To run the bundle package, use the following command:
|
1005
|
+
|
1006
|
+
[source,sh]
|
1007
|
+
----
|
1008
|
+
$ <bundle-package>
|
1009
|
+
----
|
1199
1010
|
|
1200
1011
|
[example]
|
1201
1012
|
====
|
1202
|
-
|
1013
|
+
[source,sh]
|
1014
|
+
----
|
1015
|
+
$ tebako bundle create -o myproject-bundle -r ~/projects/myproject -R 3.4.1
|
1016
|
+
# => creates `myproject-bundle`, a bundle package for Ruby 3.4.1
|
1017
|
+
$ myproject-bundle
|
1018
|
+
# => runs the bundle package
|
1019
|
+
----
|
1020
|
+
====
|
1021
|
+
|
1022
|
+
=== Creating separate runtime and application packages
|
1023
|
+
|
1024
|
+
Tebako allows creating separate runtime and application packages that can be used
|
1025
|
+
to run a Tebako application package.
|
1203
1026
|
|
1204
1027
|
[source,sh]
|
1205
1028
|
----
|
1206
|
-
tebako press \
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1029
|
+
$ tebako press -m both \
|
1030
|
+
-o <tebako-runtime-package> \
|
1031
|
+
-e <entry-point> \
|
1032
|
+
-r <project-root-folder> \
|
1033
|
+
[-R <ruby-version>]
|
1210
1034
|
----
|
1211
|
-
|
1035
|
+
|
1036
|
+
The resulting packages will be generated in the current directory as:
|
1037
|
+
|
1038
|
+
* Tebako runtime package at the `-o` location, i.e. `<tebako-runtime-package>`.
|
1039
|
+
* Tebako application package. The name of the application package will be the
|
1040
|
+
same as the runtime package with the `.package` extension.
|
1041
|
+
|
1042
|
+
|
1043
|
+
=== Creating a Tebako runtime package
|
1044
|
+
|
1045
|
+
Tebako allows creating a Tebako runtime package that can be used to run a Tebako
|
1046
|
+
application package.
|
1212
1047
|
|
1213
1048
|
[source,sh]
|
1214
1049
|
----
|
1215
|
-
|
1050
|
+
$ tebako press -m runtime -o <tebako-runtime-package> [-R <ruby-version>]
|
1216
1051
|
----
|
1217
1052
|
|
1218
|
-
|
1053
|
+
[example]
|
1054
|
+
====
|
1055
|
+
[source,sh]
|
1056
|
+
----
|
1057
|
+
$ tebako press -o tebako-ruby-3.4.1 -R 3.4.1
|
1058
|
+
# => creates `tebako-ruby-3.4.1`, a Tebako runtime package for Ruby 3.4.1
|
1059
|
+
----
|
1060
|
+
====
|
1061
|
+
|
1062
|
+
=== Creating a Tebako application package
|
1063
|
+
|
1064
|
+
Tebako allows creating a Tebako application package that can be run with a
|
1065
|
+
Tebako runtime package.
|
1219
1066
|
|
1220
1067
|
[source,sh]
|
1221
1068
|
----
|
1222
|
-
|
1069
|
+
$ tebako press -m application \
|
1070
|
+
-o <tebako-application-package> \
|
1071
|
+
-e <entry-point> \
|
1072
|
+
-r <project-root-folder> \
|
1073
|
+
[-R <ruby-version>]
|
1074
|
+
----
|
1075
|
+
|
1076
|
+
[example]
|
1077
|
+
====
|
1078
|
+
[source,sh]
|
1079
|
+
----
|
1080
|
+
$ tebako press -m application \
|
1081
|
+
-o tebako-application-package \
|
1082
|
+
-e start.rb \
|
1083
|
+
-r ~/projects/myproject \
|
1084
|
+
-R 3.4.1
|
1085
|
+
# => creates `tebako-application-package`, a Tebako application package for Ruby 3.4.1
|
1223
1086
|
----
|
1224
1087
|
====
|
1225
1088
|
|
1226
|
-
However there are several command-line parameters that are intercepted processed
|
1227
|
-
by Tebako bootstrap code as described below.
|
1228
1089
|
|
1229
|
-
=== Running
|
1090
|
+
=== Running Tebako application using a Tebako runtime (`--tebako-run` option)
|
1230
1091
|
|
1231
|
-
Tebako
|
1232
|
-
a local folder for verification or execution.
|
1092
|
+
The Tebako application package can be executed by a Tebako runtime package.
|
1233
1093
|
|
1234
1094
|
[source,sh]
|
1235
1095
|
----
|
1236
|
-
$ <tebako-runtime> --tebako-run [<tebako
|
1096
|
+
$ <tebako-runtime-package> --tebako-run [<tebako-application-package>]
|
1237
1097
|
----
|
1238
1098
|
|
1239
1099
|
Where,
|
1240
1100
|
|
1241
|
-
`<tebako
|
1242
|
-
The
|
1101
|
+
`<tebako-runtime-package>`::
|
1102
|
+
The Tebako runtime package file created using in `runtime` or `both` mode.
|
1243
1103
|
|
1244
|
-
`<tebako
|
1245
|
-
The
|
1104
|
+
`<tebako-application-package>`::
|
1105
|
+
The Tebako application package created in `application` or `both` mode.
|
1246
1106
|
|
1247
1107
|
[example]
|
1248
1108
|
====
|
1249
|
-
|
1109
|
+
Given a Ruby application at `hello.rb`:
|
1110
|
+
|
1111
|
+
[source,Ruby]
|
1112
|
+
----
|
1113
|
+
puts "Hello, #{ARGV[0]}!"
|
1114
|
+
----
|
1115
|
+
|
1116
|
+
Create separate runtime and application packages:
|
1250
1117
|
|
1251
1118
|
[source,sh]
|
1252
1119
|
----
|
1253
|
-
tebako press -m runtime -o tebako-runtime
|
1254
|
-
tebako press -m application -o tebako-application -e hello.rb -r test
|
1255
|
-
tabako-runtime --tebako-run tebako-application Maxim
|
1120
|
+
tebako press -m runtime -o tebako-runtime-package
|
1121
|
+
tebako press -m application -o tebako-application-package -e hello.rb -r test
|
1256
1122
|
----
|
1257
|
-
|
1258
|
-
|
1123
|
+
|
1124
|
+
Run the application using the pre-packaged runtime:
|
1125
|
+
|
1126
|
+
[source,sh]
|
1127
|
+
----
|
1128
|
+
tebako-runtime-package --tebako-run tebako-application-package Maxim
|
1259
1129
|
----
|
1260
|
-
# frozen_string_literal: true
|
1261
1130
|
|
1262
|
-
|
1131
|
+
The expected output is:
|
1132
|
+
|
1133
|
+
[source]
|
1134
|
+
----
|
1135
|
+
Hello, Maxim!
|
1136
|
+
----
|
1137
|
+
====
|
1138
|
+
|
1139
|
+
== Packaging Ruby Gems with Post-Installation Requirements
|
1140
|
+
|
1141
|
+
Unlike the traditional approach to Ruby program distribution, Tebako is designed with a clear separation between the build and
|
1142
|
+
target environments. We assume that a Tebako package created in the build environment should remain independent of it and run unchanged
|
1143
|
+
in the target environment.
|
1144
|
+
|
1145
|
+
While this approach is appealing, it imposes certain limitations on some Ruby gems, including Tebako itself. Specifically, gems that
|
1146
|
+
require a post-installation setup step often establish a strong dependency on the target environment. This setup might involve installing
|
1147
|
+
native libraries, linking to existing system components, or otherwise relying on the target system’s configuration.
|
1148
|
+
|
1149
|
+
To be packaged by Tebako, gems that require post-installation setup must meet two additional requirements:
|
1150
|
+
|
1151
|
+
1. *Ability to run post-installation setup from a read-only filesystem, outside the gem installation folder.*
|
1152
|
+
For example, Tebako uses the location specified by the `prefix` parameter to create any necessary files during post-installation.
|
1153
|
+
|
1154
|
+
2. *Automatic execution of the post-installation setup when required.*
|
1155
|
+
For instance, when the `tebako press` command is executed, it first checks whether `tebako setup` has been run and triggers it if necessary.
|
1156
|
+
|
1157
|
+
By adhering to these principles, gems that require post-installation setup will not only be compatible with Tebako but will also provide a more
|
1158
|
+
robust and consistent runtime experience, allowing them to run seamlessly across different environments.
|
1159
|
+
|
1160
|
+
|
1161
|
+
== Run-time options
|
1162
|
+
|
1163
|
+
=== General
|
1164
|
+
|
1165
|
+
Generally, Tebako packages pass command line options to the packaged application.
|
1166
|
+
|
1167
|
+
[example]
|
1168
|
+
====
|
1169
|
+
For example, if the package was created with the following command
|
1170
|
+
|
1171
|
+
[source,sh]
|
1172
|
+
----
|
1173
|
+
tebako press \
|
1174
|
+
--root='~/projects/myproject' \
|
1175
|
+
--entry=start.rb \
|
1176
|
+
--output=/temp/myproject.tebako
|
1263
1177
|
----
|
1264
|
-
|
1178
|
+
running
|
1179
|
+
|
1265
1180
|
[source,sh]
|
1266
1181
|
----
|
1267
|
-
|
1182
|
+
/temp/myproject.tebako --option --parameter value
|
1268
1183
|
----
|
1269
1184
|
|
1185
|
+
will be translated by Tebako bootstrap code to
|
1186
|
+
|
1187
|
+
[source,sh]
|
1188
|
+
----
|
1189
|
+
myproject --option --parameter value
|
1190
|
+
----
|
1270
1191
|
====
|
1271
1192
|
|
1193
|
+
However, there are several command-line parameters that are intercepted and processed
|
1194
|
+
by Tebako bootstrap code as described below.
|
1195
|
+
|
1196
|
+
|
1272
1197
|
=== Image extraction (`--tebako-extract` option)
|
1273
1198
|
|
1274
|
-
Tebako provides an option to
|
1275
|
-
a local folder for verification or
|
1199
|
+
Tebako provides an option to extract its DwarFS filesystem from a package to
|
1200
|
+
a local folder for verification or examination.
|
1276
1201
|
|
1277
1202
|
[source,sh]
|
1278
1203
|
----
|
@@ -1325,11 +1250,11 @@ change the paths for temporary files, caches, and sockets.
|
|
1325
1250
|
To address this inevitable limitation for Ruby applications,
|
1326
1251
|
Tebako provides an option to mount a host folder to the memfs tree.
|
1327
1252
|
|
1328
|
-
When using Tebako,
|
1329
|
-
|
1253
|
+
When using Tebako, be aware of how your application's directory structure is packaged,
|
1254
|
+
as this affects which paths may need mounting.
|
1330
1255
|
|
1331
|
-
|
1332
|
-
|
1256
|
+
You can use the `--tebako-extract` option described earlier to better understand
|
1257
|
+
your application's file structure before deciding which folders to mount.
|
1333
1258
|
|
1334
1259
|
[example]
|
1335
1260
|
====
|
@@ -1354,8 +1279,8 @@ The `--tebako-mount` option has the following syntax:
|
|
1354
1279
|
The `--tebako-mount` option can be repeated multiple times to mount more than
|
1355
1280
|
one object. The `memfs path` is relative to the memfs root, and it is
|
1356
1281
|
recommended to use absolute paths for host objects. Both directories and files
|
1357
|
-
can be mounted in this way. Tebako allows
|
1358
|
-
|
1282
|
+
can be mounted in this way. Tebako allows you to overlay host directories on existing memfs objects,
|
1283
|
+
providing a flexible solution for handling read-write requirements in packaged applications.
|
1359
1284
|
|
1360
1285
|
== Trivia: origin of name
|
1361
1286
|
|
@@ -1372,11 +1297,16 @@ Since "tamatebako" is rather long for the non-Japanese speaker, we use "tebako"
|
|
1372
1297
|
|
1373
1298
|
== Contributing
|
1374
1299
|
|
1375
|
-
We welcome contributions!
|
1376
|
-
|
1300
|
+
We welcome contributions!
|
1301
|
+
|
1302
|
+
Please see our link:CONTRIBUTING.adoc[contribution guidelines] and our
|
1303
|
+
link:CODE_OF_CONDUCT.adoc[code of conduct] for more information,.
|
1304
|
+
|
1305
|
+
NOTE: Our guidelines are aligned with the contribution guidelines from the RNP project.
|
1377
1306
|
|
1378
1307
|
== License
|
1379
1308
|
|
1380
1309
|
Copyright Ribose. All rights reserved.
|
1381
1310
|
|
1382
|
-
Tebako is released under the BSD 2-Clause License. See the
|
1311
|
+
Tebako is released under the BSD 2-Clause License. See the
|
1312
|
+
link:LICENSE.md[LICENSE.md] file for details.
|