[Toybox] xzcat.c: What do we want from upstream?

Oliver Webb aquahobbyist at proton.me
Thu Mar 14 21:37:54 PDT 2024


Slightly more then 2 weeks ago (Feb 28th), I posted a requested evaluation of upstream changes
(http://lists.landley.net/pipermail/toybox-landley.net/2024-February/030095.html)
For the xz decompressor we are using. Of these, the most important commits (from my
evaluation) are:

(I truncated the commit id's this time, didn't before
because I copy pasted the list of commit id's and went over each one.)

89094f0: Adds the ARM64 BCJ encoder
8f3ed8b: Adds a MicroLZMA decoder
6f0e0c4: "Add xz_dec_catrun() to support concatenated .xz files."

And the ones that aren't so obviously important but notable anyways:
f6d1f58: Update email address, might wanna change the command header
82078b6: Detect read errors from stdin
cfc1499: "Avoid overlapping memcpy() with invalid input with in-place decompression."
40d291b: "Fix XZ_DYN_ALLOC to avoid useless memory reallocations."
df9d444: "Add a new line after error message";
94d107e: "Add support for MSVC in xz_config.h." Some ifdefs

Adding these wouldn't be hard (going over the diff and applying them by hand,
fixing bool types and c89 comments and != 0 and whatever else along the way).

But there are bugs that can be introduced and I don't spend my time extensively
debugging a feature that we don't want. For example I tried on 6f0ec4 (Add xz_dec_catrun),
got it to compile, but not to pass the test suite or decode linux-kernel tarballs.

We are trying to make xzcat _smaller_ by my understanding. Which including
more features would get in the way of (by probally about 500 lines of code looking
through the diffs, and a considerable amount of executable size too).
But there is also stuff like 89094f0 (Adds the ARM64 BCJ encoder) which was
discussed as something we might want.

I don't know if I should spend my time stripping out c89 comment blocks and
cleaning up more code from xzcat.c or trying to get features in before more cleanup.

What should we include from here, everything, nothing at all, only a few important things?

-   Oliver Webb <aquahobbyist at proton.me>



More information about the Toybox mailing list