Skip to content

Commit 396157c

Browse files
committed
zlib: add support for zip archives
1 parent 6668c4d commit 396157c

854 files changed

Lines changed: 71988 additions & 7 deletions

File tree

Some content is hidden

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

.github/workflows/test-linux.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ permissions:
3131

3232
jobs:
3333
test-linux:
34-
if: github.event.pull_request.draft == false
3534
runs-on: ubuntu-latest
3635
steps:
3736
- uses: actions/checkout@v3
@@ -45,5 +44,9 @@ jobs:
4544
run: npx envinfo
4645
- name: Build
4746
run: make build-ci -j2 V=1 CONFIG_FLAGS="--error-on-warn"
47+
- uses: actions/upload-artifact@v3
48+
with:
49+
name: build
50+
path: out/Release/node
4851
- name: Test
4952
run: make run-ci -j2 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ _UpgradeReport_Files/
8585
/deps/icu*.zip
8686
/deps/icu*.tgz
8787
/deps/icu-tmp
88+
/deps/libzip/build
8889
./node_modules
8990
/android-toolchain/
9091
# generated by gyp on Windows

configure.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,12 @@
265265
default=None,
266266
help='link to a shared libuv DLL instead of static linking')
267267

268+
shared_optgroup.add_argument('--shared-libzip',
269+
action='store_true',
270+
dest='shared_libzip',
271+
default=None,
272+
help='link to a shared libzip DLL instead of static linking')
273+
268274
shared_optgroup.add_argument('--shared-libuv-includes',
269275
action='store',
270276
dest='shared_libuv_includes',
@@ -2005,6 +2011,7 @@ def make_bin_override():
20052011
configure_node_lib_files(output)
20062012
configure_napi(output)
20072013
configure_library('zlib', output)
2014+
configure_library('libzip', output)
20082015
configure_library('http_parser', output)
20092016
configure_library('libuv', output)
20102017
configure_library('brotli', output, pkgname=['libbrotlidec', 'libbrotlienc'])

deps/libzip/.clang-format

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
BasedOnStyle: LLVM
2+
IndentWidth: 4
3+
ColumnLimit: 2000
4+
AlwaysBreakAfterReturnType: TopLevelDefinitions
5+
KeepEmptyLinesAtTheStartOfBlocks: false
6+
MaxEmptyLinesToKeep: 2
7+
BreakBeforeBraces: Custom
8+
BraceWrapping:
9+
BeforeElse: true
10+
AlignEscapedNewlines: Left
11+
UseTab: Never
12+
#PPDirectiveIndentStyle: AfterHash

deps/libzip/.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.gitattributes export-ignore
2+
.gitignore export-ignore
3+
.travis.yml export-ignore
4+
create-cmake-config.h.in.pl export-ignore
5+
docs export-ignore
6+
man/fix-man-links.sh export-ignore
7+
man/make_zip_errors.sh export-ignore
8+
man/mkdocset.pl export-ignore
9+
man/nih-man.css export-ignore
10+
vstudio export-ignore
11+
developer-xcode export-ignore
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug Report
3+
about: Report where libzip didn't behave like you expected.
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the Bug**
11+
A clear and concise description of what the bug is.
12+
13+
**Expected Behavior**
14+
A clear and concise description of what you expected to happen.
15+
16+
**Observed Behavior**
17+
A clear and concise description of what actually happened.
18+
19+
**To Reproduce**
20+
Short program or code snippet that reproduces the problem.
21+
22+
**libzip Version**
23+
Version of libzip or revision repository used.
24+
25+
**Operating System**
26+
Operating system and version, used compiler.
27+
28+
**Test Files**
29+
If applicable, attach and describe zip archives that trigger the problem.
30+
31+
**Additional context**
32+
Add any other context about the problem here.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Compile Error
3+
about: Report when libzip does not compile.
4+
title: ''
5+
labels: compile
6+
assignees: ''
7+
8+
---
9+
10+
**Compiler Error**
11+
Output from the compiler, including exact and complete error message, file name and line number.
12+
13+
**libzip Version**
14+
Version of libzip or revision repository used.
15+
16+
**Operating System and Compiler**
17+
The operating system and compiler used, including version number.
18+
19+
Also, any flags passed to `cmake`.
20+
21+
**Autodetected Configuration**
22+
Attach `CmakeCache.txt` from your build directory. This list everything `cmake` detected on your system.
23+
24+
**Additional context**
25+
Add any other context about the problem here.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for this project.
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Description**
11+
A clear and concise description of what you want to achieve, why the current features are insufficient, and why you think it is generally useful.
12+
13+
Also, have you checked whether the feature is already mentioned in TODO.md? If so, only submit a new issue if you expand on it.
14+
15+
**Solution**
16+
A clear and concise description of what you want to happen.
17+
18+
**Describe alternatives you've considered**
19+
A clear and concise description of any alternative solutions or features you've considered.
20+
21+
**Additional context**
22+
Add any other context about the feature request here.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: CIFuzz
2+
on: [pull_request]
3+
jobs:
4+
Fuzzing:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: Build Fuzzers
8+
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
9+
with:
10+
oss-fuzz-project-name: 'libzip'
11+
dry-run: false
12+
- name: Run Fuzzers
13+
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
14+
with:
15+
oss-fuzz-project-name: 'libzip'
16+
fuzz-seconds: 600
17+
dry-run: false
18+
- name: Upload Crash
19+
uses: actions/upload-artifact@v1
20+
if: failure()
21+
with:
22+
name: artifacts
23+
path: ./out/artifacts
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: build
2+
on: [push]
3+
4+
jobs:
5+
all:
6+
runs-on: ${{ matrix.os }}
7+
name: ${{ matrix.os }}${{ matrix.name_extra }}
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
os: [macos-latest, ubuntu-latest, windows-latest]
12+
cmake_extra: [""]
13+
name_extra: [""]
14+
include:
15+
- os: windows-latest
16+
cmake_extra: "-T ClangCl"
17+
name_extra: " clang-cl"
18+
steps:
19+
- name: checkout
20+
uses: actions/checkout@v2
21+
- name: install dependencies (Linux)
22+
if: ${{ runner.os == 'Linux' }}
23+
run: |
24+
sudo apt-get install libzstd-dev
25+
- name: install dependencies (Windows)
26+
if: ${{ runner.os == 'Windows' }}
27+
uses: lukka/run-vcpkg@v7
28+
id: runvcpkg
29+
with:
30+
vcpkgGitCommitId: f93ba152d55e1d243160e690bc302ffe8638358e
31+
vcpkgTriplet: x64-windows
32+
vcpkgArguments: zlib bzip2 liblzma zstd
33+
- name: prepare build directory
34+
run: |
35+
cmake -E make_directory ${{runner.workspace}}/build
36+
- name: configure (Unix)
37+
if: ${{ runner.os != 'Windows' }}
38+
working-directory: ${{runner.workspace}}/build
39+
run: |
40+
cmake ${{ matrix.cmake_extra }} ${{github.workspace}}
41+
- name: configure (Windows)
42+
if: ${{ runner.os == 'Windows' }}
43+
working-directory: ${{runner.workspace}}/build
44+
run: |
45+
cmake ${{ matrix.cmake_extra }} -DCMAKE_TOOLCHAIN_FILE=${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake ${{github.workspace}}
46+
- name: build
47+
working-directory: ${{runner.workspace}}/build
48+
run: |
49+
cmake --build . --config Release
50+
- name: test
51+
working-directory: ${{runner.workspace}}/build
52+
run: |
53+
ctest -v -C Release

0 commit comments

Comments
 (0)