Skip to content

Commit 9cc52e3

Browse files
committed
Merge commit 'b439d586f53911c84be5e380445a8a259e19114c'
Upgrade to version v3.7.7
2 parents 6ae31ba + b439d58 commit 9cc52e3

File tree

361 files changed

+5245
-5328
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

361 files changed

+5245
-5328
lines changed

.cirrus.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ FreeBSD_task:
1010
BS: cmake
1111
matrix:
1212
freebsd_instance:
13-
image_family: freebsd-14-0
13+
image_family: freebsd-14-1
1414
freebsd_instance:
15-
image_family: freebsd-13-3
15+
image_family: freebsd-13-4
1616
prepare_script:
1717
- ./build/ci/cirrus_ci/ci.sh prepare
1818
configure_script:

.github/workflows/ci.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ permissions:
77

88
jobs:
99
MacOS:
10-
runs-on: macos-13
10+
runs-on: macos-15
1111
strategy:
1212
matrix:
1313
bs: [autotools, cmake]
1414
steps:
15-
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
15+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
1616
- name: Install dependencies
1717
run: ./build/ci/github_actions/macos.sh prepare
1818
- name: Autogen
@@ -45,19 +45,19 @@ jobs:
4545
run: ./build/ci/build.sh -a artifact
4646
env:
4747
BS: ${{ matrix.bs }}
48-
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
48+
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
4949
with:
5050
name: libarchive-macos-${{ matrix.bs }}-${{ github.sha }}
5151
path: libarchive.tar.xz
5252

5353
Ubuntu:
54-
runs-on: ubuntu-22.04
54+
runs-on: ubuntu-24.04
5555
strategy:
5656
matrix:
5757
bs: [autotools, cmake]
5858
crypto: [mbedtls, nettle, openssl]
5959
steps:
60-
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
60+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
6161
- name: Update apt cache
6262
run: sudo apt-get update
6363
- name: Install dependencies
@@ -91,14 +91,14 @@ jobs:
9191
run: ./build/ci/build.sh -a artifact
9292
env:
9393
BS: ${{ matrix.bs }}
94-
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
94+
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
9595
with:
9696
name: libarchive-ubuntu-${{ matrix.bs }}-${{ matrix.crypto }}-${{ github.sha }}
9797
path: libarchive.tar.xz
9898
Ubuntu-distcheck:
99-
runs-on: ubuntu-22.04
99+
runs-on: ubuntu-24.04
100100
steps:
101-
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
101+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
102102
- name: Update package definitions
103103
run: sudo apt-get update
104104
- name: Install dependencies
@@ -113,7 +113,7 @@ jobs:
113113
SKIP_OPEN_FD_ERR_TEST: 1
114114
- name: Dist-Artifact
115115
run: ./build/ci/build.sh -a dist-artifact
116-
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
116+
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
117117
with:
118118
name: libarchive-${{ github.sha }}
119119
path: libarchive-dist.tar
@@ -125,7 +125,7 @@ jobs:
125125
matrix:
126126
be: [mingw-gcc, msvc]
127127
steps:
128-
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
128+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
129129
- name: Install mingw
130130
if: ${{ matrix.be=='mingw-gcc' }}
131131
run: choco install mingw
@@ -161,7 +161,7 @@ jobs:
161161
shell: cmd
162162
env:
163163
BE: ${{ matrix.be }}
164-
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
164+
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
165165
with:
166166
name: libarchive-windows-${{ matrix.be }}-${{ github.sha }}
167167
path: libarchive.zip

.github/workflows/cifuzz.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
fuzz-seconds: 600
2222
dry-run: false
2323
- name: Upload Crash
24-
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
24+
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
2525
if: failure() && steps.build.outcome == 'success'
2626
with:
2727
name: artifacts

.github/workflows/codeql.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ jobs:
2626

2727
steps:
2828
- name: Checkout
29-
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
29+
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
3030

3131
- name: Initialize CodeQL
32-
uses: github/codeql-action/init@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
32+
uses: github/codeql-action/init@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
3333
with:
3434
languages: ${{ matrix.language }}
3535
queries: +security-and-quality
3636

3737
- name: Autobuild
38-
uses: github/codeql-action/autobuild@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
38+
uses: github/codeql-action/autobuild@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
3939

4040
- name: Perform CodeQL Analysis
41-
uses: github/codeql-action/analyze@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
41+
uses: github/codeql-action/analyze@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
4242
with:
4343
category: "/language:${{ matrix.language }}"

.github/workflows/scorecard.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ jobs:
2929

3030
steps:
3131
- name: "Checkout code"
32-
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
32+
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
3333
with:
3434
persist-credentials: false
3535

3636
- name: "Run analysis"
37-
uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3
37+
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
3838
with:
3939
results_file: results.sarif
4040
results_format: sarif
@@ -52,14 +52,14 @@ jobs:
5252
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
5353
# format to the repository Actions tab.
5454
- name: "Upload artifact"
55-
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
55+
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
5656
with:
5757
name: SARIF file
5858
path: results.sarif
5959
retention-days: 5
6060

6161
# Upload the results to GitHub's code scanning dashboard.
6262
- name: "Upload to code-scanning"
63-
uses: github/codeql-action/upload-sarif@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
63+
uses: github/codeql-action/upload-sarif@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
6464
with:
6565
sarif_file: results.sarif

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ CMakeCache.txt
6363
CMakeFiles/
6464
DartConfiguration.tcl
6565
cmake.tmp/
66+
cmake-*/
6667
.vs/
6768
.vscode/
69+
.idea/
6870

6971
doc/html/*.html
7072
doc/man/*.1

CMakeLists.txt

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#
22
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12 FATAL_ERROR)
3+
if(APPLE AND CMAKE_VERSION VERSION_LESS "3.17.0")
4+
message(WARNING "CMake>=3.17.0 required to make the generated shared library have the same Mach-O headers as autotools")
5+
endif()
6+
37
if(POLICY CMP0065)
48
cmake_policy(SET CMP0065 NEW) #3.4 don't use `-rdynamic` with executables
59
endif()
@@ -25,7 +29,7 @@ endif()
2529
# MinSizeRel : Release Min Size build
2630
# None : No build type
2731
IF(NOT CMAKE_BUILD_TYPE)
28-
SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Type" FORCE)
32+
SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build Type" FORCE)
2933
ENDIF(NOT CMAKE_BUILD_TYPE)
3034
# Set a value type to properly display CMAKE_BUILD_TYPE on GUI if the
3135
# value type is "UNINITIALIZED".
@@ -83,9 +87,21 @@ SET(LIBARCHIVE_VERSION_STRING "${VERSION}")
8387
# libarchive 3.1 == interface version 13
8488
math(EXPR INTERFACE_VERSION "13 + ${_minor}")
8589

86-
# Set SOVERSION == Interface version
87-
# ?? Should there be more here ??
88-
SET(SOVERSION "${INTERFACE_VERSION}")
90+
# Set SOVERSION so it matches libtool's conventions
91+
# libtool accepts a string "current:revision:age"; in libarchive, that's set to
92+
# - current: ${INTERFACE_VERSION} = 13 + ${_minor}
93+
# - revision: ${_revision}
94+
# - age: ${_minor}
95+
# Since libtool computes SOVERSION as "current - age", it's just '13' again
96+
math(EXPR SOVERSION "${INTERFACE_VERSION} - ${_minor}")
97+
set(SOVERSION_FULL "${SOVERSION}.${_trimmed_minor}.${_trimmed_revision}")
98+
99+
# Override CMake's default shared library versioning scheme, which uses SOVERSION and VERSION,
100+
# to match libtool's conventions (see https://github.com/mesonbuild/meson/issues/1451)
101+
# - compatibility version: current + 1 = ${INTERFACE_VERSION} + 1
102+
# - current version: ${current + 1}.${revision}
103+
math(EXPR MACHO_COMPATIBILITY_VERSION "${INTERFACE_VERSION} + 1")
104+
set(MACHO_CURRENT_VERSION "${MACHO_COMPATIBILITY_VERSION}.${_revision}")
89105

90106
# Enable CMAKE_PUSH_CHECK_STATE() and CMAKE_POP_CHECK_STATE() macros
91107
# saving and restoring the state of the variables.
@@ -107,7 +123,7 @@ endif ()
107123
# aggressive about diagnosing build problems; this can get
108124
# relaxed somewhat in final shipping versions.
109125
IF (CMAKE_C_COMPILER_ID MATCHES "^GNU$" OR
110-
CMAKE_C_COMPILER_ID MATCHES "^Clang$")
126+
CMAKE_C_COMPILER_ID MATCHES "^Clang$" AND NOT MSVC)
111127
SET(CMAKE_REQUIRED_FLAGS "-Wall -Wformat -Wformat-security")
112128
#################################################################
113129
# Set compile flags for all build types.
@@ -144,7 +160,7 @@ IF (CMAKE_C_COMPILER_ID MATCHES "^GNU$" OR
144160
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-dead_strip")
145161
ENDIF(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
146162
ENDIF (CMAKE_C_COMPILER_ID MATCHES "^GNU$" OR
147-
CMAKE_C_COMPILER_ID MATCHES "^Clang$")
163+
CMAKE_C_COMPILER_ID MATCHES "^Clang$" AND NOT MSVC)
148164
IF (CMAKE_C_COMPILER_ID MATCHES "^XL$")
149165
SET(CMAKE_C_COMPILER "xlc_r")
150166
SET(CMAKE_REQUIRED_FLAGS "-qflag=e:e -qformat=sec")
@@ -443,7 +459,10 @@ SET(ADDITIONAL_LIBS "")
443459
# Find ZLIB
444460
#
445461
IF(ENABLE_ZLIB)
446-
FIND_PACKAGE(ZLIB)
462+
# Require zlib >= 1.2.1, see: https://github.com/libarchive/libarchive/issues/615
463+
# zlib 1.2.0 should also work, but it is difficult to test for. Let's require
464+
# zlib >= 1.2.1 for consistency with the autoconf build.
465+
FIND_PACKAGE(ZLIB 1.2.1)
447466
ELSE()
448467
SET(ZLIB_FOUND FALSE) # Override cached value
449468
ENDIF()
@@ -743,7 +762,6 @@ LA_CHECK_INCLUDE_FILE("sys/mkdev.h" HAVE_SYS_MKDEV_H)
743762
LA_CHECK_INCLUDE_FILE("sys/mount.h" HAVE_SYS_MOUNT_H)
744763
LA_CHECK_INCLUDE_FILE("sys/param.h" HAVE_SYS_PARAM_H)
745764
LA_CHECK_INCLUDE_FILE("sys/poll.h" HAVE_SYS_POLL_H)
746-
LA_CHECK_INCLUDE_FILE("sys/queue.h" HAVE_SYS_QUEUE_H)
747765
LA_CHECK_INCLUDE_FILE("sys/richacl.h" HAVE_SYS_RICHACL_H)
748766
LA_CHECK_INCLUDE_FILE("sys/select.h" HAVE_SYS_SELECT_H)
749767
LA_CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H)
@@ -863,6 +881,14 @@ IF(NOT OPENSSL_FOUND)
863881
ENDIF(LIBMD_FOUND)
864882
ENDIF(NOT OPENSSL_FOUND)
865883

884+
# libbsd for readpassphrase on Haiku
885+
IF("${CMAKE_SYSTEM_NAME}" MATCHES "Haiku")
886+
MESSAGE(STATUS "Adding libbsd for Haiku")
887+
SET(CMAKE_REQUIRED_LIBRARIES "bsd")
888+
FIND_LIBRARY(LIBBSD_LIBRARY NAMES bsd)
889+
LIST(APPEND ADDITIONAL_LIBS ${LIBBSD_LIBRARY})
890+
ENDIF("${CMAKE_SYSTEM_NAME}" MATCHES "Haiku")
891+
866892
#
867893
# How to prove that CRYPTO functions, which have several names on various
868894
# platforms, just see if archive_digest.c can compile and link against
@@ -2174,6 +2200,11 @@ IF(APPLE)
21742200
ADD_DEFINITIONS(-Wno-deprecated-declarations)
21752201
ENDIF(APPLE)
21762202

2203+
OPTION(DONT_FAIL_ON_CRC_ERROR "Ignore CRC errors during parsing (For fuzzing)" OFF)
2204+
IF(DONT_FAIL_ON_CRC_ERROR)
2205+
ADD_DEFINITIONS(-DDONT_FAIL_ON_CRC_ERROR=1)
2206+
ENDIF(DONT_FAIL_ON_CRC_ERROR)
2207+
21772208
IF(ENABLE_TEST)
21782209
ADD_CUSTOM_TARGET(run_all_tests)
21792210
ENDIF(ENABLE_TEST)

0 commit comments

Comments
 (0)