history.txt 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. History of LZMA Utils and XZ Utils
  2. ==================================
  3. Tukaani distribution
  4. In 2005, there was a small group working on the Tukaani distribution,
  5. which was a Slackware fork. One of the project's goals was to fit the
  6. distro on a single 700 MiB ISO-9660 image. Using LZMA instead of gzip
  7. helped a lot. Roughly speaking, one could fit data that took 1000 MiB
  8. in gzipped form into 700 MiB with LZMA. Naturally, the compression
  9. ratio varied across packages, but this was what we got on average.
  10. Slackware packages have traditionally had .tgz as the filename suffix,
  11. which is an abbreviation of .tar.gz. A logical naming for LZMA
  12. compressed packages was .tlz, being an abbreviation of .tar.lzma.
  13. At the end of the year 2007, there was no distribution under the
  14. Tukaani project anymore, but development of LZMA Utils was kept going.
  15. Still, there were .tlz packages around, because at least Vector Linux
  16. (a Slackware based distribution) used LZMA for its packages.
  17. First versions of the modified pkgtools used the LZMA_Alone tool from
  18. Igor Pavlov's LZMA SDK as is. It was fine, because users wouldn't need
  19. to interact with LZMA_Alone directly. But people soon wanted to use
  20. LZMA for other files too, and the interface of LZMA_Alone wasn't
  21. comfortable for those used to gzip and bzip2.
  22. First steps of LZMA Utils
  23. The first version of LZMA Utils (4.22.0) included a shell script called
  24. lzmash. It was a wrapper that had a gzip-like command-line interface. It
  25. used the LZMA_Alone tool from LZMA SDK to do all the real work. zgrep,
  26. zdiff, and related scripts from gzip were adapted to work with LZMA and
  27. were part of the first LZMA Utils release too.
  28. LZMA Utils 4.22.0 included also lzmadec, which was a small (less than
  29. 10 KiB) decoder-only command-line tool. It was written on top of the
  30. decoder-only C code found from the LZMA SDK. lzmadec was convenient in
  31. situations where LZMA_Alone (a few hundred KiB) would be too big.
  32. lzmash and lzmadec were written by Lasse Collin.
  33. Second generation
  34. The lzmash script was an ugly and not very secure hack. The last
  35. version of LZMA Utils to use lzmash was 4.27.1.
  36. LZMA Utils 4.32.0beta1 introduced a new lzma command-line tool written
  37. by Ville Koskinen. It was written in C++, and used the encoder and
  38. decoder from C++ LZMA SDK with some little modifications. This tool
  39. replaced both the lzmash script and the LZMA_Alone command-line tool
  40. in LZMA Utils.
  41. Introducing this new tool caused some temporary incompatibilities,
  42. because the LZMA_Alone executable was simply named lzma like the new
  43. command-line tool, but they had a completely different command-line
  44. interface. The file format was still the same.
  45. Lasse wrote liblzmadec, which was a small decoder-only library based
  46. on the C code found from LZMA SDK. liblzmadec had an API similar to
  47. zlib, although there were some significant differences, which made it
  48. non-trivial to use it in some applications designed for zlib and
  49. libbzip2.
  50. The lzmadec command-line tool was converted to use liblzmadec.
  51. Alexandre Sauvé helped converting the build system to use GNU
  52. Autotools. This made it easier to test for certain less portable
  53. features needed by the new command-line tool.
  54. Since the new command-line tool never got completely finished (for
  55. example, it didn't support the LZMA_OPT environment variable), the
  56. intent was to not call 4.32.x stable. Similarly, liblzmadec wasn't
  57. polished, but appeared to work well enough, so some people started
  58. using it too.
  59. Because the development of the third generation of LZMA Utils was
  60. delayed considerably (3-4 years), the 4.32.x branch had to be kept
  61. maintained. It got some bug fixes now and then, and finally it was
  62. decided to call it stable, although most of the missing features were
  63. never added.
  64. File format problems
  65. The file format used by LZMA_Alone was primitive. It was designed with
  66. embedded systems in mind, and thus provided only a minimal set of
  67. features. The two biggest problems for non-embedded use were the lack
  68. of magic bytes and an integrity check.
  69. Igor and Lasse started developing a new file format with some help
  70. from Ville Koskinen. Also Mark Adler, Mikko Pouru, H. Peter Anvin,
  71. and Lars Wirzenius helped with some minor things at some point of the
  72. development. Designing the new format took quite a long time (actually,
  73. too long a time would be a more appropriate expression). It was mostly
  74. because Lasse was quite slow at getting things done due to personal
  75. reasons.
  76. Originally the new format was supposed to use the same .lzma suffix
  77. that was already used by the old file format. Switching to the new
  78. format wouldn't have caused much trouble when the old format wasn't
  79. used by many people. But since the development of the new format took
  80. such a long time, the old format got quite popular, and it was decided
  81. that the new file format must use a different suffix.
  82. It was decided to use .xz as the suffix of the new file format. The
  83. first stable .xz file format specification was finally released in
  84. December 2008. In addition to fixing the most obvious problems of
  85. the old .lzma format, the .xz format added some new features like
  86. support for multiple filters (compression algorithms), filter chaining
  87. (like piping on the command line), and limited random-access reading.
  88. Currently the primary compression algorithm used in .xz is LZMA2.
  89. It is an extension on top of the original LZMA to fix some practical
  90. problems: LZMA2 adds support for flushing the encoder, uncompressed
  91. chunks, eases stateful decoder implementations, and improves support
  92. for multithreading. Since LZMA2 is better than the original LZMA, the
  93. original LZMA is not supported in .xz.
  94. Transition to XZ Utils
  95. The early versions of XZ Utils were called LZMA Utils. The first
  96. releases were 4.42.0alphas. They dropped the rest of the C++ LZMA SDK.
  97. The code was still directly based on LZMA SDK but ported to C and
  98. converted from a callback API to a stateful API. Later, Igor Pavlov
  99. made a C version of the LZMA encoder too; these ports from C++ to C
  100. were independent in LZMA SDK and LZMA Utils.
  101. The core of the new LZMA Utils was liblzma, a compression library with
  102. a zlib-like API. liblzma supported both the old and new file format.
  103. The gzip-like lzma command-line tool was rewritten to use liblzma.
  104. The new LZMA Utils code base was renamed to XZ Utils when the name
  105. of the new file format had been decided. The liblzma compression
  106. library retained its name though, because changing it would have
  107. caused unnecessary breakage in applications already using the early
  108. liblzma snapshots.
  109. The xz command-line tool can emulate the gzip-like lzma tool by
  110. creating appropriate symlinks (e.g. lzma -> xz). Thus, practically
  111. all scripts using the lzma tool from LZMA Utils will work as is with
  112. XZ Utils (and will keep using the old .lzma format). Still, the .lzma
  113. format is more or less deprecated. XZ Utils will keep supporting it,
  114. but new applications should use the .xz format, and migrating old
  115. applications to .xz is often a good idea too.