tebako 0.12.16 → 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 +2 -2
- 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 +291 -486
- 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 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- data/lib/tebako/packager_lite.rb +1 -1
- data/lib/tebako/ruby_builder.rb +1 -1
- data/lib/tebako/ruby_version.rb +3 -2
- data/lib/tebako/scenario_manager.rb +1 -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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b76afc326826bf28f1e102114a95d5be16e3fb3ec8755830ad719c0c17da0244
|
4
|
+
data.tar.gz: fae51d705eedb1735426ca175ce89ccad509aaaf9fcb4436d5cef19d7ff7ac38
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef50f9c470ce36732df94ec543feae0ec9ec27c8baa7f62043937ab8bef5cf07466ee613336d987d304b47e10cbbac5f4404f9b85a17f294e21002c3cb8fec13
|
7
|
+
data.tar.gz: 57390b1c83cbfad6d65b37a80f6d64cb5897c794113134284e1bf6a44efadbf746892cc2c980e17bafb12ccb508e3e45b799e5624f30555cc942349a38585c79
|
data/CMakeLists.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Copyright (c) 2021-2025 [Ribose Inc](https://www.ribose.com).
|
2
2
|
# All rights reserved.
|
3
|
-
# This file is a part of
|
3
|
+
# This file is a part of the Tebako project.
|
4
4
|
#
|
5
5
|
# Redistribution and use in source and binary forms, with or without
|
6
6
|
# modification, are permitted provided that the following conditions
|
@@ -178,7 +178,7 @@ string(CONCAT RUBY_API_VER ${RUBY_VER_BASE} ".0")
|
|
178
178
|
# list(GET LIBDWARFS_WR_VER_COMPONENTS 2 LIBDWARFS_WR_VER_PATCH)
|
179
179
|
# set (LIBDWARFS_WR_VER_M ${LIBDWARFS_WR_VER_MAJOR}.${LIBDWARFS_WR_VER_MINOR}.${LIBDWARFS_WR_VER_PATCH})
|
180
180
|
#else(DWARFS_PRELOAD)
|
181
|
-
def_ext_prj_g(DWARFS_WR "v0.
|
181
|
+
def_ext_prj_g(DWARFS_WR "v0.10.1")
|
182
182
|
#endif(DWARFS_PRELOAD)
|
183
183
|
|
184
184
|
def_ext_prj_g(PATCHELF "65e14792061c298f1d2bc44becd48a10cbf0bc81")
|
@@ -0,0 +1,128 @@
|
|
1
|
+
|
2
|
+
= Contributor covenant code of conduct
|
3
|
+
|
4
|
+
== Our pledge
|
5
|
+
|
6
|
+
We as members, contributors, and leaders pledge to make participation in our
|
7
|
+
community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
9
|
+
identity and expression, level of experience, education, socio-economic status,
|
10
|
+
nationality, personal appearance, race, religion, or sexual identity
|
11
|
+
and orientation.
|
12
|
+
|
13
|
+
We pledge to act and interact in ways that contribute to an open, welcoming,
|
14
|
+
diverse, inclusive, and healthy community.
|
15
|
+
|
16
|
+
== Our standards
|
17
|
+
|
18
|
+
Examples of behavior that contributes to a positive environment for our
|
19
|
+
community include:
|
20
|
+
|
21
|
+
* Demonstrating empathy and kindness toward other people
|
22
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
23
|
+
* Giving and gracefully accepting constructive feedback
|
24
|
+
* Accepting responsibility and apologizing to those affected by our mistakes,
|
25
|
+
and learning from the experience
|
26
|
+
* Focusing on what is best not just for us as individuals, but for the
|
27
|
+
overall community
|
28
|
+
|
29
|
+
Examples of unacceptable behavior include:
|
30
|
+
|
31
|
+
* The use of sexualized language or imagery, and sexual attention or
|
32
|
+
advances of any kind
|
33
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
34
|
+
* Public or private harassment
|
35
|
+
* Publishing others' private information, such as a physical or email
|
36
|
+
address, without their explicit permission
|
37
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
38
|
+
professional setting
|
39
|
+
|
40
|
+
== Enforcement responsibilities
|
41
|
+
|
42
|
+
Community leaders are responsible for clarifying and enforcing our standards of
|
43
|
+
acceptable behavior and will take appropriate and fair corrective action in
|
44
|
+
response to any behavior that they deem inappropriate, threatening, offensive,
|
45
|
+
or harmful.
|
46
|
+
|
47
|
+
Community leaders have the right and responsibility to remove, edit, or reject
|
48
|
+
comments, commits, code, wiki edits, issues, and other contributions that are
|
49
|
+
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
50
|
+
decisions when appropriate.
|
51
|
+
|
52
|
+
== Scope
|
53
|
+
|
54
|
+
This Code of Conduct applies within all community spaces, and also applies when
|
55
|
+
an individual is officially representing the community in public spaces.
|
56
|
+
Examples of representing our community include using an official e-mail address,
|
57
|
+
posting via an official social media account, or acting as an appointed
|
58
|
+
representative at an online or offline event.
|
59
|
+
|
60
|
+
== Enforcement
|
61
|
+
|
62
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
63
|
+
reported to the community leaders responsible for enforcement at
|
64
|
+
open.source@ribose.com.
|
65
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
66
|
+
|
67
|
+
All community leaders are obligated to respect the privacy and security of the
|
68
|
+
reporter of any incident.
|
69
|
+
|
70
|
+
== Enforcement guidelines
|
71
|
+
|
72
|
+
Community leaders will follow these Community Impact Guidelines in determining
|
73
|
+
the consequences for any action they deem in violation of this Code of Conduct:
|
74
|
+
|
75
|
+
=== 1. Correction
|
76
|
+
|
77
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed
|
78
|
+
unprofessional or unwelcome in the community.
|
79
|
+
|
80
|
+
**Consequence**: A private, written warning from community leaders, providing
|
81
|
+
clarity around the nature of the violation and an explanation of why the
|
82
|
+
behavior was inappropriate. A public apology may be requested.
|
83
|
+
|
84
|
+
=== 2. Warning
|
85
|
+
|
86
|
+
**Community Impact**: A violation through a single incident or series
|
87
|
+
of actions.
|
88
|
+
|
89
|
+
**Consequence**: A warning with consequences for continued behavior. No
|
90
|
+
interaction with the people involved, including unsolicited interaction with
|
91
|
+
those enforcing the Code of Conduct, for a specified period of time. This
|
92
|
+
includes avoiding interactions in community spaces as well as external channels
|
93
|
+
like social media. Violating these terms may lead to a temporary or
|
94
|
+
permanent ban.
|
95
|
+
|
96
|
+
=== 3. Temporary ban
|
97
|
+
|
98
|
+
**Community Impact**: A serious violation of community standards, including
|
99
|
+
sustained inappropriate behavior.
|
100
|
+
|
101
|
+
**Consequence**: A temporary ban from any sort of interaction or public
|
102
|
+
communication with the community for a specified period of time. No public or
|
103
|
+
private interaction with the people involved, including unsolicited interaction
|
104
|
+
with those enforcing the Code of Conduct, is allowed during this period.
|
105
|
+
Violating these terms may lead to a permanent ban.
|
106
|
+
|
107
|
+
=== 4. Permanent ban
|
108
|
+
|
109
|
+
**Community Impact**: Demonstrating a pattern of violation of community
|
110
|
+
standards, including sustained inappropriate behavior, harassment of an
|
111
|
+
individual, or aggression toward or disparagement of classes of individuals.
|
112
|
+
|
113
|
+
**Consequence**: A permanent ban from any sort of public interaction within
|
114
|
+
the community.
|
115
|
+
|
116
|
+
== Attribution
|
117
|
+
|
118
|
+
This Code of Conduct is adapted from the
|
119
|
+
https://www.contributor-covenant.org[Contributor Covenant],
|
120
|
+
version 2.0, available at
|
121
|
+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
122
|
+
|
123
|
+
Community Impact Guidelines were inspired by
|
124
|
+
https://github.com/mozilla/diversity[Mozilla's code of conduct enforcement ladder].
|
125
|
+
|
126
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
127
|
+
https://www.contributor-covenant.org/faq. Translations are available at
|
128
|
+
https://www.contributor-covenant.org/translations.
|
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
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
# Copyright (c) 2023 [Ribose Inc](https://www.ribose.com).
|
4
4
|
# All rights reserved.
|
5
|
-
# This file is a part of
|
5
|
+
# This file is a part of the Tebako project.
|
6
6
|
#
|
7
7
|
# Redistribution and use in source and binary forms, with or without
|
8
8
|
# modification, are permitted provided that the following conditions
|
data/INSTALLATION.adoc
ADDED
@@ -0,0 +1,231 @@
|
|
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
|
+
To run Tebako, a Ruby development environment is required.
|
189
|
+
The simplest option is to use the Ruby development environment provided by
|
190
|
+
https://rubyinstaller.org[RubyInstaller].
|
191
|
+
|
192
|
+
For example, Ruby+Devkit 3.3.7-1.
|
193
|
+
|
194
|
+
==== MinGW ucrt64
|
195
|
+
|
196
|
+
Enable MinGW ucrt64 and install the necessary packages.
|
197
|
+
|
198
|
+
The `ridk` command originates from the RubyInstaller installation.
|
199
|
+
|
200
|
+
[source,sh]
|
201
|
+
----
|
202
|
+
ridk enable ucrt64
|
203
|
+
pacman -S git tar bison flex toolchain make cmake \
|
204
|
+
boost diffutils libevent double-conversion \
|
205
|
+
fmt glog dlfcn gtest autotools ncurses libyaml
|
206
|
+
----
|
207
|
+
|
208
|
+
== Gem Installation
|
209
|
+
|
210
|
+
Tebako is distributed as a Ruby gem. A Ruby environment is necessary.
|
211
|
+
|
212
|
+
[source,sh]
|
213
|
+
----
|
214
|
+
gem install tebako
|
215
|
+
----
|
216
|
+
|
217
|
+
== Post-Install Setup (Not Generally Required)
|
218
|
+
|
219
|
+
Tebako requires a post-install setup after gem installation, as described in
|
220
|
+
link:README.adoc[README.adoc].
|
221
|
+
|
222
|
+
Post-install setup is called automatically during the first packaging.
|
223
|
+
Manual setup is only required if a pristine Tebako packaging environment is needed
|
224
|
+
to implement a caching strategy.
|
225
|
+
|
226
|
+
== License
|
227
|
+
|
228
|
+
Copyright Ribose. All rights reserved.
|
229
|
+
|
230
|
+
Tebako is released under the BSD 2-Clause License. See the
|
231
|
+
link:LICENSE.md[LICENSE.md] file for details.
|