387 Commits
Author SHA1 Message Date
Dustin L. Howett 942984fd7d Merge commit '25ef914386252adbf67d07d6c5bf018dfcbe34a9' as 'build/la-lint' 2026-07-04 14:42:27 -05:00
Tobias Stoeckmann 37b0b5a502 unzip: Add Windows port
Copy missing functionality from libarchive and cpio.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2026-06-24 18:02:15 +02:00
Martin Matuška fc0530d502 Merge pull request #3150 from DHowett/ci/windows-package-dependencies
build: windows: get all CI dependencies from a package manager
2026-06-17 09:29:46 +02:00
Dustin L. Howett 374f901a4d build: use vcpkg for Windows-MSVC's dependencies 2026-06-15 15:27:37 -05:00
Dustin L. Howett 3087dc0cc8 build: move library dependencies into mingw install 2026-06-15 15:27:37 -05:00
Dustin L. Howett 18a8a6d1fc build: use the setup-msys2 action rather than chocolatey
This will give us some ability in the future to vary `MSYSTEM` and
produce different MSYS builds.
2026-06-15 15:27:37 -05:00
Tobias Stoeckmann 16be338523 Add archive_integer.h
The archive_integer.h header offers various integer operations to
libarchive, utilizing system functionality where possible.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2026-06-12 23:32:36 +02:00
Martin Matuška 93065aac92 Merge pull request #2837 from mmatuska/ci-firecracker
CI: add FreeBSD 15 build via firecracker VM to GitHub Actions
2026-06-02 15:03:35 +02:00
Dustin L. Howett ffeb1395ce ci: add support for cygwin-gcc to the github CI script 2026-06-01 05:37:43 -05:00
Martin Matuska f1c6aa7b07 CI: add FreeBSD-15-amd64 build via firecracker 2026-06-01 10:37:21 +02:00
Martin Matuška ebfa344055 Merge pull request #3089 from mostynb/remove_cirrus_ci
Remove Cirrus CI setup, it is shutting down in a few days
2026-06-01 09:58:42 +02:00
Michalis Vasileiadis 2f3bb0f291 build: fetch config.guess/config.sub over HTTPS in release Dockerfile
Switch the config.guess/config.sub ADD fetches from http:// to https://
(CWE-494).
2026-05-29 21:30:38 +08:00
Michalis Vasileiadis c38b2decf8 build: fetch config.guess/config.sub over HTTPS in makerelease.sh
Switch the release-time config.guess/config.sub fetches from http:// to
https:// and add -fsSL so a failed fetch errors out instead of writing an
error page into the helper script (CWE-494).
2026-05-29 21:30:34 +08:00
Mostyn Bramley-Moore b437415f73 Remove Cirrus CI setup, it is shutting down in a few days
https://circleci.com/blog/cirrus-ci-alternative/
> On April 7, the Cirrus Labs team announced they are joining OpenAI.
> As a result, Cirrus CI will stop running jobs on June 1, 2026.
2026-05-29 00:49:16 +02:00
i1011 dd08dc9751 CI: Add missing exit on error in windows CI 2026-05-28 01:32:04 +08:00
Tim Kientzle 2f5ed45e4c [CMake] Automatically update list.h
`list.h` contains a list of all the tests and is generated
by grepping the test source files for `DEFINE_TEST`.
Previously, it was generated at configure time.
This meant that if you added a new test to an existing
source file, you had to manually reconfigure.

This adds the necessary dependencies so that `list.h`
is regenerated whenever any C test source changes.
This ensures that new tests are always discovered automatically.

Note:  If someone wants to update the autoconf-based
build system to do this, please send a PR.
2026-05-05 20:54:12 -07:00
Tobias Stoeckmann d99f5ebadf Add missing HAVE_STDIO_H cmake check
The check is performed by configure, but not with cmake. The
bsdunzip/la_getline.c file checks for presence of this definition.
2026-03-16 09:42:19 +01:00
Dag-Erling Smørgrav 8ee661c8e7 Unbreak CMake build 2026-03-02 18:19:07 +01:00
Martin Matuska 0a594ab77d CI: use gmake in Cirrus FreeBSD build 2025-11-28 22:31:25 +01:00
Martin Matuska ff3a0c37aa CI: add workaround for cmake installed from local/pinned tab on GH/MacOS 2025-09-10 10:50:46 +02:00
Tim Kientzle ab4d21e4cb Merge pull request #2707 from fdegros/close_range_support
Avoid leaking file descriptors into subprocesses
2025-08-20 11:18:45 -07:00
Dag-Erling Smørgrav a335429c5e Drop support for readdir_r()
There has never been a good reason to prefer it over readdir(), and it
has now been marked obsolete in POSIX-1.2024.
2025-08-01 17:07:17 +02:00
François Degros 64bcf69ef8 Use closefrom() or close_range() when possible
To avoid leaking file descriptors into subprocesses.

Fixes: https://github.com/libarchive/libarchive/issues/2520
2025-07-31 15:03:22 +10:00
Tim Kientzle 992734d6cc Merge pull request #2509 from tesap/install-lib-dir
Make installation lib dir depend on CMAKE_INSTALL_LIBDIR variable
2025-05-23 19:57:14 -07:00
Martin Matuska 182726d16a Libarchive 3.9.0dev 2025-05-20 10:29:10 +02:00
Mostyn Bramley-Moore d80d734190 Add some more error checking to shell scripts (#2617)
Exit immediately if a command exits with a non-zero status, and treat
unset variables as an error when substituting.
2025-05-20 10:14:17 +02:00
Mostyn Bramley-Moore fe41cec3da Remove long-unused travis CI script (#2615)
Support for travis CI was removed in 2019, this script hasn't been used
since.
2025-05-18 18:55:32 +02:00
Dustin L. Howett 16fd043f51 xar: add xmllite support to the XAR reader and writer (#2388)
This commit adds support for reading and writing XAR archives on Windows
using the built-in xmllite library. xmllite is present in all versions
of Windows starting with Windows XP.

With this change, no external XML library (libxml2, expat) is required
to read or produce XAR archives on Windows.

xmllite is a little bit annoying in that it's entirely a COM API--the
likes of which are annoying to use from C.

Signed-off-by: Dustin L. Howett <dustin@howett.net>
Depends on e619342dfa
Closes #1811
2025-05-09 13:40:21 +02:00
Graham Percival 992a596290 Fix missing newline at EOF (#2577) 2025-04-11 20:10:04 -07:00
Lukas Javorsky 95c386317f Remove unnecessary sharutils dependency (#2571)
Resolves issue: #2570
2025-04-08 20:23:27 -07:00
Peter Kokot 2c2266432f CMake: Replace CMAKE_COMPILER_IS_GNUCC with CMAKE_C_COMPILER_ID (#2550)
Hello,

- The `CMAKE_COMPILER_IS_*` variables are deprecated and
`CMAKE_C_COMPILER_ID` can be used in this case instead.
- The legacy `endif()` command argument also simplified to avoid
repeating the condition.
2025-03-22 14:21:38 -07:00
ljdarj 52e0bfd750 archive_version_details' update (#2349)
Adding missing librairies to `archive_version_details()`'s output. I put
"system" if the library doesn't give a way to query its version and
"bundled" if there's a choice between the system copy of a library and a
bundled one and we took the bundled copy (Only one library in that case,
libb2. Maybe also xxhash in the future?).

I would have a question for the Windows specialists though: is there a
way to query the interface version of a CNG cryptographic provider?
Because I know of a way for Crypto API providers but I haven't found any
for CNG ones, despite `<bcrypt.h>` having an interface version
structure.

Fixes #2300.
2025-03-07 19:28:51 -08:00
Stepan Tsepa 447201758e Make installation lib dir depend on CMAKE_INSTALL_LIBDIR variable 2025-02-14 11:34:56 +03:00
Mostyn Bramley-Moore 819a50a043 Remove liblzmadec remnants (#2436)
It looks like support for this library was removed in 2016, but we still
had some unused cmake code and a dead preprocessor block.
2024-12-15 23:14:57 +01:00
Mostyn Bramley-Moore ba76798136 ci: speed up windows/mingw build by using multiple make jobs (#2428)
This decreases the "Install library dependencies" step duration from
~4min to ~2min, and the "Build" step duration from ~10min to ~4min.
2024-12-07 16:39:46 -08:00
Mostyn Bramley-Moore 29802f6a5e ci: make autoconf look for headers and libraries in /opt/homebrew if those directories exist (#2427)
Prior to this change, the ci autoconf jobs weren't looking for homebrew
headers or libraries unless pkg-config was used, so for example the
"MacOS (autotools)" ci job wasn't testing lz4 or zstd code.

Relates to #2426.
2024-12-07 15:11:19 -08:00
Mostyn Bramley-Moore 0bbbe2883e ci: log bsdtar's version text, so we can see which support libraries were used (#2426)
A few of libarchive's CI jobs don't find all the local support libraries
that they could be using. This change makes it easier to see which of
them are used.
2024-12-07 15:10:42 -08:00
Mostyn Bramley-Moore 9b7540aaf1 ci: find liblzma >= 5.6.3 on windows msvc tests (#2421)
We currently use XZ Utils 5.6.3 on windows CI jobs, but the Windows
(msvc)
job which uses cmake seems to only be looking for the old library name,
liblzma.lib:

```
-- Looking for lzma_auto_decoder in C:/Program Files (x86)/xz/lib/liblzma.lib
-- Looking for lzma_auto_decoder in C:/Program Files (x86)/xz/lib/liblzma.lib - not found
-- Looking for lzma_easy_encoder in C:/Program Files (x86)/xz/lib/liblzma.lib
-- Looking for lzma_easy_encoder in C:/Program Files (x86)/xz/lib/liblzma.lib - not found
-- Looking for lzma_lzma_preset in C:/Program Files (x86)/xz/lib/liblzma.lib
-- Looking for lzma_lzma_preset in C:/Program Files (x86)/xz/lib/liblzma.lib - not found
-- Could NOT find LibLZMA (missing: LIBLZMA_HAS_AUTO_DECODER LIBLZMA_HAS_EASY_ENCODER LIBLZMA_HAS_LZMA_PRESET) (found version "5.6.3")
```

We need to update build/ci/github_actions/ci.cmd to look for lzma.lib
instead.
2024-12-06 19:56:06 -08:00
Julian Uy 819c5b01a9 Check for tcgetattr / tcsetattr before using it for readpassphrase implementation (#2424)
This is mainly for non-cygwin newlib platforms that don't have tcgetattr
/ tcsetattr implemented
2024-12-06 07:58:58 -08:00
Mostyn Bramley-Moore 84ad874530 Test with XZ Utils 5.6.3 on windows CI jobs (#2417)
This change fixes the autotools build to work with xz-utils 5.6.3, which
changed library names on windows, and fixes a couple of tests that I
noticed had dependencies on liblzma.
2024-12-02 00:29:46 +01:00
Mostyn Bramley-Moore ae23713ceb 7zip writer: initial support for zstandard compression (#2137)
This is intended to be compatible with:
* https://github.com/mcmilk/7-Zip-zstd
* https://github.com/tehmul/p7zip-zstd
2024-10-22 11:01:55 +02:00
Mostyn Bramley-Moore 6567375f27 Reenable CI tests for MSVC (#2356)
These were disabled when migrating from Cirrus CI. Let's enable them for
github workflows, disable any failing tests on this configuration and
leave TODO notes to fix them.

This was the only failure that I found:
```
  684/764 Test #684: bsdtar_test_option_ignore_zeros_mode_c ...................................***Failed    0.10 sec
  
  If tests fail or crash, details will be in:
     C:\Users\RUNNER~1\AppData\Local\Temp/bsdtar_test.exe.2024-09-29T11.42.13-000
  
  Reference files will be read from: D:/a/libarchive/libarchive/tar/test
  Running tests on: "D:\a\libarchive\libarchive\build_ci\cmake\bin\Release\bsdtar.exe"
  Exercising: bsdtar 3.8.0 - libarchive 3.8.0dev zlib/1.3 liblzma/5.4.4 bz2lib/1.1.0 libzstd/1.5.5 
  
   39: test_option_ignore_zeros_mode_c
  D:\a\libarchive\libarchive\tar\test\test_option_ignore_zeros.c(99): File should be empty: test-c.err
      File size: 112
      Contents:
  0000 62 73 64 74 61 72 2e 65 78 65 3a 20 61 3a 20 43 bsdtar.exe: a: C
  0010 61 6e 27 74 20 74 72 61 6e 73 6c 61 74 65 20 75 an't translate u
  0020 6e 61 6d 65 20 27 28 6e 75 6c 6c 29 27 20 74 6f name '(null)' to
  0030 20 55 54 46 2d 38 0d 0a 62 73 64 74 61 72 2e 65  UTF-8..bsdtar.e
  0040 78 65 3a 20 62 3a 20 43 61 6e 27 74 20 74 72 61 xe: b: Can't tra
  0050 6e 73 6c 61 74 65 20 75 6e 61 6d 65 20 27 28 6e nslate uname '(n
  0060 75 6c 6c 29 27 20 74 6f 20 55 54 46 2d 38 0d 0a ull)' to UTF-8..
  
  Totals:
    Tests run:                1
    Tests failed:             1
    Assertions checked:      21
    Assertions failed:        1
    Skips reported:           0
```
2024-09-29 21:36:48 -07:00
Martin Matuska 915c9f83a4 Libarchive 3.8.0dev 2024-09-13 23:13:01 +02:00
Tim Kientzle 97c32b89b8 Try to fix some CI config issues on macOS (#2261)
macOS CI is reporting some warnings about unavailable versions of some
utilities. I'll take a stab at fixing those...
2024-07-06 09:46:21 +02:00
Sevan Janiyan 3f3b3efec2 Always use our supplied la_queue.h (#2222)
On legacy systems the OS supplied `sys/queue.h` may lack the required
macros, so to avoid having to verify if the version of queue.h is of
use, opt to always to `la_queue.h` which will match expectations.

Allows libarchive to build on legacy Darwin where `STAILQ_FOREACH` would
be missing from `sys/queue.h`.

Resolves #2220
2024-06-10 20:42:13 -07:00
Martin Matuska 9951b9cd25 Libarchive 3.7.5dev 2024-04-26 12:07:47 +02:00
Dag-Erling SmørgravandMartin Matuska 3efcadf886 zstd: Implement core detection (#2083)
The bsdtar manual page claims that setting zstd:threads to 0 tells zstd
to use as many threads as there are cores in the system, but it actually
disables multi-threading.  Replace 0 with the number of configured
processors.

While here, add a previously missing overflow check.

Co-authored-by: Martin Matuska <martin@matuska.de>
2024-04-23 15:11:40 +02:00
Martin Matuska a69a4537a6 CI: add libxml2 to MacOS test build 2024-04-23 11:51:53 +02:00
Martin Matuska b3be94ba4f Libarchive 3.7.4dev 2024-04-08 12:17:17 +02:00
Tim Kientzle 771f434c90 build: use standard HAVE_ pattern for ZSTD compression check (#2111)
Follow-on to #1649: this just changes the name of the preprocessor macro
to use the standard pattern HAVE_<function name>

In particular: newer ZSTD implementations have a growing variety of
compression functions; the standard pattern will make it easier to
select among those someday.
2024-04-07 23:45:21 +02:00