Skip to content

fix(deps): update self_update to 1.3, so zip moves past its advisories - #827

Merged
LeMyst merged 2 commits into
cooklang:mainfrom
LeMyst:fix/zip-advisories
Nov 4, 2026
Merged

LeMyst merged 2 commits into
cooklang:mainfrom
LeMyst:fix/zip-advisories

Conversation

@LeMyst

@LeMyst LeMyst commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Closes #825
Closes #826

fix(deps): self_update 0.44 → 1.3, so zip 6.0.0 → 9.3.0

zip comes only from self_update, whose 0.44 requires zip ^6. That's why Dependabot couldn't fix alerts #105–#108 (fixed in 9.0.0 / 9.0.5). self_update 1.3 requires zip ^9, which resolves to 9.3.0.

self_update 1.x regrouped its features and changed its API. The same capabilities are enabled as before:

  • Features: the GitHub backend is now github; tar.gz is compression-tar-gz (was compression-flate2); the download progress bar is progress-bar (always built in under 0.44).
  • API: the release list is Releases (latest() is the first release, as .first() was); releases and assets have accessor methods; Download takes request_header / show_download_progress.
  • TempDir and self_replace are no longer re-exported, so tempfile and self-replace (already in the tree) are optional dependencies of the self-update feature.

Lock: indicatif, self-replace, tempfile and nix come in through self_update 1.3; arbitrary, quick-xml and unit-prefix go away.

fix(update): unpack the Windows release

The Windows release zip is packed with 7z a, which deflates cook.exe, but zip was built without deflate. So cook update on Windows has refused every release since 669899f. Enabling compression-zip-deflate fixes it (it adds zopfli).

Tests

  • cook update --check-only and cook update --force run end to end on Linux against the v0.40.0 release, from a copy of the built binary. It lists, downloads, checks the SHA-256, extracts the tar.gz and replaces the copy, which then runs as 0.40.0.
  • The real v0.40.0 Windows zip: zip 6 as built before refuses it ("Compression method not supported"); zip 9 with deflate extracts all of cook.exe.
  • New update::tests::extracts_cook_from_a_deflated_zip: a 145-byte fixture packed like the release (tests/fixtures/update/cook-deflated.zip), extracted with the updater's own Extract call. It fails without compression-zip-deflate (CompressionMethodNotSupported(8)).
  • cargo fmt, cargo clippy --all-targets clean. cargo test --workspace: 1879 passed. The Docker feature set (--no-default-features --features server,lsp) and a build without self-update both check.
  • Not run here: cook update on an actual Windows machine.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MmrM91dHzvQoaerCcR9wra

LeMyst and others added 2 commits November 4, 2026 16:06
zip 6.0.0 is affected by GHSA-m665-v7pm-7grj (critical, fixed in
9.0.5), GHSA-9hj8-73fh-9963, GHSA-q7v9-x93c-xqv3 and
GHSA-8hxf-qr8p-62x4 (fixed in 9.0.0). Dependabot could not move it:
zip comes only from self_update, and self_update 0.44 requires zip ^6.
self_update 1.3 requires zip ^9, which now resolves to 9.3.0.

self_update 1.x renamed or regrouped features and changed its API:
- the GitHub backend is the `github` feature, tar.gz support is
  `compression-tar-gz` (was `compression-flate2`), and the download
  progress bar is `progress-bar`; the same set is enabled as before;
- the release list is `Releases` (`latest()`), releases and assets
  have accessor methods, and `Download` takes `request_header` and
  `show_download_progress`;
- `TempDir` and `self_replace` are no longer re-exported, so their
  crates are now optional dependencies of the `self-update` feature.

`cook update --force` was run end to end on Linux against the v0.40.0
release: listed, downloaded, checked, extracted and replaced.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MmrM91dHzvQoaerCcR9wra
The release workflow packs the Windows binary with `7z a`, which
deflates `cook.exe`, but self_update was built without zip's `deflate`
(`compression-zip-deflate`): `cook update` on Windows downloaded and
checked the release, then refused it with "Compression method not
supported". The v0.40.0 Windows zip is deflated; a zip built as before
cannot read it, one with `deflate` reads all of it.

A test extracts `cook.exe` from a small deflated fixture packed the same
way, with the call the updater makes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MmrM91dHzvQoaerCcR9wra
@LeMyst
LeMyst marked this pull request as ready for review November 4, 2026 17:42
@LeMyst
LeMyst merged commit d1455f4 into cooklang:main Nov 4, 2026
6 of 7 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

1 participant