7zip-zstd-native 0.0.1 → 26.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/COPYING ADDED
@@ -0,0 +1,93 @@
1
+ 7-Zip-ZSTD
2
+ ~~~~~
3
+ License for use and distribution
4
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5
+
6
+ 7-Zip Copyright (C) 1999-2021 Igor Pavlov.
7
+ 7-Zip-ZSTD Copyright (C) 2016-2021 Tino Reichardt.
8
+
9
+ The licenses for files are:
10
+
11
+ 1) 7z.dll:
12
+ - The "GNU LGPL version 2.1 or later" as main license for most of the code
13
+ - The "GNU LGPL version 2.1 or later" with "unRAR license restriction" for some code
14
+ - The "BSD 3-clause License" for some code
15
+ 2) All other files: the "GNU LGPL".
16
+
17
+ Redistributions in binary form must reproduce related license information from this file.
18
+
19
+ Note:
20
+ You can use 7-Zip-ZSTD on any computer, including a computer in a commercial
21
+ organization. You don't need to register or pay for 7-Zip-ZSTD.
22
+
23
+
24
+ GNU LGPL information
25
+ --------------------
26
+ SPDX-License-Identifier: LGPL-2.1-or-later
27
+
28
+ This library is free software; you can redistribute it and/or
29
+ modify it under the terms of the GNU Lesser General Public
30
+ License as published by the Free Software Foundation; either
31
+ version 2.1 of the License, or (at your option) any later version.
32
+
33
+ This library is distributed in the hope that it will be useful,
34
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
35
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
36
+ Lesser General Public License for more details.
37
+
38
+ You can receive a copy of the GNU Lesser General Public License version 2.1 from
39
+ https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
40
+
41
+
42
+
43
+
44
+ BSD 3-clause License
45
+ --------------------
46
+ SPDX-License-Identifier: BSD-3-Clause
47
+
48
+ The "BSD 3-clause License" is used for the code in 7z.dll that implements LZFSE data decompression.
49
+ That code was derived from the code in the "LZFSE compression library" developed by Apple Inc,
50
+ that also uses the "BSD 3-clause License":
51
+
52
+ ----
53
+ Copyright (c) 2015-2016, Apple Inc. All rights reserved.
54
+
55
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
56
+
57
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
58
+
59
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
60
+ in the documentation and/or other materials provided with the distribution.
61
+
62
+ 3. Neither the name of the copyright holder(s) nor the names of any contributors may be used to endorse or promote products derived
63
+ from this software without specific prior written permission.
64
+
65
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
66
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
67
+ COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
68
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
69
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
70
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
71
+ ----
72
+
73
+
74
+
75
+
76
+ unRAR license restriction
77
+ -------------------------
78
+
79
+ The decompression engine for RAR archives was developed using source
80
+ code of unRAR program.
81
+ All copyrights to original unRAR code are owned by Alexander Roshal.
82
+
83
+ The license for original unRAR code has the following restriction:
84
+
85
+ The unRAR sources cannot be used to re-create the RAR compression algorithm,
86
+ which is proprietary. Distribution of modified unRAR sources in separate form
87
+ or as a part of other software is permitted, provided that it is clearly
88
+ stated in the documentation and source comments that the code may
89
+ not be used to develop a RAR (WinRAR) compatible archiver.
90
+
91
+
92
+ --
93
+ Tino Reichardt
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 yjdyamv
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,126 @@
1
+ # 7-Zip ZS Native Builds
2
+
3
+ CI that builds native [7-Zip ZS](https://github.com/mcmilk/7-Zip-zstd)
4
+ (`7zz` console) binaries for Linux, macOS and Windows, and publishes them
5
+ as GitHub Releases under the **same tag name** as the upstream release
6
+ (e.g. `v26.02-v1.5.7-R2`).
7
+
8
+ The source is always checked out at the upstream tag's pinned commit SHA,
9
+ so every release can be traced back to the exact source it was built from
10
+ (recorded in each archive's `VERSION` file).
11
+
12
+ ## Platforms
13
+
14
+ | Platform | Runner | Artifact |
15
+ |---|---|---|
16
+ | Linux x64 | `ubuntu-latest` (Alpine container) | `7zz-linux-x64.tar.gz` |
17
+ | Linux arm64 | `ubuntu-24.04-arm` (Alpine container) | `7zz-linux-arm64.tar.gz` |
18
+ | macOS arm64 | `macos-26` | `7zz-macos-arm64.tar.gz` |
19
+ | macOS x64 | `macos-26` (cross-compiled) | `7zz-macos-x64.tar.gz` |
20
+ | Windows x64 | `windows-latest` (MSVC nmake) | `7zz-windows-x64.zip` |
21
+ | Windows arm64 | `windows-11-arm` (MSVC nmake) | `7zz-windows-arm64.zip` |
22
+
23
+ The Linux binaries are a single **fully static musl** build per arch (built
24
+ natively in an Alpine container, `LDFLAGS_STATIC_2=-static`), so one binary
25
+ runs on **both** glibc and musl (Alpine) hosts. The glibc-linked variants are
26
+ deliberately **not** built: linked on `ubuntu-latest` (glibc 2.39) they would
27
+ only run on the newest distros, a strictly worse trade than the static build.
28
+
29
+ GitHub's macOS runners are Apple Silicon only, so the Intel (`x86_64`) build
30
+ is cross-compiled on `macos-26` with `clang -arch x86_64` (verified by
31
+ inspecting the binary's architecture — the build itself runs natively).
32
+
33
+ ## npm package
34
+
35
+ The binaries are also published to npm as the single package
36
+ [`7zip-zstd-native`](https://www.npmjs.com/package/7zip-zstd-native), primarily so the
37
+ **vscode-smart-archive** extension can locate a `7zz` binary at runtime, and
38
+ secondarily for anyone who wants a zero-setup `7zz` in Node.
39
+
40
+ The npm package ships the same Linux builds as the releases: the single
41
+ static musl binary per arch, which runs on both glibc and musl hosts.
42
+
43
+ Supported platforms in the npm package:
44
+
45
+ | `process.platform` | `process.arch` | `bin/` dir | Source build |
46
+ |---|---|---|---|
47
+ | `linux` | `x64` | `linux-x64` | `7zz-linux-x64` |
48
+ | `linux` | `arm64` | `linux-arm64` | `7zz-linux-arm64` |
49
+ | `darwin` | `arm64` | `darwin-arm64` | `7zz-macos-arm64` |
50
+ | `darwin` | `x64` | `darwin-x64` | `7zz-macos-x64` |
51
+ | `win32` | `x64` | `win32-x64` | `7zz-windows-x64` |
52
+ | `win32` | `arm64` | `win32-arm64` | `7zz-windows-arm64` |
53
+
54
+ ```bash
55
+ npm i -g 7zip-zstd-native # global CLI: `7zz ...`
56
+ npx 7zip-zstd-native i # one-off, no install
57
+ ```
58
+
59
+ ```js
60
+ const { spawn } = require('node:child_process');
61
+ const { path } = require('7zip-zstd-native'); // absolute path to the 7zz binary
62
+
63
+ spawn(path, ['x', 'archive.7z'], { stdio: 'inherit' });
64
+ ```
65
+
66
+ The export also includes `getPath()` (same value, resolved lazily on call),
67
+ `version` (the npm package version) and `upstream` for tracing the binaries
68
+ back to the upstream source.
69
+
70
+ ### Version numbers
71
+
72
+ The npm version is derived from the upstream tag at publish time, matching the
73
+ sibling [7zip-zstd-wasm](https://github.com/yjdyamv/7-Zip-zstd-wasm) package:
74
+
75
+ <7-Zip major>.<7-Zip minor>.<publish counter>
76
+
77
+ `v26.05-v1.5.7-R1` → `26.5.0`; another publish of the same 7-Zip line → `26.5.1`,
78
+ `26.5.2`, …; `v26.06-…` → `26.6.0`. The counter is per 7-Zip line and is
79
+ consumed by every publish of that line, whether it comes from a new upstream
80
+ tag or a rebuild. The computed version is clamped above the newest published
81
+ one so an older upstream line can never move `latest` backwards.
82
+
83
+ Upstream's exact identity (tag, commit, R revision, zstd version) is *not* in
84
+ the version number — it is recorded in the package's `7zip` field, in each
85
+ archive's `VERSION` file, and exposed at runtime as `require('7zip-zstd-native').upstream`.
86
+
87
+ ## Usage
88
+
89
+ ### Manual build
90
+
91
+ Actions → **Build native 7-Zip ZS** → Run workflow:
92
+
93
+ - `tag` — upstream tag to build (default: newest upstream tag by version).
94
+ - `publish` — create/update a GitHub Release **and** publish to npm.
95
+ - `overwrite` — replace assets of an existing release with the same tag.
96
+
97
+ ### Tag push
98
+
99
+ Pushing any tag matching `v*` (e.g. `git tag v26.02-v1.5.7-R2`) builds the
100
+ corresponding upstream tag and publishes/updates the release automatically.
101
+
102
+ ## Build notes
103
+
104
+ - macOS builds with the upstream `makefile.gcc` directly (clang). Linux
105
+ builds in an Alpine 3.24 container (`apk add build-base`) so g++ links
106
+ natively against musl — no cross-toolchain ABI risk — then
107
+ `LDFLAGS_STATIC_2=-static` (command-line override wins over the
108
+ makefile's empty default) makes the binary fully static, so one binary
109
+ covers glibc and musl hosts. Each Linux job verifies the result: `file`
110
+ must not report "dynamically linked" (static or static-PIE both pass)
111
+ and the binary must run (`7zz i`).
112
+ - Windows x64/arm64 use the upstream nmake `makefile` with MSVC
113
+ (`vcvarsall.bat` + `nmake PLATFORM=x64|arm64`) on native runners — the
114
+ same route upstream uses for official Windows builds, so no MinGW
115
+ workarounds are needed.
116
+ - `-Werror` is relaxed to non-fatal warnings (`-Wall -Wextra`) so future
117
+ toolchain warnings cannot break the build.
118
+
119
+ ## License
120
+
121
+ The CI configuration in this repository is MIT licensed. The built binaries
122
+ are 7-Zip ZS, licensed under LGPL-2.1+ (see upstream
123
+ [mcmilk/7-Zip-zstd](https://github.com/mcmilk/7-Zip-zstd)); the `LICENSE`
124
+ file inside each release archive is the upstream `COPYING`. The npm package
125
+ keeps the wrapper under MIT (`LICENSE`) and ships the upstream license as
126
+ `COPYING` alongside the binaries.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/cli.js ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const { spawnSync } = require('node:child_process');
5
+ const { path: binPath } = require('./index.js');
6
+
7
+ const result = spawnSync(binPath, process.argv.slice(2), { stdio: 'inherit' });
8
+
9
+ if (result.error) {
10
+ console.error(`7zip-zstd-native: failed to run ${binPath}: ${result.error.message}`);
11
+ process.exit(1);
12
+ }
13
+
14
+ process.exit(result.status === null ? 1 : result.status);
package/index.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ /** Absolute path to the 7zz binary for the current platform. */
2
+ export const path: string;
3
+
4
+ /** Resolve (and validate) the 7zz binary path for the current platform. */
5
+ export function getPath(): string;
6
+
7
+ /** The npm package version. */
8
+ export const version: string;
9
+
10
+ /** Upstream 7-Zip ZS identity the binaries were built from (set at publish). */
11
+ export const upstream:
12
+ | {
13
+ upstreamTag: string;
14
+ upstreamCommit: string;
15
+ revision: number;
16
+ zstd: string;
17
+ buildRepoCommit: string;
18
+ }
19
+ | undefined;
package/index.js ADDED
@@ -0,0 +1,58 @@
1
+ 'use strict';
2
+
3
+ const fs = require('node:fs');
4
+ const nodePath = require('node:path');
5
+
6
+ // Platform key -> executable file name inside bin/<key>/.
7
+ // Linux ships the musl-static build only: it runs on both glibc and musl
8
+ // hosts, so no libc detection is needed.
9
+ const BINARIES = {
10
+ 'linux-x64': '7zz',
11
+ 'linux-arm64': '7zz',
12
+ 'darwin-arm64': '7zz',
13
+ 'darwin-x64': '7zz',
14
+ 'win32-x64': '7zz.exe',
15
+ 'win32-arm64': '7zz.exe',
16
+ };
17
+
18
+ const KEY = `${process.platform}-${process.arch}`;
19
+
20
+ function getPath() {
21
+ const file = BINARIES[KEY];
22
+ if (!file) {
23
+ throw new Error(
24
+ `7zip-zstd-native: no prebuilt 7zz binary for "${KEY}". ` +
25
+ `Supported platforms: ${Object.keys(BINARIES).join(', ')}.`
26
+ );
27
+ }
28
+
29
+ const binPath = nodePath.join(__dirname, 'bin', KEY, file);
30
+ if (!fs.existsSync(binPath)) {
31
+ throw new Error(
32
+ `7zip-zstd-native: expected binary at ${binPath} but it is missing. ` +
33
+ `Reinstall the package (bin/ contents may have been stripped).`
34
+ );
35
+ }
36
+
37
+ // npm only guarantees the exec bit for files listed in package.json#bin,
38
+ // so make the real binary executable ourselves. Idempotent and safe to
39
+ // repeat; ignore failures on read-only filesystems.
40
+ if (process.platform !== 'win32') {
41
+ try {
42
+ fs.chmodSync(binPath, 0o755);
43
+ } catch {
44
+ // already executable or read-only mount
45
+ }
46
+ }
47
+
48
+ return binPath;
49
+ }
50
+
51
+ const pkg = require('./package.json');
52
+
53
+ module.exports = {
54
+ path: getPath(),
55
+ getPath,
56
+ version: pkg.version,
57
+ upstream: pkg['7zip'],
58
+ };
package/package.json CHANGED
@@ -1,6 +1,46 @@
1
1
  {
2
2
  "name": "7zip-zstd-native",
3
- "version": "0.0.1",
4
- "description": "Placeholder to bootstrap npm Trusted Publishing for the real 7zip-zstd-native package (native 7zz binaries). Not meant to be installed.",
5
- "license": "MIT"
3
+ "version": "26.5.0",
4
+ "description": "7-Zip ZS (7zz) native binaries for Linux, macOS and Windows",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/yjdyamv/7-Zip-zstd-native.git"
9
+ },
10
+ "homepage": "https://github.com/yjdyamv/7-Zip-zstd-native#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/yjdyamv/7-Zip-zstd-native/issues"
13
+ },
14
+ "bin": {
15
+ "7zz": "cli.js"
16
+ },
17
+ "main": "index.js",
18
+ "types": "index.d.ts",
19
+ "files": [
20
+ "cli.js",
21
+ "index.js",
22
+ "index.d.ts",
23
+ "bin",
24
+ "COPYING"
25
+ ],
26
+ "engines": {
27
+ "node": ">=16"
28
+ },
29
+ "keywords": [
30
+ "7zip",
31
+ "7zz",
32
+ "zstd",
33
+ "zstandard",
34
+ "archive",
35
+ "compress",
36
+ "extract",
37
+ "binary"
38
+ ],
39
+ "7zip": {
40
+ "upstreamTag": "v26.05-v1.5.7-R1",
41
+ "upstreamCommit": "07f03a46ef7642bf9ace70070d8874d2b92b4e70",
42
+ "revision": 1,
43
+ "zstd": "1.5.7",
44
+ "buildRepoCommit": "9690075c114c3f74b59cc531abf8fb2200cfcdd0"
45
+ }
6
46
  }