This repository was archived by the owner on Nov 22, 2026. It is now read-only.
Repository navigation
Conversation
cargo-deny failed on RUSTSEC-2026-0367, -0368 and -0369 against zip 2.4.2. All three are in ZipArchive::extract / ZipStreamReader::extract, which nothing here calls; the fix is zip >= 9.0.0, so the dependency is upgraded rather than the advisories ignored. Both lockfiles move (the workspace and fuzz/). zip 9 changes what a writer gets by default, so every option a save depends on is now stated in one place, sheet_xlsx::write::part_options, used by the package writer, the embedded empty workbook and the CSV import: - Deflate stays on flate2's Rust backend (miniz_oxide) at level 6. zip 9's `deflate` feature switched to zlib-rs plus zopfli; built that way, every save of the corpus came out different. The workspace takes `deflate-flate2` and pins the backend with a flate2 dependency in sheet-xlsx. - "Made by" is pinned to Unix. Since zip 7.2 it follows the build platform, so a Windows build would have written different headers. - The timestamp is pinned to 1980-01-01 00:00:00 and the mode to 0o100644; `FileOptions::default()` reads the clock whenever zip's `time` feature is on. API changes adapted: FileOptions gained a second lifetime (the tests use SimpleFileOptions), and ZipFile::name returns ZipResult<Cow<str>>. Names now decode by their bytes, not the entry's UTF-8 flag: valid UTF-8 reads as UTF-8 with or without the flag (2.x read a flagless one as CP437 and wrote the mojibake back), anything else as CP437 (2.x replaced bad bytes in a flagged name with U+FFFD). ASCII names, all 495 part names in the corpus, read as before. zip_container_bytes.rs pins the whole saved package, not only the decompressed parts: a new workbook, a CSV import, zero-edit saves of a package with unknown parts and of an Excel-saved dynamic-array workbook, and an edited sheet. The goldens are the zip 2.4.2 build's output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e corpus zip 9's raw_copy_file carries a source entry's extra fields, comment and external attributes into the copy. This repo does not raw-copy: an untouched part is written again from its stored bytes with part_options(), so none of the source's zip metadata can reach a save. The goldens show that for five packages; this test shows it for every save path over all 47 corpus workbooks (zero-edit document save, zero-edit session save, an edit) and a new workbook. It reads the central directory and the local headers straight from the bytes, not through the zip crate, and checks the fields the zip 2.4.2 build wrote for all 1409 entries of those saves: version made by 0x0314 (Unix, 2.0), version needed 20, no data descriptor, deflate, DOS timestamp 1980-01-01 00:00:00, no extra field or comment, external attributes 0o100644. With 0o664 in part_options, all five tests in the file fail, this one naming the entry and the field. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cargo denyonmainfails on RUSTSEC-2026-0367, -0368 and -0369 againstzip2.4.2. All three are inZipArchive::extract/ZipStreamReader::extract, which this repo never calls. The fix iszip>= 9.0.0, so this upgrades to 9.0.4 (the latest) instead of recording ignores.deny.tomlis unchanged and itsignorelist stays empty.What changed
Dependency.
zip = { version = "9.0.4", default-features = false, features = ["deflate-flate2"] }plusflate2 = { version = "1.1", default-features = false, features = ["rust_backend"] }, declared bysheet-xlsx. Both lockfiles move: the workspace andfuzz/.zopfli,displaydoc,crossbeam-utils,arbitraryandlogleave the tree.typed-pathcomes in, andnixtoo, but only on macOS and the BSDs.flate21.1.10 andminiz_oxide0.9.1 keep the same versions and the same enabled features on wasm32, macOS and Linux.The deflate backend is pinned. zip 9's
deflatefeature switched from flate2 on miniz_oxide to zlib-rs plus zopfli. I built that variant and ran the comparison below: all 96 of 96 saves differed from the zip 2.4.2 output. So the workspace takesdeflate-flate2and selects the Rust backend itself. Note for later: flate2 prefers zlib-rs whenever any crate in the graph enables it, so a future dependency could switch the backend without notice. The new golden test would catch that.Every option a save depends on is now set in one place. That is
sheet_xlsx::write::part_options(), used by the package writer, the embedded empty workbook (SheetSession::new) and the CSV import:FileOptions::default()reads the clock whenever zip'stimefeature is on.large_fileoff: no zip64 extra and no data descriptor.API changes adapted:
FileOptionshas a second lifetime, so the tests useSimpleFileOptions.ZipFile::name()returnsZipResult<Cow<str>>. The OPC reader propagates the error and the test helpers unwrap it.The repo calls no
raw_copy_*,extractor streaming API.by_index(the reader) andby_name(tests) are unchanged.Byte identity
What this repo means by identity (ADR 503): untouched parts keep their decompressed bytes, and every part is written again, deflated by our own writer. Parts are not raw-copied with their original compression, and a save is not the same file Excel wrote. Neither statement was true before this change and neither is now. This PR changes no bytes of any save:
corpus/xlsx-corpus,xlsx-dynamicandxlsx-recalc: a zero-editXlsxDocumentsave, a zero-editSheetSessionsave, and an edit then save. Also a new workbook and a CSV import. Through the wasm build, 96 of 96 outputs are identical. Natively, 144 of 144 saves are identical, and so is the reader's view of every package: part names, order, lengths and content hashes.sheet-conformance/tests/zip_container_bytes.rs. It pins the whole saved package, headers and deflate streams included, against goldens recorded from the zip 2.4.2 build. The cases are a new workbook, a CSV import, a zero-edit save of a package with unknown parts (customXml, a VBA project; calc chain dropped), a zero-edit save of the Excel-saved dynamic-array workbook (cmmetadata,xl/metadata.xml, rich data), and an edited sheet. A failure names the first differing byte.every_saved_entry_has_the_pinned_headers(same file). It covers every corpus workbook through three save paths (zero-edit document save, zero-edit session save, and an edit) plus a new workbook. For each one it reads the central directory and the local headers straight from the bytes, not through the zip crate, and checks every entry against the fields the zip 2.4.2 build wrote for all 1409 entries of those saves: version made by0x0314(Unix, 2.0), version needed 20, no data descriptor, deflate, timestamp 1980-01-01 00:00:00, no extra field, no comment, external attributes0o100644. This answers theraw_copy_filequestion. zip 9's raw copy carries a source entry's extra fields, comment and attributes over, but this repo never raw-copies. An untouched part is written again from its stored bytes withpart_options(), so none of the source's zip metadata reaches a save. For example, the dynamic-array fixture stores0o600and is saved with0o100644.unix_permissions(0o664)inpart_options()makes all five tests in the file fail, and each failure names the byte or the entry and field.xlsx_roundtrip(zero-edit identity, unknown parts, the pivot cache,[Content_Types].xml),spill_roundtrip(dynamic arrays),real_xlsx_corpus,xlsx_recalc_corpusand thexlsx_write_readproperty test.Checks run locally
cargo deny check: advisories ok, bans ok, licenses ok, sources ok. No new ignores. Thesynduplicate warning is gone withdisplaydoc.cargo fmt --checkandcargo check --workspace --all-targetspass, and so do both dependency guards.cargo clippy --workspace --all-targets -- -D warnings: green in CI (check). Locally onlycargo check --all-targetsran, because new executables were stalling at launch on the build machine.cargo nextest run --workspace: 1495 passed, 5 skipped locally (before the header test was added; main had 1491). In CI at the head commit: 1496 passed, 5 skipped.REQUIRE_REAL_ENGINE=1 pnpm testagainst the wasm built from this branch: sheet-host-model 192 passed; sheet-bundle 339 passed, 1 skipped. The skip is the boot-failure path, which only runs when no artifact is present.fuzz/regressions/):xlsx_openran 148,934 times andxlsx_load_recalc143,731 times, both with no crash.parse_formulafails atparse_formula.rs:85, the same assertion main's nightly fuzz run has failed on since at least 2026-10-14. It touches only the formula parser and is unrelated to zip.wasm size
sheet_js_bg.wasm, built withscripts/build-wasm.sh(wasm-bindgen 0.2.128, binaryen 119,-Oz): before 1,799,603 bytes (zip 2.4.2) → after 1,743,039 bytes (zip 9.0.4), −56,564 bytes (−3.1 %), against the 100 MB app budget. CI'swasmjob: main 1,798,993 bytes, this branch 1,743,132 bytes. Most of the drop is zopfli. zip 2.x'sdeflatefeature linked it in for levels above 9, which nothing here uses. The old artifact carries zopfli's panic paths and the new one does not.Version
The bundle stays at
0.1.0-canary.22here. The Rust change still moves the bundle hash, becauseCargo.toml,Cargo.lockand thesheet-xlsx/sheet-jssources are inputs toscripts/source-hash.mjs. Sonode scripts/package-hash.mjs --checkon this branch fails against the published canary.22, as expected. #10 already bumps to0.1.0-canary.23. Bumping here too would make the two PRs race for the same number.Whichever of the two merges second publishes
canary.23with both changes:rust, which is red onmainuntil this lands. Nothing ships. Rebase this ontomain, merge, and canary.23 publishes.🤖 Generated with Claude Code