Skip to content

fix(build): drop zip's C-backed zstd codec, unblock wasm32 builds - #5

Merged
amplitudesxd merged 1 commit into
firecrawl:mainfrom
Andsu-dev:fix/zip-deflate-only-features
Aug 4, 2026
Merged

fix(build): drop zip's C-backed zstd codec, unblock wasm32 builds#5
amplitudesxd merged 1 commit into
firecrawl:mainfrom
Andsu-dev:fix/zip-deflate-only-features

Conversation

@Andsu-dev

@Andsu-dev Andsu-dev commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

What

Scopes anydoc's own zip dependency to default-features = false, features = ["deflate"], matching the zip dependency calamine already uses.

Why

  • Default features enable zstd (via zstd-sys, C) and other C-backed codecs anydoc never needs, it only reads office-document zips (deflate) and only ever writes zips in #[cfg(test)] fixtures.
  • That C dependency is why cargo build --target wasm32-unknown-unknown fails immediately (error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"', from clang trying to build the vendored zstd C sources), pure-Rust deflate has no such problem.

Testing

  • cargo test -p anydoc, 171 passed, robustness and snapshot suites green
  • cargo build -p anydoc-node, the Node addon still builds clean
  • cargo build --target wasm32-unknown-unknown -p anydoc, now succeeds (this was the blocker for a wasm binding target, more on that separately)

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

zip's default features enable zstd (via zstd-sys, a C library), even
though anydoc never writes archives outside tests and every format it
reads (docx/pptx/xlsx/odt/epub) uses deflate, not zstd. calamine's own
zip dependency was already scoped to ["deflate"], this matches it.

That C dependency was also why `cargo build --target
wasm32-unknown-unknown` failed outright. Pure-Rust deflate has no such
problem.

171 unit tests plus the robustness/snapshot suites still pass
unchanged.
@amplitudesxd
amplitudesxd merged commit cad7ef2 into firecrawl:main Aug 4, 2026
4 checks passed
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.

2 participants