Skip to content

Trim unused dependencies: image AVIF encoder, bindgen, postage, windows 0.61 - #1

Merged
chris-addison merged 1 commit into
unity/a11y-automationfrom
unity/dependency-cleanup
Sep 27, 2026
Merged

chris-addison merged 1 commit into
unity/a11y-automationfrom
unity/dependency-cleanup

Conversation

@chris-addison

Copy link
Copy Markdown
Collaborator

Removes dependencies that the Unity Hub build compiles but never uses. Measured on the Hub's own build graph (cargo tree -p hub-gpui, normal and build deps), this takes about 45 crates out of every platform's build, most of them rav1e, one of the slowest crates in the tree.

Changes

  • image: default features off. Only the formats gpui's ImageFormat maps are enabled (bmp, gif, ico, jpeg, png, pnm, tiff, webp), plus rayon. The default set brought in avif, which is an AVIF encoder (ravif/rav1e, about 28 crates) that nothing calls; decoding AVIF needs avif-native, which was never on. It also brought in the exr/dds/hdr/qoi/tga/ff decoders, which no ImageFormat variant reaches. Behavior change: image can no longer guess-decode those formats.
  • bindgen: 10 crates off Windows and Linux. gpui's macOS build-dependency on it is removed: build.rs never used it, and cargo-shear already listed it as ignored. gpui_media's is now limited to macOS, the only target where its build.rs generates anything.
  • postage: now test-only. It's an optional dependency behind test-support, plus a dev-dependency. app/test_context.rs is the only user, and that module only compiles with test-support. This was the main thing pulling in thiserror 1.
  • windows 0.61 alias removed. windows-capture goes from 1.5 to 2.0.1, which moves it to windows 0.62, so the windows-061 alias can go. gpui, gpui_wgpu and gpui_windows now use the workspace windows crate, which drops the whole windows-* 0.61 family (8 crates) from Windows builds. Two API changes in 2.0: Frame::timestamp() now returns a Result, propagated through the handler's existing anyhow error, and as_raw_texture() is no longer unsafe.

Verification

  • macOS: cargo clippy -p gpui-ce -p gpui_ce_platform -p gpui_ce_media -p gpui_ce_wgpu --all-targets -- -D warnings passes.
  • Windows, cross-checked from macOS: GPUI_RENDER_ALLOW_MISSING_DXBC=1 cargo check --target x86_64-pc-windows-gnu -p gpui_ce_windows -p gpui_ce_wgpu -p gpui_ce_platform -p gpui-ce --features gpui-ce/screen-capture passes with RUSTFLAGS=-D warnings. The msvc target needs a Windows resource compiler for embed-resource, so I used gnu. Nothing has run on real Windows yet; this PR's CI is the first real Windows build.
  • Two failures I found were already there on 0a96e0a0 without these changes:
    • Windows clippy reports redundant_clone at gpui_windows/src/directx_renderer.rs:611.
    • --all-features fails to compile bench_context.rs and debug_overlay.rs.
  • cargo fmt --all -- --check is clean.

Out of scope, as separate follow-ups:

  • block/objc → block2/objc2: block 0.1.6 triggers a warning that a future Rust version will reject it, and the move touches about 275 msg_send! sites.
  • wgpu/naga 30 and accesskit 0.27/0.35.
  • naga-old.

🤖 Generated with Claude Code

…ws 0.61

- image: disable default features and enable only the formats gpui's
  ImageFormat maps (bmp, gif, ico, jpeg, png, pnm, tiff, webp) plus rayon.
  The default set pulled the ravif/rav1e AVIF encoder (~28 crates) that
  nothing calls, and the exr/dds/hdr/qoi/tga/ff decoders.
- bindgen: drop gpui's macOS build-dependency, which build.rs never used,
  and gate gpui_media's to macOS, the only target its build.rs generates
  bindings for.
- postage: optional behind test-support (and a dev-dependency). Only
  app/test_context.rs uses it, and that module is test-support-only.
- windows-capture 1.5 -> 2.0.1, which moves it to windows 0.62, so the
  windows-061 alias goes and gpui, gpui_wgpu and gpui_windows use the
  workspace windows crate. Frame::timestamp() now returns a Result and
  as_raw_texture() is safe.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chris-addison
chris-addison merged commit 9629535 into unity/a11y-automation Sep 27, 2026
18 checks passed
@chris-addison
chris-addison deleted the unity/dependency-cleanup branch September 27, 2026 04:45
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.

1 participant