rbe-tebako 0.15.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 +7 -0
- data/.clang-format +4 -0
- data/Brewfile +23 -0
- data/CMakeLists.txt +464 -0
- data/CODE_OF_CONDUCT.adoc +128 -0
- data/CONTRIBUTING.adoc +294 -0
- data/Gemfile +31 -0
- data/INSTALLATION.adoc +233 -0
- data/LICENSE.md +33 -0
- data/README.adoc +1363 -0
- data/Rakefile +35 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/cmake/copy_dir.cmake +29 -0
- data/common.env +5 -0
- data/exe/rbe-tebako +32 -0
- data/exe/rbe-tebako-packager +77 -0
- data/include/tebako/tebako-fs.h +43 -0
- data/include/tebako/tebako-main.h +42 -0
- data/include/tebako/tebako-prism.h +51 -0
- data/lib/rbe-tebako.rb +6 -0
- data/lib/tebako/build_helpers.rb +77 -0
- data/lib/tebako/cache_manager.rb +112 -0
- data/lib/tebako/cli.rb +220 -0
- data/lib/tebako/cli_helpers.rb +165 -0
- data/lib/tebako/codegen.rb +252 -0
- data/lib/tebako/deploy_helper.rb +258 -0
- data/lib/tebako/error.rb +70 -0
- data/lib/tebako/options_manager.rb +338 -0
- data/lib/tebako/package_descriptor.rb +143 -0
- data/lib/tebako/packager/pass1_patch.rb +266 -0
- data/lib/tebako/packager/pass1a_patch.rb +55 -0
- data/lib/tebako/packager/pass2_patch.rb +140 -0
- data/lib/tebako/packager/pass2_patch_crt.rb +46 -0
- data/lib/tebako/packager/pass2msys_patch.rb +190 -0
- data/lib/tebako/packager/patch.rb +54 -0
- data/lib/tebako/packager/patch_buildsystem.rb +124 -0
- data/lib/tebako/packager/patch_helpers.rb +109 -0
- data/lib/tebako/packager/patch_libraries.rb +188 -0
- data/lib/tebako/packager/patch_literals.rb +275 -0
- data/lib/tebako/packager/patch_main.rb +93 -0
- data/lib/tebako/packager/rubygems_patch.rb +83 -0
- data/lib/tebako/packager.rb +210 -0
- data/lib/tebako/packager_lite.rb +78 -0
- data/lib/tebako/ruby_builder.rb +71 -0
- data/lib/tebako/ruby_version.rb +206 -0
- data/lib/tebako/scenario_manager.rb +251 -0
- data/lib/tebako/stripper.rb +135 -0
- data/lib/tebako/version.rb +30 -0
- data/lib/tebako.rb +34 -0
- data/src/tebako-main.cpp +168 -0
- data/tools/.gitattributes +4 -0
- data/tools/.github/workflows/build-containers.yml +190 -0
- data/tools/.github/workflows/lint.yml +41 -0
- data/tools/.github/workflows/test.yml +331 -0
- data/tools/.gitignore +1 -0
- data/tools/README.md +49 -0
- data/tools/ci-scripts/arm-brew-install.sh +43 -0
- data/tools/ci-scripts/arm-brew-setup.sh +33 -0
- data/tools/ci-scripts/level-up.sh +35 -0
- data/tools/ci-scripts/patch-fbthrift.sh +94 -0
- data/tools/ci-scripts/patch-folly.sh +551 -0
- data/tools/ci-scripts/patch-glog.sh +57 -0
- data/tools/ci-scripts/patch-zstd.sh +57 -0
- data/tools/ci-scripts/tools.sh +63 -0
- data/tools/ci-scripts/x86-brew-install.sh +43 -0
- data/tools/ci-scripts/x86-brew-setup.sh +33 -0
- data/tools/cmake-scripts/def-external-project.cmake +96 -0
- data/tools/cmake-scripts/macos-environment.cmake +91 -0
- data/tools/cmake-scripts/msys-environment.cmake +78 -0
- data/tools/cmake-scripts/setup-libarchive.cmake +93 -0
- data/tools/cmake-scripts/setup-libfmt.cmake +61 -0
- data/tools/cmake-scripts/setup-libhowardhinnerdate.cmake +55 -0
- data/tools/cmake-scripts/setup-libutfcpp.cmake +56 -0
- data/tools/cmake-scripts/version.cmake +162 -0
- 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 +34 -0
- data/tools/include/pro-statvfs.h +57 -0
- data/tools/tests/cmake/CMakeLists.txt +81 -0
- data/tools/tests/setup-libfmt/CMakeLists.txt +35 -0
- data/tools/tests/setup-libhowardhinnerdate/CMakeLists.txt +35 -0
- data/tools/tests/setup-librachive/CMakeLists.txt +35 -0
- data/tools/tests/setup-libutfcpp/CMakeLists.txt +36 -0
- data/tools/tests/setup-openssl/CMakeLists.txt +36 -0
- metadata +312 -0
data/CONTRIBUTING.adoc
ADDED
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
= Contributing to Tebako
|
|
2
|
+
|
|
3
|
+
The following are a set of conventions and guidelines that are relevant to
|
|
4
|
+
contributors to the Tebako project. These guidelines are based on the
|
|
5
|
+
contribution guidelines from the RNP project, as both projects are developed by
|
|
6
|
+
Ribose.
|
|
7
|
+
|
|
8
|
+
== Pull requests
|
|
9
|
+
|
|
10
|
+
See also: https://github.com/thoughtbot/guides/tree/master/code-review[Thoughtbot's Code Review guide]
|
|
11
|
+
|
|
12
|
+
Pull Requests should be used for any non-trivial changes. This presents an
|
|
13
|
+
opportunity for feedback and allows the CI tests to complete prior to merging.
|
|
14
|
+
|
|
15
|
+
The `main` branch should generally always be in a buildable and functional state.
|
|
16
|
+
|
|
17
|
+
Pull Requests should be:
|
|
18
|
+
|
|
19
|
+
* Focused. Do not include changes that are unrelated to the main purpose of the PR.
|
|
20
|
+
|
|
21
|
+
* As small as possible. Sometimes large pull requests may be necessary for
|
|
22
|
+
adding complex features, but generally they should be kept as small as possible
|
|
23
|
+
to ensure a quick and thorough review process.
|
|
24
|
+
|
|
25
|
+
* Related to a GH issue to which you are assigned. If there is none, file one
|
|
26
|
+
(but search first!). This ensures there is no duplication of effort and allows
|
|
27
|
+
for a discussion prior to beginning work. (This may not be necessary for PRs
|
|
28
|
+
that are purely documentation updates)
|
|
29
|
+
|
|
30
|
+
* Approved by **2** reviewers before merging.
|
|
31
|
+
|
|
32
|
+
* Merged by a reviewer via the most appropriate method.
|
|
33
|
+
|
|
34
|
+
== Branches
|
|
35
|
+
|
|
36
|
+
Git branches should be used generously. Most branches should be topic branches,
|
|
37
|
+
created for adding a specific feature or fixing a specific bug.
|
|
38
|
+
|
|
39
|
+
Keep branches short-lived (treat them as disposable/transient) and try to avoid
|
|
40
|
+
long-running branches.
|
|
41
|
+
|
|
42
|
+
A good example of using a branch would be:
|
|
43
|
+
|
|
44
|
+
* User `@joe` notices a bug where a NULL pointer is dereferenced. `@joe` creates GH issue `#500`.
|
|
45
|
+
* He creates a new branch to fix this bug named `joe-500-fix-null-deref-in-function`.
|
|
46
|
+
* Joe commits a fix for the issue to this new branch.
|
|
47
|
+
* Joe creates a Pull Request to merge this branch into main.
|
|
48
|
+
* Once merged, Joe deletes the branch since it is no longer useful.
|
|
49
|
+
|
|
50
|
+
Branch names may vary but should be somewhat descriptive, with words separated
|
|
51
|
+
by hyphens. It is also helpful to start the branch name with your GitHub
|
|
52
|
+
username, to make it clear who created the branch and prevent naming conflicts.
|
|
53
|
+
|
|
54
|
+
Remember that branch names may be preserved permanently in the commit history of
|
|
55
|
+
`main`, depending on how they are merged.
|
|
56
|
+
|
|
57
|
+
== Commits
|
|
58
|
+
|
|
59
|
+
* Try to keep commits as small as possible. This may be difficult or impractical
|
|
60
|
+
at times, so use your best judgment.
|
|
61
|
+
|
|
62
|
+
* Each commit should be buildable and should pass all tests. This helps to
|
|
63
|
+
ensure that git bisect remains a useful method of pinpointing issues.
|
|
64
|
+
|
|
65
|
+
* Commit messages should follow 50/72 rule.
|
|
66
|
+
|
|
67
|
+
* When integrating pull requests, merge function should be preferred over
|
|
68
|
+
squashing. From the other hand, developers should squash commits and create
|
|
69
|
+
meaningful commit stack before PR is merged into mainstream branch. Merging
|
|
70
|
+
commits like "Fix build" or "Implement comments from code review" should be
|
|
71
|
+
avoided.
|
|
72
|
+
|
|
73
|
+
== Code conventions
|
|
74
|
+
|
|
75
|
+
The Tebako project includes both C/C++ and Ruby code. Each has its own set of conventions.
|
|
76
|
+
|
|
77
|
+
=== C/C++ code conventions
|
|
78
|
+
|
|
79
|
+
==== Code formatting
|
|
80
|
+
|
|
81
|
+
C/C++ code should be formatted using `clang-format` (v11.0.0), utilizing the
|
|
82
|
+
`.clang-format` file included in the repository.
|
|
83
|
+
|
|
84
|
+
==== Style guide for C/C++
|
|
85
|
+
|
|
86
|
+
In order to keep the code base consistent, we should define and adhere to a single style.
|
|
87
|
+
|
|
88
|
+
When in doubt, consult the existing code base.
|
|
89
|
+
|
|
90
|
+
===== Naming
|
|
91
|
+
|
|
92
|
+
The following are samples that demonstrate the style for naming different things in C/C++ code:
|
|
93
|
+
|
|
94
|
+
* Functions: `some_function`
|
|
95
|
+
* Variables: `some_variable`
|
|
96
|
+
* Filenames: `file-name.c` `file-name.h`
|
|
97
|
+
* Struct: `tebako_struct_t`
|
|
98
|
+
* Typedefed Enums: `tebako_enum_t`
|
|
99
|
+
* Enum Values: `TEBAKO_ENUM_VALUE = 1`
|
|
100
|
+
* Constants (macro): `TEBAKO_BUFSIZ`
|
|
101
|
+
|
|
102
|
+
===== General guidelines for C/C++
|
|
103
|
+
|
|
104
|
+
Do:
|
|
105
|
+
|
|
106
|
+
* Do use header guards (`#ifndef SOME_HEADER_H [...]`) in headers.
|
|
107
|
+
* Do use `sizeof(variable)`, rather than `sizeof(type)`. Or `sizeof(*variable)` as appropriate.
|
|
108
|
+
* Do use commit messages that close GitHub issues automatically, when
|
|
109
|
+
applicable. `Fix XYZ. Closes #78.` See
|
|
110
|
+
https://help.github.com/articles/closing-issues-via-commit-messages/[here].
|
|
111
|
+
* Do declare functions `static` when they do not need to be referenced outside the current source file.
|
|
112
|
+
* Do always use braces for conditionals, even if the block only contains a single statement.
|
|
113
|
+
+
|
|
114
|
+
[source,c]
|
|
115
|
+
--
|
|
116
|
+
if (something) {
|
|
117
|
+
return val;
|
|
118
|
+
}
|
|
119
|
+
--
|
|
120
|
+
|
|
121
|
+
* Do use a default failure (not success) value for `ret` variables. Example:
|
|
122
|
+
+
|
|
123
|
+
[source,c]
|
|
124
|
+
--
|
|
125
|
+
rnp_result_t ret = RNP_ERROR_GENERIC;
|
|
126
|
+
// ...
|
|
127
|
+
|
|
128
|
+
return ret;
|
|
129
|
+
--
|
|
130
|
+
|
|
131
|
+
Do not:
|
|
132
|
+
|
|
133
|
+
* Do not use the static storage class for local variables, *unless* they are constant.
|
|
134
|
+
+
|
|
135
|
+
**Not OK**
|
|
136
|
+
+
|
|
137
|
+
[source,c]
|
|
138
|
+
--
|
|
139
|
+
int somefunc() {
|
|
140
|
+
static char buffer[256];
|
|
141
|
+
//...
|
|
142
|
+
}
|
|
143
|
+
--
|
|
144
|
+
+
|
|
145
|
+
**OK**
|
|
146
|
+
+
|
|
147
|
+
[source,c]
|
|
148
|
+
--
|
|
149
|
+
int somefunc() {
|
|
150
|
+
static const uint16_t some_data[] = {
|
|
151
|
+
0x00, 0x01, 0x02, //...
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
--
|
|
155
|
+
|
|
156
|
+
* Do not use `pragma`, and try to avoid `__attribute__` as well.
|
|
157
|
+
* Do not use uninitialized memory. Try to ensure your code will not cause any errors in valgrind and other memory checkers.
|
|
158
|
+
|
|
159
|
+
==== Documentation for C/C++
|
|
160
|
+
|
|
161
|
+
Documentation is done in Doxygen comments format, which must be put in header files.
|
|
162
|
+
|
|
163
|
+
Exceptions are static or having only definition functions -- it is not required to
|
|
164
|
+
document them, however if they are documented then this should be done in the
|
|
165
|
+
source file and using the @private tag.
|
|
166
|
+
|
|
167
|
+
Comments should use doxygen markdown style, like the following example:
|
|
168
|
+
|
|
169
|
+
[source,c]
|
|
170
|
+
--
|
|
171
|
+
/** Some comments regarding the file purpose, like 'Tebako filesystem utilities'
|
|
172
|
+
* @file
|
|
173
|
+
*
|
|
174
|
+
* This file contains functions and definitions related to the Tebako filesystem.
|
|
175
|
+
* Ensure to document all public interfaces thoroughly.
|
|
176
|
+
*/
|
|
177
|
+
|
|
178
|
+
/** brief description of the sample function which does something, keyword 'brief' is omitted
|
|
179
|
+
* Which may be continued here
|
|
180
|
+
*
|
|
181
|
+
* After an empty line you may add detailed description in case it is needed. You may put
|
|
182
|
+
* details about the memory allocation, what happens if function fails and so on.
|
|
183
|
+
*
|
|
184
|
+
* @param param1 first parameter, null-terminated string which should not be NULL
|
|
185
|
+
* @param param2 integer, some number representing something
|
|
186
|
+
* @param size number of bytes available to store in buffer
|
|
187
|
+
* @param buffer buffer to store results, may be NULL. In this case size can be used to
|
|
188
|
+
* obtain the required buffer length
|
|
189
|
+
* @return 0 if operation succeeds, or error code otherwise. If operation succeeds then buffer
|
|
190
|
+
* is populated with the resulting data, and size contains the length of this data.
|
|
191
|
+
* if error code is E_BUF_TOOSMALL then size will contain the required size to store
|
|
192
|
+
* the result
|
|
193
|
+
**/
|
|
194
|
+
rnp_result_t
|
|
195
|
+
tebako_do_operation(const char *param1, const int param2, int *size, char *buffer);
|
|
196
|
+
--
|
|
197
|
+
|
|
198
|
+
=== Ruby code conventions
|
|
199
|
+
|
|
200
|
+
==== Code formatting
|
|
201
|
+
|
|
202
|
+
Ruby code should follow the style defined in the `.rubocop.yml` file included in
|
|
203
|
+
the repository. We adhere to the Ruby community's conventions with some
|
|
204
|
+
project-specific modifications defined in this file.
|
|
205
|
+
|
|
206
|
+
==== Style guide for Ruby
|
|
207
|
+
|
|
208
|
+
Ruby code should generally follow the Ruby Style Guide (https://rubystyle.guide/), with customizations specific to the Tebako project.
|
|
209
|
+
|
|
210
|
+
===== Naming
|
|
211
|
+
|
|
212
|
+
* Classes and Modules: `CamelCase`
|
|
213
|
+
* Methods and Variables: `snake_case`
|
|
214
|
+
* Constants: `SCREAMING_SNAKE_CASE`
|
|
215
|
+
* Predicate methods (returning boolean): end with question mark `available?`
|
|
216
|
+
* Dangerous methods (modifying `self` or arguments): end with exclamation mark `save!`
|
|
217
|
+
* Private methods: `_leading_underscore` (or just use the `private` keyword)
|
|
218
|
+
|
|
219
|
+
===== General guidelines for Ruby
|
|
220
|
+
|
|
221
|
+
* Use 2 spaces for indentation, never tabs
|
|
222
|
+
* Limit lines to 100 characters when possible
|
|
223
|
+
* Use `def` with parentheses when there are parameters
|
|
224
|
+
* Use parentheses for method calls with arguments
|
|
225
|
+
* Never use `and`/`or` for control flow; use `&&`/`||` instead
|
|
226
|
+
* Avoid multi-line ternary operators
|
|
227
|
+
* Use `snake_case` for naming files and directories
|
|
228
|
+
* Prefer string interpolation and template strings to string concatenation
|
|
229
|
+
* Prefer double quotes for strings unless the string contains double quotes
|
|
230
|
+
|
|
231
|
+
==== Documentation for Ruby
|
|
232
|
+
|
|
233
|
+
Ruby code should be documented using YARD.
|
|
234
|
+
|
|
235
|
+
[source,ruby]
|
|
236
|
+
--
|
|
237
|
+
# A person class to represent individuals
|
|
238
|
+
class Person
|
|
239
|
+
# @return [String] the person's full name
|
|
240
|
+
attr_reader :name
|
|
241
|
+
|
|
242
|
+
# Creates a new person
|
|
243
|
+
#
|
|
244
|
+
# @param name [String] the person's full name
|
|
245
|
+
# @param age [Integer] the person's age in years
|
|
246
|
+
# @return [Person] a new instance of Person
|
|
247
|
+
def initialize(name, age)
|
|
248
|
+
@name = name
|
|
249
|
+
@age = age
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
# Determines if the person is an adult
|
|
253
|
+
#
|
|
254
|
+
# @return [Boolean] true if the person is 18 or older
|
|
255
|
+
def adult?
|
|
256
|
+
@age >= 18
|
|
257
|
+
end
|
|
258
|
+
end
|
|
259
|
+
--
|
|
260
|
+
|
|
261
|
+
=== Testing
|
|
262
|
+
|
|
263
|
+
==== C/C++ testing
|
|
264
|
+
:cpp: C++
|
|
265
|
+
C/{cpp} code should have appropriate tests. Tests for C/{cpp} code should be:
|
|
266
|
+
|
|
267
|
+
* Comprehensive, covering normal operation and error conditions
|
|
268
|
+
* Written to validate both public API and internal functionality
|
|
269
|
+
* Organized in logical test suites
|
|
270
|
+
|
|
271
|
+
==== Ruby testing
|
|
272
|
+
|
|
273
|
+
Ruby code should have RSpec tests. Tests for Ruby code should:
|
|
274
|
+
|
|
275
|
+
* Follow the RSpec style guide
|
|
276
|
+
* Use descriptive contexts and examples
|
|
277
|
+
* Use appropriate RSpec matchers
|
|
278
|
+
* Mock external dependencies when appropriate
|
|
279
|
+
* Achieve high test coverage (as reported by the coverage tool)
|
|
280
|
+
|
|
281
|
+
== Code of conduct
|
|
282
|
+
|
|
283
|
+
The Tebako project has adopted the Contributor Covenant as its Code of Conduct.
|
|
284
|
+
All contributors are expected to adhere to these guidelines to foster an open
|
|
285
|
+
and welcoming community.
|
|
286
|
+
|
|
287
|
+
For the full Code of Conduct, please refer to link:CODE_OF_CONDUCT.adoc[CODE_OF_CONDUCT.adoc].
|
|
288
|
+
|
|
289
|
+
== References
|
|
290
|
+
|
|
291
|
+
For more detailed guidelines, please refer to the RNP project's development guidelines:
|
|
292
|
+
|
|
293
|
+
* RNP Code of Conduct: https://github.com/rnpgp/rnp/blob/main/docs/code-of-conduct.adoc
|
|
294
|
+
* RNP Development Guide: https://github.com/rnpgp/rnp/blob/main/docs/develop.adoc
|
data/Gemfile
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright (c) 2023-2025 [Ribose Inc](https://www.ribose.com).
|
|
4
|
+
# All rights reserved.
|
|
5
|
+
# This file is a part of the Tebako project.
|
|
6
|
+
#
|
|
7
|
+
# Redistribution and use in source and binary forms, with or without
|
|
8
|
+
# modification, are permitted provided that the following conditions
|
|
9
|
+
# are met:
|
|
10
|
+
# 1. Redistributions of source code must retain the above copyright
|
|
11
|
+
# notice, this list of conditions and the following disclaimer.
|
|
12
|
+
# 2. Redistributions in binary form must reproduce the above copyright
|
|
13
|
+
# notice, this list of conditions and the following disclaimer in the
|
|
14
|
+
# documentation and/or other materials provided with the distribution.
|
|
15
|
+
#
|
|
16
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
17
|
+
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
18
|
+
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
19
|
+
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
|
|
20
|
+
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
21
|
+
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
22
|
+
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
23
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
24
|
+
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
25
|
+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
26
|
+
# POSSIBILITY OF SUCH DAMAGE.
|
|
27
|
+
|
|
28
|
+
source "https://rubygems.org"
|
|
29
|
+
|
|
30
|
+
# Specify your gem's dependencies in rbe-tebako.gemspec
|
|
31
|
+
gemspec
|
data/INSTALLATION.adoc
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
= Tebako: Local Installation
|
|
2
|
+
|
|
3
|
+
== General
|
|
4
|
+
|
|
5
|
+
This document describes how to install Tebako locally on your machine.
|
|
6
|
+
It covers installation on the following platforms:
|
|
7
|
+
|
|
8
|
+
. Ubuntu (version 20.04)
|
|
9
|
+
. Alpine (version 3.17)
|
|
10
|
+
. macOS
|
|
11
|
+
. Windows
|
|
12
|
+
|
|
13
|
+
== Prerequisites
|
|
14
|
+
|
|
15
|
+
=== Ubuntu 20.04
|
|
16
|
+
|
|
17
|
+
==== GNU C/C++ 10+ or Clang C/C++ 12+
|
|
18
|
+
|
|
19
|
+
[source,sh]
|
|
20
|
+
----
|
|
21
|
+
apt install -y gcc-10 g++-10
|
|
22
|
+
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
|
|
23
|
+
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
|
|
24
|
+
----
|
|
25
|
+
|
|
26
|
+
or
|
|
27
|
+
|
|
28
|
+
[source,sh]
|
|
29
|
+
----
|
|
30
|
+
apt install -y clang-12
|
|
31
|
+
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-12 150
|
|
32
|
+
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-12 150
|
|
33
|
+
----
|
|
34
|
+
|
|
35
|
+
==== CMake version 3.20+
|
|
36
|
+
|
|
37
|
+
Tebako requires CMake version 3.20 or later.
|
|
38
|
+
|
|
39
|
+
If such a CMake version is not available as a default package, set it up as follows.
|
|
40
|
+
|
|
41
|
+
.Installing CMake 3.20+
|
|
42
|
+
[source,sh]
|
|
43
|
+
----
|
|
44
|
+
apt-get remove --purge --auto-remove cmake
|
|
45
|
+
apt-get update
|
|
46
|
+
apt-get install -y software-properties-common lsb-release curl
|
|
47
|
+
apt-get clean all
|
|
48
|
+
curl https://apt.kitware.com/kitware-archive.sh | bash
|
|
49
|
+
apt-get install cmake
|
|
50
|
+
----
|
|
51
|
+
|
|
52
|
+
==== Other Development Tools and Libraries
|
|
53
|
+
|
|
54
|
+
[source,sh]
|
|
55
|
+
----
|
|
56
|
+
apt-get -y install sudo git curl build-essential pkg-config bison flex autoconf \
|
|
57
|
+
binutils-dev libevent-dev acl-dev libfmt-dev libjemalloc-dev libiberty-dev \
|
|
58
|
+
libdouble-conversion-dev liblz4-dev liblzma-dev libssl-dev libunwind-dev \
|
|
59
|
+
libboost-filesystem-dev libboost-program-options-dev libboost-system-dev \
|
|
60
|
+
libboost-iostreams-dev libboost-date-time-dev libboost-context-dev \
|
|
61
|
+
libboost-regex-dev libboost-thread-dev libbrotli-dev libdwarf-dev libelf-dev \
|
|
62
|
+
libgoogle-glog-dev libffi-dev libgdbm-dev libyaml-dev libncurses-dev \
|
|
63
|
+
libreadline-dev libutfcpp-dev ruby-dev ruby-bundler
|
|
64
|
+
----
|
|
65
|
+
|
|
66
|
+
=== Alpine 3.17
|
|
67
|
+
|
|
68
|
+
==== APK Packages
|
|
69
|
+
|
|
70
|
+
Run the following command to install all prerequisites.
|
|
71
|
+
|
|
72
|
+
[source,sh]
|
|
73
|
+
----
|
|
74
|
+
apk --no-cache --upgrade add build-base cmake git bash autoconf boost-static \
|
|
75
|
+
boost-dev flex-dev bison make binutils-dev libevent-dev acl-dev sed python3 \
|
|
76
|
+
pkgconfig lz4-dev openssl-dev zlib-dev xz ninja zip unzip curl libdwarf-dev \
|
|
77
|
+
libunwind-dev gflags-dev elfutils-dev libevent-static openssl-libs-static \
|
|
78
|
+
lz4-static xz-dev zlib-static libunwind-static acl-static tar libffi-dev \
|
|
79
|
+
gdbm-dev yaml-dev yaml-static ncurses-dev ncurses-static readline-dev \
|
|
80
|
+
readline-static p7zip ruby-dev gcompat gettext-dev gperf brotli-dev \
|
|
81
|
+
brotli-static jemalloc-dev fmt-dev xz-static
|
|
82
|
+
----
|
|
83
|
+
|
|
84
|
+
=== macOS
|
|
85
|
+
|
|
86
|
+
==== General
|
|
87
|
+
|
|
88
|
+
There are several prerequisites that need to be installed on macOS for Tebako
|
|
89
|
+
to work correctly.
|
|
90
|
+
|
|
91
|
+
The following instructions apply to:
|
|
92
|
+
|
|
93
|
+
* macOS 13 (Ventura) through macOS 15 (Sequoia)
|
|
94
|
+
|
|
95
|
+
==== Homebrew Packages
|
|
96
|
+
|
|
97
|
+
We use Homebrew to install the necessary packages on macOS.
|
|
98
|
+
|
|
99
|
+
Tebako provides a `Brewfile` at the repository root, allowing you to install
|
|
100
|
+
all dependencies using the `brew bundle` command.
|
|
101
|
+
|
|
102
|
+
[source,sh]
|
|
103
|
+
----
|
|
104
|
+
brew bundle
|
|
105
|
+
----
|
|
106
|
+
|
|
107
|
+
Alternatively, you can install the packages manually.
|
|
108
|
+
|
|
109
|
+
[source,sh]
|
|
110
|
+
----
|
|
111
|
+
brew update
|
|
112
|
+
brew install gnu-sed bash pkg-config bison flex binutils libffi gdbm zlib \
|
|
113
|
+
ncurses double-conversion boost jemalloc fmt glog libevent libsodium lz4 xz \
|
|
114
|
+
libyaml openssl@3
|
|
115
|
+
----
|
|
116
|
+
|
|
117
|
+
==== Bison 3+
|
|
118
|
+
|
|
119
|
+
Tebako requires Bison 3 or later.
|
|
120
|
+
|
|
121
|
+
On macOS 14, the default Bison version is 2.3, and the Homebrew formula is keg-only,
|
|
122
|
+
meaning the full path to the Bison binary must be used.
|
|
123
|
+
|
|
124
|
+
Run the following command prior to using Tebako, or add it to your shell profile.
|
|
125
|
+
|
|
126
|
+
[source,sh]
|
|
127
|
+
----
|
|
128
|
+
export PATH="$(brew --prefix bison)/bin:$PATH"
|
|
129
|
+
----
|
|
130
|
+
|
|
131
|
+
==== jemalloc Library Build
|
|
132
|
+
|
|
133
|
+
On macOS, the `libdwarfs` build script creates an additional `jemalloc` installation
|
|
134
|
+
to satisfy linking requirements. However, this uses a static library.
|
|
135
|
+
|
|
136
|
+
If `jemalloc` is built within an emulated environment (QEMU, Rosetta, etc.), there are known issues
|
|
137
|
+
(link:https://github.com/jemalloc/jemalloc/issues/1997[jemalloc issue #1997])
|
|
138
|
+
where `jemalloc` incorrectly detects the number of significant virtual address bits (`lg-vaddr`).
|
|
139
|
+
|
|
140
|
+
These issues can be fixed by explicitly setting the `--with-lg-vaddr` parameter during the `jemalloc`
|
|
141
|
+
build. However, Tebako does not automate this due to lack of sufficient test coverage.
|
|
142
|
+
|
|
143
|
+
Instead, our build script accepts the `LG_VADDR` environment variable, which is passed as `--with-lg-vaddr=${LG_VADDR}`.
|
|
144
|
+
|
|
145
|
+
The `LG_VADDR` parameter specifies the number of significant virtual address bits, which can
|
|
146
|
+
vary based on CPU architecture and emulation status.
|
|
147
|
+
|
|
148
|
+
This is a simple example script to set `LG_VADDR`.
|
|
149
|
+
|
|
150
|
+
NOTE: This is provided for illustration only.
|
|
151
|
+
|
|
152
|
+
[example]
|
|
153
|
+
====
|
|
154
|
+
[source,sh]
|
|
155
|
+
----
|
|
156
|
+
#!/bin/bash
|
|
157
|
+
|
|
158
|
+
# Check the CPU architecture
|
|
159
|
+
ARCH=$(uname -m)
|
|
160
|
+
|
|
161
|
+
# Check if running under Rosetta 2 emulation
|
|
162
|
+
if [[ "$ARCH" == "x86_64" && $(sysctl -n sysctl.proc_translated) == "1" ]]; then
|
|
163
|
+
echo "Running on Apple Silicon under Rosetta 2 emulation"
|
|
164
|
+
export LG_VADDR=39
|
|
165
|
+
elif [[ "$ARCH" == "arm64" ]]; then
|
|
166
|
+
echo "Running on Apple Silicon"
|
|
167
|
+
export LG_VADDR=39
|
|
168
|
+
else
|
|
169
|
+
echo "Running on Intel Silicon"
|
|
170
|
+
export LG_VADDR=48
|
|
171
|
+
fi
|
|
172
|
+
|
|
173
|
+
echo "Setting lg-vaddr to $LG_VADDR"
|
|
174
|
+
----
|
|
175
|
+
====
|
|
176
|
+
|
|
177
|
+
=== Windows
|
|
178
|
+
|
|
179
|
+
==== General
|
|
180
|
+
|
|
181
|
+
The following instructions have been tested on:
|
|
182
|
+
|
|
183
|
+
* Windows 10, 11
|
|
184
|
+
* Windows Server 2019, 2022
|
|
185
|
+
|
|
186
|
+
==== Ruby
|
|
187
|
+
|
|
188
|
+
Ensure that you have long filenames enabled in Windows.
|
|
189
|
+
https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry#enable-long-paths-in-windows-10-version-1607-and-later[long filenames enabled in Windows]. This is required for the majority of applications.
|
|
190
|
+
|
|
191
|
+
To run Tebako, a Ruby development environment is required.
|
|
192
|
+
The simplest option is to use the Ruby development environment provided by
|
|
193
|
+
https://rubyinstaller.org[RubyInstaller].
|
|
194
|
+
|
|
195
|
+
For example, Ruby+Devkit 3.4.10-1.
|
|
196
|
+
|
|
197
|
+
==== MinGW ucrt64
|
|
198
|
+
|
|
199
|
+
Enable MinGW ucrt64 and install the necessary packages.
|
|
200
|
+
|
|
201
|
+
The `ridk` command originates from the RubyInstaller installation.
|
|
202
|
+
|
|
203
|
+
[source,sh]
|
|
204
|
+
----
|
|
205
|
+
idk enable ucrt64
|
|
206
|
+
pacman -S git tar bison flex pactoys
|
|
207
|
+
bash -c "pacboy sync toolchain:p make:p cmake:p boost:p diffutils:p libevent:p double-conversion:p fmt:p glog:p dlfcn:p gtest:p autotools:p ncurses:p libyaml:p"
|
|
208
|
+
----
|
|
209
|
+
|
|
210
|
+
== Gem Installation
|
|
211
|
+
|
|
212
|
+
Tebako is distributed as a Ruby gem. A Ruby environment is necessary.
|
|
213
|
+
|
|
214
|
+
[source,sh]
|
|
215
|
+
----
|
|
216
|
+
gem install tebako
|
|
217
|
+
----
|
|
218
|
+
|
|
219
|
+
== Post-Install Setup (Not Generally Required)
|
|
220
|
+
|
|
221
|
+
Tebako requires a post-install setup after gem installation, as described in
|
|
222
|
+
link:README.adoc[README.adoc].
|
|
223
|
+
|
|
224
|
+
Post-install setup is called automatically during the first packaging.
|
|
225
|
+
Manual setup is only required if a pristine Tebako packaging environment is needed
|
|
226
|
+
to implement a caching strategy.
|
|
227
|
+
|
|
228
|
+
== License
|
|
229
|
+
|
|
230
|
+
Copyright Ribose. All rights reserved.
|
|
231
|
+
|
|
232
|
+
Tebako is released under the BSD 2-Clause License. See the
|
|
233
|
+
link:LICENSE.md[LICENSE.md] file for details.
|
data/LICENSE.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Licenses & Copyright
|
|
2
|
+
====================
|
|
3
|
+
|
|
4
|
+
This license file adheres to the formatting guidelines of
|
|
5
|
+
[readable-licenses](https://github.com/nevir/readable-licenses).
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Ribose's BSD 2-Clause License
|
|
9
|
+
-----------------------------
|
|
10
|
+
|
|
11
|
+
Copyright (c) 2021-2025, [Ribose Inc](https://www.ribose.com).
|
|
12
|
+
All rights reserved.
|
|
13
|
+
|
|
14
|
+
Redistribution and use in source and binary forms, with or without modification,
|
|
15
|
+
are permitted provided that the following conditions are met:
|
|
16
|
+
|
|
17
|
+
1. Redistributions of source code must retain the above copyright notice,
|
|
18
|
+
this list of conditions and the following disclaimer.
|
|
19
|
+
|
|
20
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
21
|
+
this list of conditions and the following disclaimer in the documentation
|
|
22
|
+
and/or other materials provided with the distribution.
|
|
23
|
+
|
|
24
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
25
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
26
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
27
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
|
28
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
29
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
30
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
31
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
32
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
33
|
+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|