]> git.ipfire.org Git - thirdparty/xz.git/log
thirdparty/xz.git
7 months agoUpdate THANKS
Lasse Collin [Tue, 9 Dec 2025 15:40:05 +0000 (17:40 +0200)] 
Update THANKS

7 months agoTranslations: Add src/xz/sandbox.c to POTFILES.in
Lasse Collin [Tue, 9 Dec 2025 11:01:36 +0000 (13:01 +0200)] 
Translations: Add src/xz/sandbox.c to POTFILES.in

There are no strings to translate in that file now, but it's good to
list it anyway in case translatable strings are added in the future.

Fixes: 374868d81d47 ("xz: Move sandboxing code to sandbox.c and improve Landlock sandbox.")
7 months agoxz: Never translate "Failed to enable the sandbox"
Lasse Collin [Tue, 9 Dec 2025 10:55:45 +0000 (12:55 +0200)] 
xz: Never translate "Failed to enable the sandbox"

This was already the case in practice because I had forgotten to list
src/xz/sandbox.c in po/POTFILES.in. However, it seems better to never
translate this particular error message. It should almost never occur
and if it does, an untranslated message is should make it easier to
find bug reports about it.

7 months agoTranslations: Update the Swedish man page translations
Lasse Collin [Tue, 9 Dec 2025 10:27:15 +0000 (12:27 +0200)] 
Translations: Update the Swedish man page translations

7 months agoTranslations: Update the Romanian man page translations
Lasse Collin [Tue, 9 Dec 2025 10:26:24 +0000 (12:26 +0200)] 
Translations: Update the Romanian man page translations

7 months agoUpdate THANKS
Lasse Collin [Tue, 9 Dec 2025 10:13:36 +0000 (12:13 +0200)] 
Update THANKS

7 months agoCMake: Autodetect unaligned access support on LoongArch
Lasse Collin [Tue, 9 Dec 2025 10:13:36 +0000 (12:13 +0200)] 
CMake: Autodetect unaligned access support on LoongArch

This still relies on CMAKE_SYSTEM_PROCESSOR. CMake 4.1 added more
CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID values to detect the arch in
a more defined manner, but 4.1 is too new to require for now.

Thanks-to: Li Chenggang <lichenggang@deepin.org>
Closes: https://github.com/tukaani-project/xz/pull/186
7 months agoAutotools: Autodetect unaligned access support on LoongArch
Lasse Collin [Tue, 9 Dec 2025 10:13:36 +0000 (12:13 +0200)] 
Autotools: Autodetect unaligned access support on LoongArch

According to [1] sections 7.4, 8.1, and 8.2, desktop and server
processors support fast unaligned access, but embedded systems likely
don't.

It's important that TUKLIB_FAST_UNALIGNED_ACCESS isn't defined when
-mstrict-align is in use because it will result in slower binaries
even if running on a processor that supports fast unaligned access.
It's because compilers will translate multibyte memcpy() to multiple
byte-by-byte instructions instead of wider loads and stores. The
compression times from [2] show this well:

    Unaligned access    CFLAGS                     Compression time
        enabled         -O2 -mno-strict-align          66.1 s
        disabled        -O2 -mno-strict-align          79.5 s
        disabled        -O2 -mstrict-align             79.9 s
        enabled         -O2 -mstrict-align            129.1 s

There currently (GCC 15.2) is no preprocessor macro on LoongArch
to detect if -mstrict-align or -mno-strict-align is in effect (the
default is -mno-strict-align). Use heuristics to detect which of the
flags is in effect.

[1] https://github.com/loongson/la-softdev-convention/blob/v0.2/la-softdev-convention.adoc
[2] https://github.com/tukaani-project/xz/pull/186#issuecomment-3494570304

Thanks-to: Li Chenggang <lichenggang@deepin.org>
Thanks-to: Xi Ruoyao
See: https://github.com/tukaani-project/xz/pull/186

7 months agoxz: Silence clang -Wunreachable-code-break
Lasse Collin [Wed, 26 Nov 2025 11:50:57 +0000 (13:50 +0200)] 
xz: Silence clang -Wunreachable-code-break

Fixes: a165d7df1964 ("xz: Add a new --filters-help option.")
7 months agoliblzma: Remove unwanted semicolons
Lasse Collin [Wed, 26 Nov 2025 11:50:57 +0000 (13:50 +0200)] 
liblzma: Remove unwanted semicolons

These didn't affect control flow.

7 months agoTests: Remove an unwanted semicolon from a macro definition
Lasse Collin [Wed, 26 Nov 2025 11:50:57 +0000 (13:50 +0200)] 
Tests: Remove an unwanted semicolon from a macro definition

It didn't affect control flow.

Fixes: fe3bd438fb11 ("Tests: Fix memory leaks in test_block_header.")
7 months agoBuild: Use -Wextra-semi-stmt when supported
Lasse Collin [Wed, 26 Nov 2025 11:50:57 +0000 (13:50 +0200)] 
Build: Use -Wextra-semi-stmt when supported

7 months agoCI: Add clang-cl
Lasse Collin [Wed, 26 Nov 2025 11:50:57 +0000 (13:50 +0200)] 
CI: Add clang-cl

Fixes: https://github.com/tukaani-project/xz/issues/18#issuecomment-3577456136
7 months agoxz/Windows: Add a missing #include to fix the build with clang-cl
Lasse Collin [Wed, 26 Nov 2025 11:50:57 +0000 (13:50 +0200)] 
xz/Windows: Add a missing #include to fix the build with clang-cl

Fixes: https://github.com/tukaani-project/xz/issues/18#issuecomment-1986829734
Fixes: https://github.com/tukaani-project/xz/issues/18#issuecomment-3577456136
7 months agoxz: Check return value of sigaction() before calling raise()
Lasse Collin [Tue, 25 Nov 2025 19:05:37 +0000 (21:05 +0200)] 
xz: Check return value of sigaction() before calling raise()

Fixes: Coverity CID 456022
7 months agoliblzma: Refactor a loop in lzma_filters_copy()
Lasse Collin [Sun, 2 Nov 2025 10:57:00 +0000 (12:57 +0200)] 
liblzma: Refactor a loop in lzma_filters_copy()

Arguably it's nicer if i doesn't wrap around when the loop terminates.

Fixes: Coverity CID 464589
Fixes: 6d118a0b9def ("Add lzma_filters_copy().")
7 months agoliblzma: Silence two Coverity warnings
Lasse Collin [Sun, 2 Nov 2025 10:17:50 +0000 (12:17 +0200)] 
liblzma: Silence two Coverity warnings

lzma_lzma_decoder_memusage() returns UINT64_MAX if lc/lp/pb aren't
valid. alone_decoder.c and lzip_decoder.c didn't check the return
value because in both it is known that lc/lp/pb are valid. Make them
call the _nocheck() variant instead which skips the validation (it
already existed for LZMA2's internal use).

Fixes: Coverity CID 464658
Fixes: Coverity CID 897069
7 months agoliblzma: Fix a harmless read of shared variable without mutex
Lasse Collin [Sun, 2 Nov 2025 10:17:50 +0000 (12:17 +0200)] 
liblzma: Fix a harmless read of shared variable without mutex

The partial_update_mode enumeration had three states, _DISABLED,
_START, and _ENABLED. Main thread changed it from _DISABLED to _START
while holding a mutex. Once set to _START, worker thread changed it
to _ENABLED without a mutex. Later main thread read it without a mutex,
so it could see either _START or _ENABLED. However, it made no
difference because the main thread checked for != _DISABLED, so
it didn't matter if it saw _START or _ENABLED.

Nevertheless, such things must not be done. It's clear it was a mistake
because there were two comments that directly contradicted each
other about how the variable was accessed.

Split the enumeration into two booleans:

  - partial_update_enabled: A worker thread locks the mutex to read
    this variable and the main thread locks the mutex to change the
    value. Because only the main thread modifies the variable, the
    main thread can read the value without locking the mutex.
    This variable replaces the _DISABLED -> _START transition.

  - partial_update_started is for worker thread's internal use and thus
    needs no mutex. This replaces the _START -> _ENABLED transition.

Fixes: Coverity CID 456025
Fixes: bd93b776c1bd ("liblzma: Fix a deadlock in threaded decoder.")
7 months agoCI: Add Coverity Scan
Lasse Collin [Sun, 2 Nov 2025 10:17:50 +0000 (12:17 +0200)] 
CI: Add Coverity Scan

Co-authored-by: Lasse Collin <lasse.collin@tukaani.org>
Fixes: https://github.com/tukaani-project/xz/issues/198
7 months agoChange the sorting order in THANKS
Lasse Collin [Tue, 25 Nov 2025 11:55:35 +0000 (13:55 +0200)] 
Change the sorting order in THANKS

In short, sort the names with this command (-k1,1 isn't needed because
the lines with names start with "  -"):

    LC_ALL=en_US.UTF-8 sort -k2,2 -k3,3 -k4,4 -k5,5

When THANKS was created, I wrote the names as "First Last" and attempted
to keep them sorted by last name / surname / family name. This works
with many names in THANKS, but it becomes complicated with names that
don't fit that pattern. For example, names that are written as
"Last First" can be manually sorted by family name, but only if one
knows which part of the name is the family name.[*] And of course,
the concept of first/last name doesn't apply to all names.

[*] xz had a co-maintainer who could help me with such names,
    but fortunately he isn't working on the project anymore.

Adding the names in chronological order could have worked too, although
if something is contributed by multiple people, one would still have to
decide how to sort the names within the batch. Another downside would
be that if THANKS is updated in more than one work-in-progress branch,
merge conflicts would occur more often.

Don't attempt to sort by last name. Let's be happy that people tend to
provide names that can be expressed in a reasonable number of printable
Unicode characters. In practice, people have been even nicer: if the
native language doesn't use a Latin script alphabet, people often provide
a transliterated name (only or in addition to the original spelling),
which is very much appreciated by those who don't know the native script.

Treat the names as opaque strings or space-separated strings for sorting
purposes. This means that most names will now be sorted by first name.
There still are many choices how to sort:

(1) LC_ALL=en_US.UTF-8 sort

    The project is in English, so this may sound like a logical choice.
    However, spaces have a lower weight than letters, which results in
    this order:

        - A Ba
        - Ab C
        - A Bc
        - A Bd

(2) LC_ALL=en_US.UTF-8 sort -k2,2

    This first sorts by the first word and then by the rest of the
    string. It's -k2,2 instead of -k1,1 to skip the leading dash.

        - A Ba
        - A Bc
        - A Bd
        - Ab C

    I like this more than (1). One could add -k3,3 -k4,4 -k5,5 ... too.
    With current THANKS it makes no difference but it might some day.

    NOTE: The ordering in en_US.UTF-8 can differ between libc versions
    and operating systems. Luckily it's not a big deal in THANKS.

(3) LC_ALL=en_US.UTF-8 sort -f -k2,2

    Passing -f (--ignore-case) to sort affects sorting of single-byte
    characters but not multibyte characters (GNU coreutils 9.9):

        No -f       With -f     LC_ALL=C
        Aa          A.A         A.A
        A.A         Aa          Aa
        Ää          Ää          Ä.Ä
        Ä.Ä         Ä.Ä         Ää

    In GNU coreutils, the THANKS file is sorted using "sort -f -k1,1".
    There is also a basic check that the en_US.UTF-8 locale is
    behaving as expected.

(4) LC_ALL=C sort

    This sorts by byte order which in UTF-8 is the same as Unicode
    code point order. With the strings in (1) and (2), this produces
    the same result as in (2). The difference in (3) can be seen above.

    The results differ from en_US.UTF-8 when a name component starts
    with a lower case ASCII letter (like "von" or "de"). Worse, any
    non-ASCII characters sort after ASCII chars. These properties might
    look weird in English language text, although it's good to remember
    that en_US.UTF-8 sorting can appear weird too if one's native
    language isn't English.

The choice between (2) and (4) was difficult but I went with (2).

;-)

8 months agoLandlock: Add missing #ifdefs
Lasse Collin [Sun, 23 Nov 2025 18:39:28 +0000 (20:39 +0200)] 
Landlock: Add missing #ifdefs

The build was broken on distros that have an old <sys/landlock.h>.

Fixes: 2b2652e914b1 ("Landlock: Workaround a bug in RHEL 9 kernel")
8 months agoUpdate THANKS
Lasse Collin [Sun, 23 Nov 2025 18:13:50 +0000 (20:13 +0200)] 
Update THANKS

8 months agoLandlock: Workaround a bug in RHEL 9 kernel
Lasse Collin [Sun, 23 Nov 2025 18:13:49 +0000 (20:13 +0200)] 
Landlock: Workaround a bug in RHEL 9 kernel

If one runs xz 5.8.0 or 5.8.1 from some other distribution in a container
on RHEL 9, xz will fail with the message "Failed to enable the sandbox".

RHEL 9 kernel since 5.14.0-603.el9 (2025-07-30) claims to support
Landlock ABI version 6, but it lacks support for LANDLOCK_SCOPE_SIGNAL.
The issue is still present in 5.14.0-643.el9 (2025-11-22). Red Hat is
aware of the issue, but I don't know when it will be fixed.

The sandbox is meant to be transparent to users, thus there isn't and
won't be a command line option to disable it. Instead, add a workaround
to keep xz working on the buggy RHEL 9 kernels.

Reported-by: Richard W.M. Jones
Thanks-to: Pavel Raiskup
Tested-by: Orgad Shaneh
Tested-by: Richard W.M. Jones
Fixes: https://github.com/tukaani-project/xz/issues/199
Link: https://issues.redhat.com/browse/RHEL-125143
Link: https://bugzilla.redhat.com/show_bug.cgi?id=2407105
Link: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/65BDSY56R5ZJRTUC4B6CIVCVLY4LG4ME/
8 months agoLandlock: Cache the ABI version
Lasse Collin [Sun, 23 Nov 2025 18:13:37 +0000 (20:13 +0200)] 
Landlock: Cache the ABI version

In xz it can avoid up to two syscalls that query the ABI version.

8 months agoUpdate THANKS
Lasse Collin [Mon, 3 Nov 2025 12:52:45 +0000 (14:52 +0200)] 
Update THANKS

8 months agomythread.h: Fix the build on Emscripten when threading is disabled
Lasse Collin [Mon, 3 Nov 2025 10:41:31 +0000 (12:41 +0200)] 
mythread.h: Fix the build on Emscripten when threading is disabled

To make a non-threaded liblzma-only build work with WASI SDK, <signal.h>
and mythread_sigmask() were omitted from mythread.h in the commit
81db3b889830. This broke non-threaded full build with Emscripten because
src/xz/signals.c needs mythread_sigmask() (liblzma-only build was fine).

If __wasm__ is defined, omit <signal.h> and mythread_sigmask() in
non-threaded builds only when __EMSCRIPTEN__ isn't defined.

Reported-by: Marcus Tillmanns
Thanks-to: ChanTsune
Fixes: https://github.com/tukaani-project/xz/issues/161
Fixes: 81db3b889830 ("mythread.h: Disable signal functions in builds targeting Wasm + WASI.")
8 months agoTranslations: Update the Serbian man page translations
Lasse Collin [Mon, 3 Nov 2025 09:56:32 +0000 (11:56 +0200)] 
Translations: Update the Serbian man page translations

The earlier bug fixes are now included in the Translation Project.

9 months agoxz: Silence a compiler warning when signals_block_count is unused
Lasse Collin [Sun, 2 Nov 2025 17:40:55 +0000 (19:40 +0200)] 
xz: Silence a compiler warning when signals_block_count is unused

Move the static variable signals_block_count to the #ifndef block
that already has the functions that need the variable.

9 months agoxz: Silence a warning from Clang on glibc systems
Lasse Collin [Sun, 2 Nov 2025 15:45:20 +0000 (17:45 +0200)] 
xz: Silence a warning from Clang on glibc systems

Fixes: e8838b2f5922 ("xz: Look at resource limits when determining the default memlimit")
9 months agoTranslations: Update the Serbian man page translations
Lasse Collin [Sun, 2 Nov 2025 12:37:52 +0000 (14:37 +0200)] 
Translations: Update the Serbian man page translations

Preserve the bug fixes made in 71ad5e82888f and 4f52e7387012 because
upstream hasn't included them.

9 months agoTranslations: Update the Korean man page translations
Lasse Collin [Sun, 2 Nov 2025 12:27:10 +0000 (14:27 +0200)] 
Translations: Update the Korean man page translations

9 months agoTranslations: Update the Italian man page translations
Lasse Collin [Sun, 2 Nov 2025 12:24:43 +0000 (14:24 +0200)] 
Translations: Update the Italian man page translations

9 months agoTranslations: Update the Ukrainian man page translations
Lasse Collin [Sun, 2 Nov 2025 12:12:23 +0000 (14:12 +0200)] 
Translations: Update the Ukrainian man page translations

9 months agoliblzma: Fix build on old Linux/glibc on ARM64
Lasse Collin [Sun, 28 Sep 2025 15:32:05 +0000 (18:32 +0300)] 
liblzma: Fix build on old Linux/glibc on ARM64

getauxval() can be available even if HWCAP_CRC32 isn't #defined, so
both have to be checked. HWCAP_CRC32 was added in glibc 2.24 (2016).

Fixes: https://github.com/tukaani-project/xz/issues/190
9 months agoCI: Update Solaris
Lasse Collin [Fri, 31 Oct 2025 12:36:26 +0000 (14:36 +0200)] 
CI: Update Solaris

9 months agoCI: Update DragonFly BSD
Lasse Collin [Fri, 31 Oct 2025 12:32:47 +0000 (14:32 +0200)] 
CI: Update DragonFly BSD

9 months agoCI: Update NetBSD
Lasse Collin [Fri, 31 Oct 2025 12:30:24 +0000 (14:30 +0200)] 
CI: Update NetBSD

9 months agoCI: Update FreeBSD
Lasse Collin [Fri, 31 Oct 2025 12:21:37 +0000 (14:21 +0200)] 
CI: Update FreeBSD

9 months agoCI: Update OpenBSD
Lasse Collin [Fri, 31 Oct 2025 12:17:30 +0000 (14:17 +0200)] 
CI: Update OpenBSD

9 months agoUpdate THANKS
Lasse Collin [Sun, 26 Oct 2025 10:07:34 +0000 (12:07 +0200)] 
Update THANKS

9 months agoxz: Look at resource limits when determining the default memlimit
Kirill A. Korinsky [Sun, 26 Oct 2025 10:07:34 +0000 (12:07 +0200)] 
xz: Look at resource limits when determining the default memlimit

When no memory usage limits have been set by the user, the default
for multithreaded mode has been 1/4 of total RAM. If this limit is
too high and memory allocation fails, liblzma (and xz) fail. Perhaps
liblzma should handle it better by reducing the number of threads
and continuing with the amount of memory it can allocate, but currently
that isn't the case.

If resource limits were set to about 1/4 of RAM or lower, then xz
could fail for the above reason. This commit makes xz look at
RLIMIT_DATA, RLIMIT_AS, and RLIMIT_VMEM when they are available,
and set the limit 64 MiB below the lowest of those limits. This is
more or less a hack just like the 1/4-of-RAM method is, but this is
simple and quick to implement.

On Linux, there are other limits like cgroup v2 memory.max which
can still make xz fail. The same is likely possible with FreeBSD's
rctl(8).

Co-authored-by: Lasse Collin <lasse.collin@tukaani.org>
Thanks-to: Fangrui Song
Fixes: https://github.com/tukaani-project/xz/issues/195
Closes: https://github.com/tukaani-project/xz/pull/196
10 months agoCI: Remove windows-2019 (which had VS 2019)
Lasse Collin [Wed, 1 Oct 2025 09:46:26 +0000 (12:46 +0300)] 
CI: Remove windows-2019 (which had VS 2019)

GitHub has removed the runner image.

A breakage with CLMUL CRC code occurred with VS 2019 but not 2022,
see b5a5d9e3f702. MS supports VS 2019 for a few more years, so it's
unfortunate that it can no longer be tested on GitHub.

10 months agoUpdate THANKS
Lasse Collin [Mon, 29 Sep 2025 16:34:58 +0000 (19:34 +0300)] 
Update THANKS

10 months agoxz: Don't fsync() directories on AIX
Lakshmi-Surekha [Fri, 18 Jul 2025 04:27:06 +0000 (23:27 -0500)] 
xz: Don't fsync() directories on AIX

It fails with EBADF.

Fixes: https://github.com/tukaani-project/xz/issues/188
Closes: https://github.com/tukaani-project/xz/pull/189
10 months agoliblzma: Document that lzma_allocator.free(opaque, NULL) is possible
Lasse Collin [Mon, 29 Sep 2025 15:37:19 +0000 (18:37 +0300)] 
liblzma: Document that lzma_allocator.free(opaque, NULL) is possible

It feels better to fix the docs than change the code because this
way newly-written applications will be forced to be compatible with
the lzma_allocator behavior of old liblzma versions. It can matter
if someone builds the application against an older liblzma version.

Fixes: https://github.com/tukaani-project/xz/issues/183
10 months agoUpdate GPLv2 and LGPLv2.1 copies from gnu.org
Simon Josefsson [Tue, 26 Aug 2025 07:41:02 +0000 (09:41 +0200)] 
Update GPLv2 and LGPLv2.1 copies from gnu.org

Closes: https://github.com/tukaani-project/xz/pull/194
10 months agotests/test_suffix.sh: Avoid variables in printf format string
Lasse Collin [Sat, 24 May 2025 09:07:13 +0000 (12:07 +0300)] 
tests/test_suffix.sh: Avoid variables in printf format string

10 months agobuild-aux/manconv.sh: Add quotes
Lasse Collin [Sat, 24 May 2025 09:02:09 +0000 (12:02 +0300)] 
build-aux/manconv.sh: Add quotes

10 months agowindows/build.bash: Add quotes
Lasse Collin [Sat, 24 May 2025 09:01:35 +0000 (12:01 +0300)] 
windows/build.bash: Add quotes

In this case they aren't needed but it's better style.

10 months agopo4a/update-po: Ensure that a glob won't expand to a command line option
Lasse Collin [Sat, 24 May 2025 09:00:13 +0000 (12:00 +0300)] 
po4a/update-po: Ensure that a glob won't expand to a command line option

10 months agoliblzma: validate_map.sh: Catch some unlikely errors
Lasse Collin [Sat, 24 May 2025 08:57:23 +0000 (11:57 +0300)] 
liblzma: validate_map.sh: Catch some unlikely errors

10 months agoCI: Catch unsupported arguments in ci_build.bash
Lasse Collin [Sat, 24 May 2025 08:55:59 +0000 (11:55 +0300)] 
CI: Catch unsupported arguments in ci_build.bash

10 months agoScripts: Add shellcheck directives to silence warnings
Lasse Collin [Tue, 13 May 2025 17:42:26 +0000 (20:42 +0300)] 
Scripts: Add shellcheck directives to silence warnings

Set also shell because the xz*.in files start with '#!@POSIX_SHELL@'.

SC1003 and SC2016 are only info messages, not warnings. Several other
shellcheck info messages remain. They are safe to ignore, but I didn't
want to disable them now.

Partially-fixes: https://github.com/tukaani-project/xz/issues/174

10 months agoScripts: Silence two shellcheck warnings
Lasse Collin [Sat, 3 May 2025 19:45:15 +0000 (22:45 +0300)] 
Scripts: Silence two shellcheck warnings

10 months agoTranslations: Add Swedish man page translations
Lasse Collin [Mon, 29 Sep 2025 14:29:23 +0000 (17:29 +0300)] 
Translations: Add Swedish man page translations

14 months agoCI: Add timeout-minutes
Lasse Collin [Fri, 23 May 2025 10:09:14 +0000 (13:09 +0300)] 
CI: Add timeout-minutes

Sometimes the VM workflows (like FreeBSD VM on Ubuntu) get stuck
and the default timeout is six hours. While at it, set a sensible
timeout for all workflows.

14 months agoliblzma: Fix grammar in API docs
Lasse Collin [Fri, 23 May 2025 09:25:36 +0000 (12:25 +0300)] 
liblzma: Fix grammar in API docs

Fixes: a27920002dbc ("liblzma: Add generic support for input seeking (LZMA_SEEK).")
14 months agoUpdate THANKS
Lasse Collin [Wed, 21 May 2025 13:07:01 +0000 (16:07 +0300)] 
Update THANKS

14 months agoCMake: With symbol versioning, try to pass --undefined-version to linker
Lasse Collin [Wed, 21 May 2025 13:07:01 +0000 (16:07 +0300)] 
CMake: With symbol versioning, try to pass --undefined-version to linker

Fixes: https://github.com/tukaani-project/xz/issues/180
Fixes: https://bugs.gentoo.org/956119
14 months agoBuild: With symbol versioning, try to pass --undefined-version to linker
Lasse Collin [Wed, 21 May 2025 13:07:01 +0000 (16:07 +0300)] 
Build: With symbol versioning, try to pass --undefined-version to linker

Fixes: https://github.com/tukaani-project/xz/issues/180
Fixes: https://bugs.gentoo.org/956119
14 months agoCMake: Fix comments
Lasse Collin [Wed, 21 May 2025 11:48:18 +0000 (14:48 +0300)] 
CMake: Fix comments

14 months agoTranslations: Update Serbian man page translations
Lasse Collin [Wed, 21 May 2025 10:14:04 +0000 (13:14 +0300)] 
Translations: Update Serbian man page translations

Compared to the file in the Translation Project, I still had to apply
a few fixes that were needed with the previous (5.7.1-dev1) version too:

  - Remove two extra '<' characters that break the build with po4a.

  - Don't translate XZ_DEFAULTS and XZ_OPT environment variable names.

14 months agoUpdate po/.gitignore
Lasse Collin [Wed, 21 May 2025 09:55:28 +0000 (12:55 +0300)] 
Update po/.gitignore

14 months agoTranslations: Update the Spanish translation
Lasse Collin [Wed, 21 May 2025 09:54:42 +0000 (12:54 +0300)] 
Translations: Update the Spanish translation

15 months agoTests: Silence a warning from GCC 15.1
Lasse Collin [Sat, 3 May 2025 09:37:28 +0000 (12:37 +0300)] 
Tests: Silence a warning from GCC 15.1

It was (probably) intentionally without the null terminator, but the test
works with null terminator too (the test still fails with xz <= 5.0.3),
so simply omit one character to silence the warning.

tests/test_bcj_exact_size.c:30:32: error: initializer-string for array of ‘unsigned char’ truncates NUL terminator but destination lacks ‘nonstring’ attribute (17 chars into 16 available) [-Werror=unterminated-string-initialization]
   30 |         const uint8_t in[16] = "0123456789ABCDEF";
      |                                ^~~~~~~~~~~~~~~~~~

Fixes: d8db706acb83 ("liblzma: Fix possibility of incorrect LZMA_BUF_ERROR.")
Fixes: https://github.com/tukaani-project/xz/issues/176
15 months agoUpdate THANKS
Lasse Collin [Mon, 28 Apr 2025 15:16:14 +0000 (18:16 +0300)] 
Update THANKS

15 months agoUpdate THANKS
Lasse Collin [Fri, 25 Apr 2025 14:32:03 +0000 (17:32 +0300)] 
Update THANKS

15 months agoxz, xzdec: Capsicum sandbox: Fix incorrect use of cap_rights_clear()
Guillaume Outters [Fri, 25 Apr 2025 00:55:08 +0000 (02:55 +0200)] 
xz, xzdec: Capsicum sandbox: Fix incorrect use of cap_rights_clear()

cap_rights_clear() with no additional arguments acts as a no-op, so
instead of removing all capability rights from STDIN_FILENO, the same
rights were allowed for STDIN_FILENO as were allowed for src_fd.

Fixes: a0eecc235d3b ("xz: Make Capsicum sandbox more strict with stdin and stdout.")
(The commit message says "stdout". It should have said "stderr".)

15 months agoCI: Valgrind: Improve the skipping of traced child processes
Lasse Collin [Tue, 22 Apr 2025 18:12:50 +0000 (21:12 +0300)] 
CI: Valgrind: Improve the skipping of traced child processes

Use --trace-children-skip instead of --trace-children-skip-by-arg
so that the skipping is only done based on the executable names.
(--trace-children-skip-by-arg can match other args than argv[0].)

Update the list of executables to skip to match what the scripts run.

Do not skip bash or sh. If Valgrind didn't trace the shell, then the
xz and xzdec programs run by the shell wouldn't be analyzed either.

Fixes: 7e99856f66c0 ("CI: Speed up Valgrind job by using --trace-children-skip-by-arg=...")
15 months agoCI: Valgrind: Test with static liblzma
Lasse Collin [Tue, 22 Apr 2025 18:12:50 +0000 (21:12 +0300)] 
CI: Valgrind: Test with static liblzma

If shared liblzma is built, tests/test_* and src/xz/xz are wrapper
scripts created by Libtool. The wrappers set library search path
so that the freshly-built shared library is found.

With a static liblzma, no wrapper scripts are needed, and Libtool
places the real executables to the aforementioned locations. This
speeds up the tests under Valgrind dramatically.

Fixes: 6c095a98fbec ("ci: test Valgrind")
15 months agoCI: Add Ubuntu on ARM64
Lasse Collin [Tue, 22 Apr 2025 18:12:50 +0000 (21:12 +0300)] 
CI: Add Ubuntu on ARM64

15 months agoDoxygen: Update the comment about tested versions
Lasse Collin [Tue, 22 Apr 2025 13:21:50 +0000 (16:21 +0300)] 
Doxygen: Update the comment about tested versions

15 months agoDoxygen: Set HAVE_DOT = NO
Lasse Collin [Tue, 22 Apr 2025 13:21:50 +0000 (16:21 +0300)] 
Doxygen: Set HAVE_DOT = NO

Debian and Ubuntu have a patch that changes the upstream default to
HAVE_DOT = YES. Undo it to have more consistent results across distros.

This was noticed in Ubuntu CI runner where "doxygen" tried to run "dot"
but that failed due to "dot" not being installed. "doxygen" still
finished with exit status 0 until the commit that turned warnings to
errors with WARN_AS_ERROR = FAIL_ON_WARNINGS.

15 months agoDoxygen: Treat warnings as errors
Lasse Collin [Tue, 22 Apr 2025 13:21:50 +0000 (16:21 +0300)] 
Doxygen: Treat warnings as errors

Also set WARN_IF_UNDOCUMENTED = NO because even the API headers have
a few things that won't have their own docs.

15 months agoDoxygen: Fix errors and some warnings in internal docs
Lasse Collin [Tue, 22 Apr 2025 13:21:50 +0000 (16:21 +0300)] 
Doxygen: Fix errors and some warnings in internal docs

15 months agoCI: Use --disable-sandbox instead of --enable-sandbox=no
Lasse Collin [Tue, 22 Apr 2025 13:21:50 +0000 (16:21 +0300)] 
CI: Use --disable-sandbox instead of --enable-sandbox=no

It's the same thing, just a style difference.

15 months agoCI: Support Doxygen in ci_build.bash
Lasse Collin [Tue, 22 Apr 2025 13:21:50 +0000 (16:21 +0300)] 
CI: Support Doxygen in ci_build.bash

15 months agoCI: Add Doxygen dependency to CMake builds on Ubuntu and macOS
Lasse Collin [Tue, 22 Apr 2025 13:21:50 +0000 (16:21 +0300)] 
CI: Add Doxygen dependency to CMake builds on Ubuntu and macOS

15 months agoCI: Support XZ_NLS=OFF with CMake
Lasse Collin [Tue, 22 Apr 2025 13:21:50 +0000 (16:21 +0300)] 
CI: Support XZ_NLS=OFF with CMake

15 months agoCI: Revise MSYS2
Lasse Collin [Tue, 22 Apr 2025 13:21:50 +0000 (16:21 +0300)] 
CI: Revise MSYS2

Re-enable CLANG64 environment. Add CLANGARM64. Don't add MINGW64
to slightly reduce the number of runner VMs needed.

Install the required packages using the setup-msys2 action instead
of running the commands separately.

Test Autotools and CMake in the same job to reduce the number of VMs.
This doesn't slow it down too much because the msys2-setup step is
needed by both. However, do only the full builds on ARM64 because
those runners seem to be slower.

Test fewer build configurations. The point of testing on MSYS2 is to
catch Windows-related issues. It should be enough that the more unusual
build configurations are tested in ci.yml.

Run the build commands directly instead of using ci_build.bash. This
makes it easier to see what commands are run even if it is a little
more verbose now.

Run the workflow automatically when commit are pushed to master.
With the fewer build variants it's not too slow.

15 months agoCI: Rename the MSYS2 workflow file
Lasse Collin [Tue, 22 Apr 2025 13:21:50 +0000 (16:21 +0300)] 
CI: Rename the MSYS2 workflow file

15 months agoCI: Enable assertions on NetBSD + CMake
Lasse Collin [Tue, 22 Apr 2025 13:21:50 +0000 (16:21 +0300)] 
CI: Enable assertions on NetBSD + CMake

15 months agoliblzma: Update lzma_lzip_decoder() docs about trailing data
Lasse Collin [Mon, 21 Apr 2025 09:23:37 +0000 (12:23 +0300)] 
liblzma: Update lzma_lzip_decoder() docs about trailing data

Don't say that the .lz format allows trailing data. According to the
lzip 1.25 manual, trailing data isn't part of the file format at all.
However, tools are still expected to behave as usefully as possible
when there is trailing data.

Fix the description of lzip >= 1.20 behavior when some of the first
bytes of trailing data match the magic bytes. While the lzip 1.25 manual
recommends that none of the first four bytes in trailing data should
match the magic bytes, the default behavior of lzip 1.25 treats
trailing data as a corrupt member header only if two or three bytes
match the magic bytes; one matching byte isn't enough.

Reported-by: Antonio Diaz Diaz
Link: https://www.mail-archive.com/xz-devel@tukaani.org/msg00702.html
15 months agoUpdate THANKS
Lasse Collin [Mon, 21 Apr 2025 08:21:08 +0000 (11:21 +0300)] 
Update THANKS

15 months agoCI: Add DragonflyBSD
Lasse Collin [Thu, 17 Apr 2025 17:36:33 +0000 (20:36 +0300)] 
CI: Add DragonflyBSD

15 months agoCI: Update Solaris
Lasse Collin [Thu, 17 Apr 2025 17:36:33 +0000 (20:36 +0300)] 
CI: Update Solaris

15 months agoCI: Update OpenBSD
Lasse Collin [Thu, 17 Apr 2025 17:36:33 +0000 (20:36 +0300)] 
CI: Update OpenBSD

Use --disable-nls --enable-external-sha256 because those are used
in the xz Makefile in the OpenBSD ports tree.

15 months agoCI: Update NetBSD
Lasse Collin [Thu, 17 Apr 2025 17:36:33 +0000 (20:36 +0300)] 
CI: Update NetBSD

For variety, use CMake and Ninja.

15 months agoCI: Update FreeBSD
Lasse Collin [Thu, 17 Apr 2025 17:36:33 +0000 (20:36 +0300)] 
CI: Update FreeBSD

ARM64 was left commented out because it's slow under both
ubuntu-latest (x86-64) and ubuntu-24.04-arm (aarch64) hosts.

15 months agoCI: Specify only the main version of the standard GH actions
Lasse Collin [Fri, 11 Apr 2025 14:25:53 +0000 (17:25 +0300)] 
CI: Specify only the main version of the standard GH actions

15 months agoCI: Add 'permissions' to ci.yml and msvc.yml
Lasse Collin [Fri, 11 Apr 2025 14:15:08 +0000 (17:15 +0300)] 
CI: Add 'permissions' to ci.yml and msvc.yml

15 months agoCI: Add CIFuzz
Sam James [Thu, 10 Apr 2025 20:15:31 +0000 (23:15 +0300)] 
CI: Add CIFuzz

xz is already part of OSS-Fuzz, but OSS-Fuzz provides & encourages [0]
its 'CIFuzz' service to test individual commits.

[0] https://google.github.io/oss-fuzz/getting-started/continuous-integration/

Co-authored-by: Lasse Collin <lasse.collin@tukaani.org>
15 months agoCMake: Don't check for optreset if using replacement getopt_long
Lasse Collin [Sat, 12 Apr 2025 12:31:01 +0000 (15:31 +0300)] 
CMake: Don't check for optreset if using replacement getopt_long

If <getopt.h> had optreset but not getopt_long, xz used optreset while
the replacement getopt_long doesn't support optreset. I'm not aware of
any relevant system where bug is possible. Autotools build didn't have
this bug.

Fixes: af66cd585902 ("CMake: Add support for replacement getopt_long (lib/getopt*).")
15 months agoUpdate THANKS
Lasse Collin [Thu, 17 Apr 2025 15:33:10 +0000 (18:33 +0300)] 
Update THANKS

15 months agoliblzma: Update the lzma_lzip_decoder() docs about sync flush marker
Lasse Collin [Thu, 17 Apr 2025 15:30:26 +0000 (18:30 +0300)] 
liblzma: Update the lzma_lzip_decoder() docs about sync flush marker

15 months agoxz: Don't mention lzip's sync flush marker on the man page
Lasse Collin [Thu, 17 Apr 2025 15:16:40 +0000 (18:16 +0300)] 
xz: Don't mention lzip's sync flush marker on the man page

The sync flush marker isn't valid in .lz files. The sync flush marker
may be used by lzlib, but the resulting streams are only meant to be
decoded by lzlib itself. lzlib's docs make this clear.

Reported-by: Antonio Diaz Diaz
Link: https://www.mail-archive.com/xz-devel@tukaani.org/msg00700.html
Link: https://www.mail-archive.com/xz-devel@tukaani.org/msg00701.html
15 months agoUpdate THANKS
Lasse Collin [Thu, 17 Apr 2025 15:15:48 +0000 (18:15 +0300)] 
Update THANKS

15 months agoCI: MSVC: Use fewer runners for the same number of tests
Lasse Collin [Thu, 10 Apr 2025 17:13:07 +0000 (20:13 +0300)] 
CI: MSVC: Use fewer runners for the same number of tests

Using eight runners seems wasteful. Using only two runners isn't
much slower due to the runner startup overhead.

Also add a comment about the test that fails without b5a5d9e3f702.

15 months agoUpdate THANKS
Lasse Collin [Thu, 10 Apr 2025 17:10:31 +0000 (20:10 +0300)] 
Update THANKS

15 months agoliblzma: Disable CLMUL CRC on old MSVC targeting 32-bit x86
Lasse Collin [Mon, 7 Apr 2025 19:36:58 +0000 (22:36 +0300)] 
liblzma: Disable CLMUL CRC on old MSVC targeting 32-bit x86

On GitHub runners, VS 2019 16.11 (MSVC 19.29.30158) results in
test failures. VS 2022 17.13 (MSVC 19.43.34808) works.

In xz 5.6.x there was a #pragma-based workaround for MSVC builds for
32-bit x86. Another method was thought to work with the new rewritten
CLMUL CRC. Apparently it doesn't. Keep it simple and disable CLMUL CRC
with any non-recent MSVC when building for 32-bit x86.

Fixes: 54eaea5ea49b ("liblzma: x86 CLMUL CRC: Rewrite")
Fixes: https://github.com/tukaani-project/xz/issues/171
Reported-by: Andrew Murray