Trim unused dependencies: image AVIF encoder, bindgen, postage, windows 0.61 - #1
Merged
Merged
Conversation
…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>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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 themrav1e, one of the slowest crates in the tree.Changes
image: default features off. Only the formats gpui'sImageFormatmaps are enabled (bmp, gif, ico, jpeg, png, pnm, tiff, webp), plusrayon. The default set brought inavif, which is an AVIF encoder (ravif/rav1e, about 28 crates) that nothing calls; decoding AVIF needsavif-native, which was never on. It also brought in theexr/dds/hdr/qoi/tga/ffdecoders, which noImageFormatvariant reaches. Behavior change:imagecan no longer guess-decode those formats.bindgen: 10 crates off Windows and Linux.gpui's macOS build-dependency on it is removed:build.rsnever used it, and cargo-shear already listed it as ignored.gpui_media's is now limited to macOS, the only target where itsbuild.rsgenerates anything.postage: now test-only. It's an optional dependency behindtest-support, plus a dev-dependency.app/test_context.rsis the only user, and that module only compiles withtest-support. This was the main thing pulling inthiserror1.windows0.61 alias removed.windows-capturegoes from 1.5 to 2.0.1, which moves it towindows0.62, so thewindows-061alias can go.gpui,gpui_wgpuandgpui_windowsnow use the workspacewindowscrate, which drops the wholewindows-*0.61 family (8 crates) from Windows builds. Two API changes in 2.0:Frame::timestamp()now returns aResult, propagated through the handler's existinganyhowerror, andas_raw_texture()is no longerunsafe.Verification
cargo clippy -p gpui-ce -p gpui_ce_platform -p gpui_ce_media -p gpui_ce_wgpu --all-targets -- -D warningspasses.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-capturepasses withRUSTFLAGS=-D warnings. The msvc target needs a Windows resource compiler forembed-resource, so I used gnu. Nothing has run on real Windows yet; this PR's CI is the first real Windows build.0a96e0a0without these changes:redundant_cloneatgpui_windows/src/directx_renderer.rs:611.--all-featuresfails to compilebench_context.rsanddebug_overlay.rs.cargo fmt --all -- --checkis clean.Out of scope, as separate follow-ups:
block/objc→block2/objc2:block0.1.6 triggers a warning that a future Rust version will reject it, and the move touches about 275msg_send!sites.wgpu/naga30 andaccesskit0.27/0.35.naga-old.🤖 Generated with Claude Code