Skip to content

Add archive component: ZIP/tar/gzip extract and create#20

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/add-archive-creation-extraction
Draft

Add archive component: ZIP/tar/gzip extract and create#20
Copilot wants to merge 3 commits into
mainfrom
copilot/add-archive-creation-extraction

Conversation

Copilot AI commented May 1, 2026

Copy link
Copy Markdown
Contributor

New Wasm component for archive creation and extraction operating entirely on byte arrays — no filesystem I/O.

WIT interface (wit/world.wit)

record file-entry {
    name: string,
    data: list<u8>,
    permissions: option<u32>,   // Unix mode bits
}

export extract:      func(input: list<u8>)          -> result<list<file-entry>, string>;
export create-zip:   func(files: list<file-entry>)  -> result<list<u8>, string>;
export create-tar-gz: func(files: list<file-entry>) -> result<list<u8>, string>;

Implementation

  • extract — auto-detects format from magic bytes: ZIP (PK\x03\x04), gzip (\x1F\x8B), fallback to tar. Gzip payloads that contain a POSIX/GNU tar archive are extracted transparently as tar.gz.
  • create-zipzip crate pinned to >=2.3 to avoid the path-canonicalization CVE present in >=1.3,<2.3. Unix permissions round-trip.
  • create-tar-gztar + flate2 with the pure-Rust miniz_oxide backend. Permissions preserved; entries without permissions default to 0o644.

Other

  • justfile and README.md updated to include archive.

Copilot AI changed the title [WIP] Add wasm component for archive creation and extraction functionality Add archive component: ZIP/tar/gzip extract and create May 1, 2026
Copilot AI requested a review from yoshuawuyts May 1, 2026 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[component] archive — zip/tar/gz extract + create

2 participants