libarchive (with liblzma and libzstd)
| libarchive | liblzma (XZ Utils) | libzstd (Zstandard) | |
|---|---|---|---|
| Version | 3.8.11 | 5.8.4 | 1.5.7 |
| Source | https://github.com/libarchive/libarchive/releases/download/v3.8.11/libarchive-3.8.11.tar.xz | https://github.com/tukaani-project/xz/releases/download/v5.8.4/xz-5.8.4.tar.xz | https://github.com/facebook/zstd/releases/download/v1.5.7/zstd-1.5.7.tar.gz |
| SHA-256 of the archive | a3dc0872b1b39da34dc18ef1b944f0f11ffd37425d70ae04be679279f1cf43d2 |
4ce24038fd4221e0d13bc1a2de7a4db56e90b92b3bf75321f6c14be73f65de4b |
eb33e51f49a15e023950cd7825ca74a4a2b43db8354825ac24fc1b7ee09e6fa3 |
| Project | https://www.libarchive.org | https://tukaani.org/xz/ | https://facebook.github.io/zstd/ |
| License | BSD 2-Clause (a few files: BSD 3-Clause UC Regents, public domain, CC0 / Apache-2.0 for the BLAKE2 reference code) | BSD Zero Clause (0BSD) — liblzma only | BSD 3-Clause (the project is dual BSD / GPLv2; ORIX Convert uses it under BSD) |
The three SHA-256 values were compared, on 2026-11-21, with the digests GitHub publishes for the release assets
(libarchive-3.8.11.tar.xz, xz-5.8.4.tar.xz) and with the .sha256 file published next to zstd-1.5.7.tar.gz:
they match. build.sh refuses any other content.
xz backdoor (CVE-2024-3094). The backdoor was in the release tarballs of xz 5.6.0 and 5.6.1 only. 5.8.4 is a
later release of the cleaned code line, published by the current maintainer; build.sh refuses to build 5.6.0 or
5.6.1 whatever checksum is given. The backdoor lived in the Autotools build scripts of the tarball: this build uses
the CMake project instead, builds liblzma only (no xz tools, no scripts, no translations) and links it statically.
Why it is bundled
The archive engine needs readers and writers for ZIP, 7z, TAR (with gzip, bzip2, xz and zstd), single compressed
streams, and a reader for RAR. macOS has /usr/lib/libarchive.2.dylib but ships no public headers for it in the SDK
and no zstd support of its own (the system bsdtar shells out to a zstd program): it cannot be used.
How it is built and linked
build.sh downloads the three archives, checks their SHA-256, and builds with CMake for arm64 / macOS 15.0
(Release, static, position-independent):
- liblzma: library only (
XZ_TOOL_*=OFF, no NLS, no docs), POSIX threads. - libzstd: library only, multithreaded compression on, legacy formats off.
- libarchive:
ENABLE_OPENSSL / NETTLE / MBEDTLS / LIBB2 / LZ4 / LZO / LIBXML2 / EXPAT / PCRE / ACL = OFF, nobsdtar/bsdcpio/bsdcat/bsdunzip, tests off. zlib, bzip2 and iconv are the macOS SDK's (libz,libbz2,libiconv, linked dynamically, as every macOS program does). Digests, AES and PBKDF2 come from CommonCrypto (libSystem): there is no OpenSSL or Nettle dependency. The script checks the generatedconfig.hand stops if any of the excluded libraries was picked up (Homebrew prefixes are ignored by the build).
External-program filters are physically removed. libarchive can pipe data through helper programs
(archive_read_support_filter_program, archive_write_add_filter_program, and the automatic fallbacks to lz4,
lzop, grzip, lrzip… when their library is absent). After the build, the script deletes the three objects that
implement this (filter_fork_posix, archive_read_support_filter_program, archive_write_add_filter_program) from
the static library and verifies they are gone. The engine never calls the "support everything" functions, and if a
later change did, the application would fail to link rather than gain the ability to launch a program.
The three libraries are merged into libCArchive.a with libtool -static and wrapped, with archive.h and
archive_entry.h, into CArchive.xcframework, consumed by Packages/EngineArchive/Package.swift as a SwiftPM
binaryTarget (module CArchive). Everything is statically linked into the application; nothing is loaded at run
time and nothing is looked up on the user's Mac.
Build-time tools: cmake (Homebrew, already present on the build machine), make, ar, libtool, xcodebuild.
Size of the product: libCArchive.a 2 190 824 bytes, CArchive.xcframework 2.2 MB.
The sources are not modified. src/, work/, prefix/ and CArchive.xcframework/ are build products and are not
committed.
What this build can and cannot do (measured by the engine's tests, see docs/compatibility/engines/archive.md)
- ZIP encryption: reading and writing ZipCrypto and WinZip AES (AES-256 written) through CommonCrypto.
- 7z: no encryption support in libarchive (reading or writing). RAR: reading only, no decryption.
- The gzip reader does not check the CRC-32 / length trailer (a
TODOinarchive_read_support_filter_gzip.c), and the RAR readers do not check the CRC of files stored without compression. The engine performs both checks itself.
Obligations
- libarchive (BSD 2-Clause and the notices listed in its
COPYING): the copyright notice, conditions and disclaimer must be reproduced in the documentation or other materials provided with the binary distribution. - Zstandard (BSD 3-Clause): same, and the name of Meta / Facebook or of contributors must not be used to endorse the product.
- liblzma (0BSD): no condition; credited here.
The application's acknowledgements must include the two texts below.
libarchive
Copyright (c) 2003-2018 <author(s)>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer
in this position and unchanged.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.Parts of libarchive carry additional notices (3-clause UC Regents in archive_read_support_filter_compress.c and
archive_write_add_filter_compress.c; public domain archive_parse_date.c; BLAKE2 reference code under CC0 1.0 /
OpenSSL / Apache 2.0, used here under CC0). See src/libarchive/COPYING after running build.sh.
Zstandard
BSD License
For Zstandard software
Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name Facebook, nor Meta, nor the names of its contributors may
be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.liblzma
Permission to use, copy, modify, and/or distribute this
software for any purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.