xref: /freebsd/contrib/xz/README (revision f7c32ed617858bcd22f8d1b03199099d50125721)
1
2XZ Utils
3========
4
5    0. Overview
6    1. Documentation
7       1.1. Overall documentation
8       1.2. Documentation for command-line tools
9       1.3. Documentation for liblzma
10    2. Version numbering
11    3. Reporting bugs
12    4. Translations
13    5. Other implementations of the .xz format
14    6. Contact information
15
16
170. Overview
18-----------
19
20    XZ Utils provide a general-purpose data-compression library plus
21    command-line tools. The native file format is the .xz format, but
22    also the legacy .lzma format is supported. The .xz format supports
23    multiple compression algorithms, which are called "filters" in the
24    context of XZ Utils. The primary filter is currently LZMA2. With
25    typical files, XZ Utils create about 30 % smaller files than gzip.
26
27    To ease adapting support for the .xz format into existing applications
28    and scripts, the API of liblzma is somewhat similar to the API of the
29    popular zlib library. For the same reason, the command-line tool xz
30    has a command-line syntax similar to that of gzip.
31
32    When aiming for the highest compression ratio, the LZMA2 encoder uses
33    a lot of CPU time and may use, depending on the settings, even
34    hundreds of megabytes of RAM. However, in fast modes, the LZMA2 encoder
35    competes with bzip2 in compression speed, RAM usage, and compression
36    ratio.
37
38    LZMA2 is reasonably fast to decompress. It is a little slower than
39    gzip, but a lot faster than bzip2. Being fast to decompress means
40    that the .xz format is especially nice when the same file will be
41    decompressed very many times (usually on different computers), which
42    is the case e.g. when distributing software packages. In such
43    situations, it's not too bad if the compression takes some time,
44    since that needs to be done only once to benefit many people.
45
46    With some file types, combining (or "chaining") LZMA2 with an
47    additional filter can improve the compression ratio. A filter chain may
48    contain up to four filters, although usually only one or two are used.
49    For example, putting a BCJ (Branch/Call/Jump) filter before LZMA2
50    in the filter chain can improve compression ratio of executable files.
51
52    Since the .xz format allows adding new filter IDs, it is possible that
53    some day there will be a filter that is, for example, much faster to
54    compress than LZMA2 (but probably with worse compression ratio).
55    Similarly, it is possible that some day there is a filter that will
56    compress better than LZMA2.
57
58    XZ Utils supports multithreaded compression. XZ Utils doesn't support
59    multithreaded decompression yet. It has been planned though and taken
60    into account when designing the .xz file format. In the future, files
61    that were created in threaded mode can be decompressed in threaded
62    mode too.
63
64
651. Documentation
66----------------
67
681.1. Overall documentation
69
70    README              This file
71
72    INSTALL.generic     Generic install instructions for those not familiar
73                        with packages using GNU Autotools
74    INSTALL             Installation instructions specific to XZ Utils
75    PACKAGERS           Information to packagers of XZ Utils
76
77    COPYING             XZ Utils copyright and license information
78    COPYING.GPLv2       GNU General Public License version 2
79    COPYING.GPLv3       GNU General Public License version 3
80    COPYING.LGPLv2.1    GNU Lesser General Public License version 2.1
81
82    AUTHORS             The main authors of XZ Utils
83    THANKS              Incomplete list of people who have helped making
84                        this software
85    NEWS                User-visible changes between XZ Utils releases
86    ChangeLog           Detailed list of changes (commit log)
87    TODO                Known bugs and some sort of to-do list
88
89    Note that only some of the above files are included in binary
90    packages.
91
92
931.2. Documentation for command-line tools
94
95    The command-line tools are documented as man pages. In source code
96    releases (and possibly also in some binary packages), the man pages
97    are also provided in plain text (ASCII only) and PDF formats in the
98    directory "doc/man" to make the man pages more accessible to those
99    whose operating system doesn't provide an easy way to view man pages.
100
101
1021.3. Documentation for liblzma
103
104    The liblzma API headers include short docs about each function
105    and data type as Doxygen tags. These docs should be quite OK as
106    a quick reference.
107
108    There are a few example/tutorial programs that should help in
109    getting started with liblzma. In the source package the examples
110    are in "doc/examples" and in binary packages they may be under
111    "examples" in the same directory as this README.
112
113    Since the liblzma API has similarities to the zlib API, some people
114    may find it useful to read the zlib docs and tutorial too:
115
116        http://zlib.net/manual.html
117        http://zlib.net/zlib_how.html
118
119
1202. Version numbering
121--------------------
122
123    The version number format of XZ Utils is X.Y.ZS:
124
125      - X is the major version. When this is incremented, the library
126        API and ABI break.
127
128      - Y is the minor version. It is incremented when new features
129        are added without breaking the existing API or ABI. An even Y
130        indicates a stable release and an odd Y indicates unstable
131        (alpha or beta version).
132
133      - Z is the revision. This has a different meaning for stable and
134        unstable releases:
135
136          * Stable: Z is incremented when bugs get fixed without adding
137            any new features. This is intended to be convenient for
138            downstream distributors that want bug fixes but don't want
139            any new features to minimize the risk of introducing new bugs.
140
141          * Unstable: Z is just a counter. API or ABI of features added
142            in earlier unstable releases having the same X.Y may break.
143
144      - S indicates stability of the release. It is missing from the
145        stable releases, where Y is an even number. When Y is odd, S
146        is either "alpha" or "beta" to make it very clear that such
147        versions are not stable releases. The same X.Y.Z combination is
148        not used for more than one stability level, i.e. after X.Y.Zalpha,
149        the next version can be X.Y.(Z+1)beta but not X.Y.Zbeta.
150
151
1523. Reporting bugs
153-----------------
154
155    Naturally it is easiest for me if you already know what causes the
156    unexpected behavior. Even better if you have a patch to propose.
157    However, quite often the reason for unexpected behavior is unknown,
158    so here are a few things to do before sending a bug report:
159
160      1. Try to create a small example how to reproduce the issue.
161
162      2. Compile XZ Utils with debugging code using configure switches
163         --enable-debug and, if possible, --disable-shared. If you are
164         using GCC, use CFLAGS='-O0 -ggdb3'. Don't strip the resulting
165         binaries.
166
167      3. Turn on core dumps. The exact command depends on your shell;
168         for example in GNU bash it is done with "ulimit -c unlimited",
169         and in tcsh with "limit coredumpsize unlimited".
170
171      4. Try to reproduce the suspected bug. If you get "assertion failed"
172         message, be sure to include the complete message in your bug
173         report. If the application leaves a coredump, get a backtrace
174         using gdb:
175           $ gdb /path/to/app-binary   # Load the app to the debugger.
176           (gdb) core core   # Open the coredump.
177           (gdb) bt   # Print the backtrace. Copy & paste to bug report.
178           (gdb) quit   # Quit gdb.
179
180    Report your bug via email or IRC (see Contact information below).
181    Don't send core dump files or any executables. If you have a small
182    example file(s) (total size less than 256 KiB), please include
183    it/them as an attachment. If you have bigger test files, put them
184    online somewhere and include a URL to the file(s) in the bug report.
185
186    Always include the exact version number of XZ Utils in the bug report.
187    If you are using a snapshot from the git repository, use "git describe"
188    to get the exact snapshot version. If you are using XZ Utils shipped
189    in an operating system distribution, mention the distribution name,
190    distribution version, and exact xz package version; if you cannot
191    repeat the bug with the code compiled from unpatched source code,
192    you probably need to report a bug to your distribution's bug tracking
193    system.
194
195
1964. Translations
197---------------
198
199    The xz command line tool and all man pages can be translated.
200    The translations are handled via the Translation Project. If you
201    wish to help translating xz, please join the Translation Project:
202
203        https://translationproject.org/html/translators.html
204
205    Several strings will change in a future version of xz so if you
206    wish to start a new translation, look at the code in the xz git
207    repostiory instead of a 5.2.x release.
208
209
2105. Other implementations of the .xz format
211------------------------------------------
212
213    7-Zip and the p7zip port of 7-Zip support the .xz format starting
214    from the version 9.00alpha.
215
216        http://7-zip.org/
217        http://p7zip.sourceforge.net/
218
219    XZ Embedded is a limited implementation written for use in the Linux
220    kernel, but it is also suitable for other embedded use.
221
222        https://tukaani.org/xz/embedded.html
223
224
2256. Contact information
226----------------------
227
228    If you have questions, bug reports, patches etc. related to XZ Utils,
229    contact Lasse Collin <lasse.collin@tukaani.org> (in Finnish or English).
230    I'm sometimes slow at replying. If you haven't got a reply within two
231    weeks, assume that your email has got lost and resend it or use IRC.
232
233    You can find me also from #tukaani on Freenode; my nick is Larhzu.
234    The channel tends to be pretty quiet, so just ask your question and
235    someone may wake up.
236
237