Files
gpuix/rust-toolchain.toml
T
Tommy D. Rossi 84da044089 Upgrade gpui to zed main (d5dc01f2)
Moves the pinned gpui/gpui_wgpu/gpui_macos revision from 14f37ed5 to
d5dc01f2, and fixes the API breaks that came with it.

API changes
-----------

| gpui change                                    | fix                                    |
|------------------------------------------------|----------------------------------------|
| `Corner` renamed to `Anchor`                     | `custom_elements/anchored.rs`          |
| `PlatformDispatcher` lost the timing methods     | removed from `node_dispatcher.rs`      |
| `RunnableMeta` lost `is_closed()`                | call `run()` directly, as zed now does |
| `Platform::restart` takes `Vec<OsString>`        | `node_platform.rs`                     |
| new `on_system_wake` / cursor visibility methods | `node_platform.rs`                     |
| `TouchPhase::Cancelled` added                    | mapped end to end, winit -> gpui -> JS |
| wgpu 28 -> 29, `WgpuRenderer::new` signature     | `node_window.rs`                       |
| `Application::new()` removed                     | example uses `gpui_platform`           |

Two runtime bugs
----------------

`NodePlatform::run()` is non-blocking, so `Application::run()` dropped the
only strong `Rc<AppCell>` at the end of `init()`. Every tick then failed to
upgrade its weak handle and logged `app was released` (over a million lines
in 15 seconds). gpui's new `run_embedded()` exists for exactly this embedder
shape; the returned `ApplicationHandle` is now kept in a thread_local.

`VisualTestState` dropped its `VisualTestAppContext` before the
`Entity<GpuixView>` it owned, so gpui's leak detector panicked at exit and
crashed every vitest worker. Field order is now load-bearing and documented.

Soundness
---------

`WgpuRenderer::new` now requires a `Clone + Send + Sync` window, so the winit
window is held in an `Arc`. It moved into `NodeWindowState` after `renderer`,
because `NodePlatform` also holds an `Rc<NodeWindowState>` and the wgpu
surface was built from the window's raw handle via `create_surface_unsafe`.
The window must outlive the surface.

Build requirements
------------------

`rust-toolchain.toml` pins 1.97.1 to match zed's toolchain for this revision.
CI switches to actions-rust-lang/setup-rust-toolchain so the pin is honored
when installing cross targets, with rustflags cleared to keep the previous
lint policy, and downloads the Metal toolchain that Xcode 26 no longer ships.

Verified: cargo check --all-targets clean, napi release build works, the
hello example links and runs, 71/71 react tests and 6/6 example tests pass,
and the counter example runs with zero wgpu/gpui warnings.

Session: ses_fe4fb6420ffemBjU2wIE5PN7N7
2026-08-19 20:55:43 +02:00

5 lines
119 B
TOML

[toolchain]
# must match zed's rust-toolchain.toml for the pinned gpui revision
channel = "1.97.1"
profile = "minimal"