Skip to content

Commit ecc6595

Browse files
authored
Feature: RVZSTD support, candidate selection improvements (#1563)
1 parent f63953c commit ecc6595

File tree

92 files changed

+3103
-1566
lines changed

Some content is hidden

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

92 files changed

+3103
-1566
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contribution Guidelines
22

3-
Welcome! If you're viewing this, it means that youre likely interested in contributing to the project. That's fantastic!
3+
Welcome! If you're viewing this, it means that you're likely interested in contributing to the project. That's fantastic!
44

55
The following is a set of guidelines for contributing to Igir. These guidelines are published to clarify expectations and reduce potential conflict of opinions.
66

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ body:
4343
description: |
4444
The debug logs of your command run with the `-vvv` option. This is _not_ just a copy of the standard progress bar CLI output.
4545
46-
You can redirect the CLI output of `igir` to a file with the syntax: `igir [commands..] [options] -vvv > igir.log`. You can then attach this file in the GitHub text editor.
46+
You can redirect the CLI output of Igir to a file with the syntax: `igir [commands..] [options] -vvv > igir.log`. You can then attach this file in the GitHub text editor.
4747
4848
This field is _not_ optional as it is one of the most important ways to gain insight into your unique scenario. Without this information it is difficult to reproduce your problem.
4949
validations:

.github/renovate.json5

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,6 @@
126126
},
127127
},
128128

129-
{
130-
// Locked to a specific Zstandard version for RVZSTD zip creation
131-
matchPackageNames: ['zstd-napi'],
132-
enabled: false,
133-
},
134-
135129
// Update chdman, dolphin-tool, maxcso immediately
136130
{
137131
groupName: null,

.github/workflows/codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
with:
3838
submodules: 'recursive'
3939
- uses: volta-cli/action@v4
40-
- run: npm ci
40+
- run: npm ci --foreground-scripts
4141
- run: |
4242
sudo apt-get update
4343
sudo apt-get install -y libsdl2-2.0-0 libsdl2-ttf-2.0-0

.github/workflows/napi-prebuild.yml

Lines changed: 47 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
name: Node-API Prebuild
22

33
on:
4-
pull_request:
5-
types:
6-
# - edited # PR's base branch was changed
7-
- opened
8-
- reopened
9-
- synchronize # PR's branch was edited (i.e. new commits)
4+
push:
5+
branches-ignore:
6+
- 'main'
107

118
concurrency:
129
group: ${{ github.workflow }}-${{ github.ref }}
@@ -30,14 +27,19 @@ jobs:
3027
base: ${{ github.ref }}
3128
filters: |
3229
changes:
33-
- 'packages/torrentzip/*'
30+
- '.github/workflows/napi-prebuild.yml'
31+
- 'packages/zlib*/**'
32+
- 'packages/zstd*/**'
3433
3534
prebuild:
3635
needs:
3736
- path-filter
3837
if: ${{ needs.path-filter.outputs.changes == 'true' }}
3938
runs-on: ${{ matrix.os }}
40-
timeout-minutes: 10
39+
defaults:
40+
run:
41+
shell: bash
42+
timeout-minutes: 30 # QEMU cross-builds
4143
name: prebuildify (${{ matrix.os }} ${{ matrix.docker_arch }})
4244
strategy:
4345
fail-fast: false
@@ -48,10 +50,10 @@ jobs:
4850
docker_arch: linux/amd64
4951
- os: ubuntu-latest
5052
docker_arch: linux/arm/v7
51-
- os: ubuntu-latest
53+
- os: ubuntu-24.04-arm
5254
docker_arch: linux/arm64/v8
5355
- os: macos-13
54-
- os: macos-15
56+
- os: macos-latest
5557
- os: windows-latest
5658
- os: windows-11-arm
5759
steps:
@@ -60,48 +62,70 @@ jobs:
6062
with:
6163
submodules: 'recursive'
6264
- uses: volta-cli/action@v4
65+
with:
66+
node-version: 18
6367

6468
# Prebuild
6569
- shell: bash
6670
run: |
71+
set -x
72+
npm ci --ignore-scripts
6773
rm -rf packages/*/prebuilds
6874
- if: ${{ startsWith(matrix.os, 'ubuntu') }}
6975
uses: docker/setup-qemu-action@v3
7076
- id: linux-vars
7177
if: ${{ startsWith(matrix.os, 'ubuntu') }}
7278
run: |
73-
echo "VOLTA_NODE=$(jq --raw-output '.volta.node' package.json)" >> "${GITHUB_OUTPUT}"
79+
echo "VERSIONS_NODE=$(node --print 'process.versions.node')" >> "${GITHUB_OUTPUT}"
7480
7581
DOCKER_ARCH=${{ matrix.docker_arch }}
7682
DOCKER_ARCH=${DOCKER_ARCH/linux\//}
7783
DOCKER_ARCH=${DOCKER_ARCH//\//}
7884
echo "DOCKER_ARCH=${DOCKER_ARCH}" >> "${GITHUB_OUTPUT}"
7985
- if: ${{ startsWith(matrix.os, 'ubuntu') }}
86+
id: build-docker
8087
uses: addnab/docker-run-action@v3
8188
with:
82-
image: node:${{ steps.linux-vars.outputs.VOLTA_NODE }}
89+
image: node:${{ steps.linux-vars.outputs.VERSIONS_NODE }}
8390
shell: bash
8491
options: |
8592
--platform ${{ matrix.docker_arch }}
8693
--volume ${{ github.workspace }}:/build
8794
--workdir /build
8895
run: |
8996
set -x
90-
cd packages/torrentzip
91-
npm install --ignore-scripts
92-
./node_modules/.bin/prebuildify --napi --strip
93-
touch prebuilds/.gitkeep
97+
find packages -maxdepth 1 -type d \( -name "zlib*" -o -name "zstd*" \) | while IFS= read -r dir; do
98+
cd "${dir}"
99+
npm install --ignore-scripts
100+
./node_modules/.bin/prebuildify --target "$(node --print 'process.versions.node')" --napi --strip
101+
touch prebuilds/.gitkeep
102+
cd ../..
103+
done
104+
ls -alR packages/*/prebuilds/
105+
106+
# Test the build
107+
rm -rf packages/*/build
108+
npm ci --foreground-scripts
109+
npm run test:unit packages
94110
- if: ${{ !startsWith(matrix.os, 'ubuntu') }}
95-
shell: bash
111+
id: build
96112
run: |
97113
set -x
98-
cd packages/torrentzip
99-
npm install --ignore-scripts
100-
./node_modules/.bin/prebuildify --napi --strip
101-
touch prebuilds/.gitkeep
114+
find packages -maxdepth 1 -type d \( -name "zlib*" -o -name "zstd*" \) | while IFS= read -r dir; do
115+
cd "${dir}"
116+
npm install --ignore-scripts
117+
./node_modules/.bin/prebuildify --target "$(node --print 'process.versions.node')" --napi --strip
118+
touch prebuilds/.gitkeep
119+
cd ../..
120+
done
121+
ls -alR packages/*/prebuilds/
102122
103-
- shell: bash
104-
run: |
123+
# Test the build
124+
rm -rf packages/*/build
125+
npm ci --foreground-scripts
126+
npm run test:unit packages
127+
128+
- run: |
105129
ls -alR packages/*/prebuilds/
106130
- uses: actions/upload-artifact@v4
107131
with:

.github/workflows/node-compile.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
docker_arch: linux/arm64/v8
6464

6565
- os: macos-13
66-
- os: macos-15
66+
- os: macos-latest
6767

6868
- os: windows-latest
6969
go_arch: amd64
@@ -118,6 +118,8 @@ jobs:
118118
ls -alh igir "${{ env.BIN_OUTPUT }}"
119119
echo '```'
120120
} >> "${GITHUB_STEP_SUMMARY:-/dev/null}"
121+
- if: ${{ startsWith(matrix.os, 'ubuntu') }}
122+
run: sudo chown -R "$(id -u):$(id -g)" .
121123

122124
- if: ${{ startsWith(matrix.os, 'macos') }}
123125
run: |
@@ -148,18 +150,7 @@ jobs:
148150
echo "BIN_OUTPUT=${BIN_OUTPUT}" | Out-File -FilePath $env:GITHUB_ENV -Append # no need for -Encoding utf8
149151
150152
# Install dependencies...
151-
if ($NODE_ARCH -in @("x64")) {
152-
npm ci
153-
} else {
154-
# ...but fix zstd-napi not compiling Zstandard correctly out of the box
155-
npm ci --ignore-scripts
156-
Push-Location
157-
cd node_modules\zstd-napi
158-
Set-Content -Path deps\zstd.gyp -Value (Get-Content -Path deps\zstd.gyp | Select-String -Pattern 'huf_decompress_amd64' -NotMatch)
159-
npm install node-gyp
160-
node_modules\.bin\node-gyp rebuild
161-
Pop-Location
162-
}
153+
npm ci
163154
if ($NODE_ARCH -notin @("ia32", "x64")) {
164155
# ...and use a version of 7zip-bin that includes this arch
165156
npm install 7zip-bin@">=5.2.0"

.github/workflows/node-test.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,16 @@ jobs:
7575
strategy:
7676
fail-fast: false
7777
matrix:
78-
os: [ ubuntu-24.04, ubuntu-24.04-arm, macos-15, windows-latest ]
79-
node-version: [ lts, 18 ]
78+
# TODO(cemmer): chdman-js and maxcso-js don't have Windows ARM builds, so it won't test the same
79+
os: [ ubuntu-latest, ubuntu-24.04-arm, macos-latest, macos-13, windows-latest ]
80+
node-version: [ lts ]
81+
include:
82+
- os: ubuntu-latest
83+
node-version: 18
84+
- os: macos-latest
85+
node-version: 18
86+
- os: windows-latest
87+
node-version: 18
8088
steps:
8189
# Setup and install
8290
- uses: actions/checkout@v4
@@ -86,7 +94,10 @@ jobs:
8694
- uses: volta-cli/action@v4
8795
with:
8896
node-version: ${{ matrix.node-version }}
89-
- run: npm ci
97+
- shell: bash
98+
run: |
99+
rm -rf packages/*/prebuilds
100+
npm ci --foreground-scripts
90101
- if: ${{ startsWith(matrix.os, 'ubuntu') }}
91102
run: |
92103
sudo apt-get update
@@ -103,7 +114,7 @@ jobs:
103114
timeout-minutes: 10
104115
strategy:
105116
matrix:
106-
node-version: [ lts, 18, ]
117+
node-version: [ lts, 18 ]
107118
steps:
108119
# Setup and install
109120
- uses: actions/checkout@v4
@@ -113,7 +124,7 @@ jobs:
113124
- uses: volta-cli/action@v4
114125
with:
115126
node-version: ${{ matrix.node-version }}
116-
- run: npm ci
127+
- run: npm ci --foreground-scripts
117128
- run: |
118129
sudo apt-get update
119130
sudo apt-get install -y libsdl2-2.0-0 libsdl2-ttf-2.0-0
@@ -144,7 +155,7 @@ jobs:
144155
npm pack
145156
tar -xvzf igir-*.tgz
146157
cd package
147-
npm install
158+
npm install --foreground-scripts
148159
./dist/index.js --help
149160
cd ..
150161
rm -rf package

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ site/
113113
*.bat
114114
*.cache*
115115
*.sh
116+
igir
117+
igir.exe
116118
!test/*.sh
117119

118120
# DATs

.gitmodules

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
[submodule "packages/torrentzip/deps/zlib"]
2-
path = packages/torrentzip/deps/zlib
3-
url = https://github.com/madler/zlib.git
4-
[submodule "packages/torrentzip/deps/zlib_1_1_3"]
5-
path = packages/torrentzip/deps/zlib_1_1_3
1+
[submodule "packages/zlib-1.1.3/deps/zlib"]
2+
path = packages/zlib-1.1.3/deps/zlib
63
url = https://github.com/madler/zlib.git
4+
[submodule "packages/zstd-1.5.5/deps/zstd"]
5+
path = packages/zstd-1.5.5/deps/zstd
6+
url = https://github.com/facebook/zstd.git

.idea/runConfigurations/_template__of_JavaScriptTestRunnerJest.xml renamed to .idea/runConfigurations/_template__of_Jest.xml

File renamed without changes.

0 commit comments

Comments
 (0)