← Files ISA-L ZipARCHIVED FILE
BUILD-VERIFICATION.md
4.79 KB · Nov 30, 2026 · 00:22 UTC
# ISA-L Zip 0.2.1 native build and verification Copyright (c) 2026 Tarek Wasfy. ## Current native binaries Both included executables were rebuilt as Go/CGo binaries. Neither packages CPython. ISA-L 2.32.1 was compiled from the supplied Intel C/NASM source archive and linked statically into the CGo layer. The existing Visual Studio MSVC install was confirmed; MSVC's CMake ABI probe stalled on this host, so the reproducible build uses Zig's C cross compiler and NASM. ### Windows x64 - Target: `windows/amd64`, Go 1.27.3, CGo enabled, Zig 0.17.1 targeting `x86_64-windows-gnu`, ISA-L static library. - Tests: `go test ./...` passed, including round-trip, raw DEFLATE interoperability, traversal rejection, backslash traversal rejection, case-collision rejection, no partial extraction after an invalid later path, and rejection of corrupted stored payloads without retaining output. - Standalone smoke: the packaged Windows executable passed `--help`, pack, inspect, extract, CRC, and byte-for-byte round trip. - Binary size: 2,741,760 bytes. - SHA-256: `c70231a0c2821e6ebe119e1145ef7d1c98e8d6cf670081b6c3fbbee83932f909`. ### Linux x86_64 - Target: `linux/amd64`, Zig 0.17.1 C compiler targeting `x86_64-linux-musl`; ISA-L compiled from the same original source snapshot. Go external link requested static musl output. - Cross-build succeeded after the security corrections. ELF header confirms 64-bit little-endian x86_64 and no `PT_INTERP` dynamic loader requirement. Go build metadata confirms `GOOS=linux`, `GOARCH=amd64`, and `CGO_ENABLED=1`. - Runtime smoke test was not possible on this Windows host because WSL2 reports that virtualization/VM Platform is unavailable. Run the Linux commands in a Linux environment before claiming Linux execution tested. - Binary size: 3,340,328 bytes. - SHA-256: `ed89c0c92b57b455d0760796342c4c72324473089715db9ec24f3532d1f5197f`. ## Real ZIP packaging speed comparison Compared the prior CPython/PyInstaller executable (zipfile-isal 1.9.1) with this native Go/CGo executable (ISA-L 2.32.1) on the same Windows host. Each packed the same extracted 0.2.0 submission tree: 32 regular files, 9,125,525 uncompressed bytes. The native ZIP also records seven directory entries; the older ZIP omits those entries, but both contain the same regular file payload. Both used ZIP DEFLATE method 8 and ISA-L level 1. Six runs per executable were alternated; elapsed time includes process startup, file reads, compression and archive writing. After timing, both output ZIPs passed a separate CRC check. | Executable | Median of 6 | ZIP size | CRC | |---|---:|---:|---| | Previous CPython/PyInstaller + zipfile-isal | 2.243 s | 5,876,271 bytes | Pass | | Native Go/CGo + ISA-L C | 0.559 s | 5,823,134 bytes | Pass | On this dataset and host, the native build took about 4.0x less elapsed time (about 75% lower) and produced a ZIP 53,137 bytes smaller (0.9%). Timings varied substantially between runs, so this is an observed local result, not a general speed guarantee. The native path invokes ISA-L's stateless raw DEFLATE implementation at level 1, compiled with ISA-L's C and NASM sources. It currently buffers each individual file in memory before compression, so very large individual files can use substantial memory and are limited by the ISA-L 32-bit input/output buffer sizes. ## Reproduction `build-support/build-native.ps1` was run successfully with Go 1.27.3, Zig 0.17.1, NASM 3.02, and Visual Studio CMake/Ninja. It extracted `third_party/isa-l-master-source.zip` into ignored `native/.build/`, compiled ISA-L for both targets, passed Windows tests, and cross-built both executables. It does not execute the Linux binary. ## Security validation follow-up The supplied 2026-11-10 Linux security report reproduced CRC-failure residue, acceptance of backslash paths, and partial output when a later member was invalid. These findings are addressed in the current source and binaries: all entry paths and collisions are validated before output; extraction happens in a same-filesystem staging directory; each member's actual byte count, declared size, and CRC are checked; a new destination is committed by directory rename; commits into an existing destination are preflighted and rolled back on ordinary filesystem errors. Actual expanded data is capped at 20 GiB even if the central-directory size is dishonest. New Windows regression tests pass. Linux was rebuilt but still needs runtime execution on Linux; the report's tests were against the prior binary. Path-based destination operations are not protected against a hostile process racing symlink/directory changes during commit, so extract into a destination not writable by untrusted processes. The included benchmark command compares one input against Go's standard flate; the comparison above measures end-to-end ZIP packing against the previous packaged executable on one local dataset.
SHA-256: 74b0ce0a8f1c1a9c29750404041e9830252f36aa677c35ce845f4517c610f5e7