README 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. XZ Utils
  2. ========
  3. 0. Overview
  4. 1. Documentation
  5. 1.1. Overall documentation
  6. 1.2. Documentation for command-line tools
  7. 1.3. Documentation for liblzma
  8. 2. Version numbering
  9. 3. Reporting bugs
  10. 4. Translations
  11. 5. Other implementations of the .xz format
  12. 6. Contact information
  13. 0. Overview
  14. -----------
  15. XZ Utils provide a general-purpose data-compression library plus
  16. command-line tools. The native file format is the .xz format, but
  17. also the legacy .lzma format is supported. The .xz format supports
  18. multiple compression algorithms, which are called "filters" in the
  19. context of XZ Utils. The primary filter is currently LZMA2. With
  20. typical files, XZ Utils create about 30 % smaller files than gzip.
  21. To ease adapting support for the .xz format into existing applications
  22. and scripts, the API of liblzma is somewhat similar to the API of the
  23. popular zlib library. For the same reason, the command-line tool xz
  24. has a command-line syntax similar to that of gzip.
  25. When aiming for the highest compression ratio, the LZMA2 encoder uses
  26. a lot of CPU time and may use, depending on the settings, even
  27. hundreds of megabytes of RAM. However, in fast modes, the LZMA2 encoder
  28. competes with bzip2 in compression speed, RAM usage, and compression
  29. ratio.
  30. LZMA2 is reasonably fast to decompress. It is a little slower than
  31. gzip, but a lot faster than bzip2. Being fast to decompress means
  32. that the .xz format is especially nice when the same file will be
  33. decompressed very many times (usually on different computers), which
  34. is the case e.g. when distributing software packages. In such
  35. situations, it's not too bad if the compression takes some time,
  36. since that needs to be done only once to benefit many people.
  37. With some file types, combining (or "chaining") LZMA2 with an
  38. additional filter can improve the compression ratio. A filter chain may
  39. contain up to four filters, although usually only one or two are used.
  40. For example, putting a BCJ (Branch/Call/Jump) filter before LZMA2
  41. in the filter chain can improve compression ratio of executable files.
  42. Since the .xz format allows adding new filter IDs, it is possible that
  43. some day there will be a filter that is, for example, much faster to
  44. compress than LZMA2 (but probably with worse compression ratio).
  45. Similarly, it is possible that some day there is a filter that will
  46. compress better than LZMA2.
  47. XZ Utils supports multithreaded compression. XZ Utils doesn't support
  48. multithreaded decompression yet. It has been planned though and taken
  49. into account when designing the .xz file format. In the future, files
  50. that were created in threaded mode can be decompressed in threaded
  51. mode too.
  52. 1. Documentation
  53. ----------------
  54. 1.1. Overall documentation
  55. README This file
  56. INSTALL.generic Generic install instructions for those not
  57. familiar with packages using GNU Autotools
  58. INSTALL Installation instructions specific to XZ Utils
  59. PACKAGERS Information to packagers of XZ Utils
  60. COPYING XZ Utils copyright and license information
  61. COPYING.0BSD BSD Zero Clause License
  62. COPYING.GPLv2 GNU General Public License version 2
  63. COPYING.GPLv3 GNU General Public License version 3
  64. COPYING.LGPLv2.1 GNU Lesser General Public License version 2.1
  65. AUTHORS The main authors of XZ Utils
  66. THANKS Incomplete list of people who have helped making
  67. this software
  68. NEWS User-visible changes between XZ Utils releases
  69. ChangeLog Detailed list of changes (commit log)
  70. TODO Known bugs and some sort of to-do list
  71. Note that only some of the above files are included in binary
  72. packages.
  73. 1.2. Documentation for command-line tools
  74. The command-line tools are documented as man pages. In source code
  75. releases (and possibly also in some binary packages), the man pages
  76. are also provided in plain text (ASCII only) format in the directory
  77. "doc/man" to make the man pages more accessible to those whose
  78. operating system doesn't provide an easy way to view man pages.
  79. 1.3. Documentation for liblzma
  80. The liblzma API headers include short docs about each function
  81. and data type as Doxygen tags. These docs should be quite OK as
  82. a quick reference.
  83. There are a few example/tutorial programs that should help in
  84. getting started with liblzma. In the source package the examples
  85. are in "doc/examples" and in binary packages they may be under
  86. "examples" in the same directory as this README.
  87. Since the liblzma API has similarities to the zlib API, some people
  88. may find it useful to read the zlib docs and tutorial too:
  89. https://zlib.net/manual.html
  90. https://zlib.net/zlib_how.html
  91. 2. Version numbering
  92. --------------------
  93. The version number format of XZ Utils is X.Y.ZS:
  94. - X is the major version. When this is incremented, the library
  95. API and ABI break.
  96. - Y is the minor version. It is incremented when new features
  97. are added without breaking the existing API or ABI. An even Y
  98. indicates a stable release and an odd Y indicates unstable
  99. (alpha or beta version).
  100. - Z is the revision. This has a different meaning for stable and
  101. unstable releases:
  102. * Stable: Z is incremented when bugs get fixed without adding
  103. any new features. This is intended to be convenient for
  104. downstream distributors that want bug fixes but don't want
  105. any new features to minimize the risk of introducing new bugs.
  106. * Unstable: Z is just a counter. API or ABI of features added
  107. in earlier unstable releases having the same X.Y may break.
  108. - S indicates stability of the release. It is missing from the
  109. stable releases, where Y is an even number. When Y is odd, S
  110. is either "alpha" or "beta" to make it very clear that such
  111. versions are not stable releases. The same X.Y.Z combination is
  112. not used for more than one stability level, i.e. after X.Y.Zalpha,
  113. the next version can be X.Y.(Z+1)beta but not X.Y.Zbeta.
  114. 3. Reporting bugs
  115. -----------------
  116. Naturally it is easiest for me if you already know what causes the
  117. unexpected behavior. Even better if you have a patch to propose.
  118. However, quite often the reason for unexpected behavior is unknown,
  119. so here are a few things to do before sending a bug report:
  120. 1. Try to create a small example how to reproduce the issue.
  121. 2. Compile XZ Utils with debugging code using configure switches
  122. --enable-debug and, if possible, --disable-shared. If you are
  123. using GCC, use CFLAGS='-O0 -ggdb3'. Don't strip the resulting
  124. binaries.
  125. 3. Turn on core dumps. The exact command depends on your shell;
  126. for example in GNU bash it is done with "ulimit -c unlimited",
  127. and in tcsh with "limit coredumpsize unlimited".
  128. 4. Try to reproduce the suspected bug. If you get "assertion failed"
  129. message, be sure to include the complete message in your bug
  130. report. If the application leaves a coredump, get a backtrace
  131. using gdb:
  132. $ gdb /path/to/app-binary # Load the app to the debugger.
  133. (gdb) core core # Open the coredump.
  134. (gdb) bt # Print the backtrace. Copy & paste to bug report.
  135. (gdb) quit # Quit gdb.
  136. Report your bug via email or IRC (see Contact information below).
  137. Don't send core dump files or any executables. If you have a small
  138. example file(s) (total size less than 256 KiB), please include
  139. it/them as an attachment. If you have bigger test files, put them
  140. online somewhere and include a URL to the file(s) in the bug report.
  141. Always include the exact version number of XZ Utils in the bug report.
  142. If you are using a snapshot from the git repository, use "git describe"
  143. to get the exact snapshot version. If you are using XZ Utils shipped
  144. in an operating system distribution, mention the distribution name,
  145. distribution version, and exact xz package version; if you cannot
  146. repeat the bug with the code compiled from unpatched source code,
  147. you probably need to report a bug to your distribution's bug tracking
  148. system.
  149. 4. Translations
  150. ---------------
  151. The xz command line tool and all man pages can be translated.
  152. The translations are handled via the Translation Project. If you
  153. wish to help translating xz, please join the Translation Project:
  154. https://translationproject.org/html/translators.html
  155. Below are notes and testing instructions specific to xz
  156. translations.
  157. Testing can be done by installing xz into a temporary directory:
  158. ./configure --disable-shared --prefix=/tmp/xz-test
  159. # <Edit the .po file in the po directory.>
  160. make -C po update-po
  161. make install
  162. bash debug/translation.bash | less
  163. bash debug/translation.bash | less -S # For --list outputs
  164. Repeat the above as needed (no need to re-run configure though).
  165. Note especially the following:
  166. - The output of --help and --long-help must look nice on
  167. an 80-column terminal. It's OK to add extra lines if needed.
  168. - In contrast, don't add extra lines to error messages and such.
  169. They are often preceded with e.g. a filename on the same line,
  170. so you have no way to predict where to put a \n. Let the terminal
  171. do the wrapping even if it looks ugly. Adding new lines will be
  172. even uglier in the generic case even if it looks nice in a few
  173. limited examples.
  174. - Be careful with column alignment in tables and table-like output
  175. (--list, --list --verbose --verbose, --info-memory, --help, and
  176. --long-help):
  177. * All descriptions of options in --help should start in the
  178. same column (but it doesn't need to be the same column as
  179. in the English messages; just be consistent if you change it).
  180. Check that both --help and --long-help look OK, since they
  181. share several strings.
  182. * --list --verbose and --info-memory print lines that have
  183. the format "Description: %s". If you need a longer
  184. description, you can put extra space between the colon
  185. and %s. Then you may need to add extra space to other
  186. strings too so that the result as a whole looks good (all
  187. values start at the same column).
  188. * The columns of the actual tables in --list --verbose --verbose
  189. should be aligned properly. Abbreviate if necessary. It might
  190. be good to keep at least 2 or 3 spaces between column headings
  191. and avoid spaces in the headings so that the columns stand out
  192. better, but this is a matter of opinion. Do what you think
  193. looks best.
  194. - Be careful to put a period at the end of a sentence when the
  195. original version has it, and don't put it when the original
  196. doesn't have it. Similarly, be careful with \n characters
  197. at the beginning and end of the strings.
  198. - Read the TRANSLATORS comments that have been extracted from the
  199. source code and included in xz.pot. Some comments suggest
  200. testing with a specific command which needs an .xz file. You
  201. may use e.g. any tests/files/good-*.xz. However, these test
  202. commands are included in translations.bash output, so reading
  203. translations.bash output carefully can be enough.
  204. - If you find language problems in the original English strings,
  205. feel free to suggest improvements. Ask if something is unclear.
  206. - The translated messages should be understandable (sometimes this
  207. may be a problem with the original English messages too). Don't
  208. make a direct word-by-word translation from English especially if
  209. the result doesn't sound good in your language.
  210. Thanks for your help!
  211. 5. Other implementations of the .xz format
  212. ------------------------------------------
  213. 7-Zip and the p7zip port of 7-Zip support the .xz format starting
  214. from the version 9.00alpha.
  215. https://7-zip.org/
  216. https://p7zip.sourceforge.net/
  217. XZ Embedded is a limited implementation written for use in the Linux
  218. kernel, but it is also suitable for other embedded use.
  219. https://tukaani.org/xz/embedded.html
  220. XZ for Java is a complete implementation written in pure Java.
  221. https://tukaani.org/xz/java.html
  222. 6. Contact information
  223. ----------------------
  224. XZ Utils in general:
  225. - Home page: https://tukaani.org/xz/
  226. - Email to maintainer(s): xz@tukaani.org
  227. - IRC: #tukaani on Libera Chat
  228. - GitHub: https://github.com/tukaani-project/xz
  229. Lead maintainer:
  230. - Email: Lasse Collin <lasse.collin@tukaani.org>
  231. - IRC: Larhzu on Libera Chat