Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Run wasm builds in CI against pinned stable (#54081)
Lukas Wirth626963b5ae58
diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.ymlindex c7025fb545b..4e196992ca0 100644--- a/.github/workflows/run_tests.yml+++ b/.github/workflows/run_tests.yml@@ -590,9 +590,10 @@ jobs:R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}SCCACHE_BUCKET: sccache-zed- name: run_tests::check_wasm::cargo_check_wasm- run: cargo +nightly -Zbuild-std=std,panic_abort check --target wasm32-unknown-unknown -p gpui_platform+ run: cargo -Zbuild-std=std,panic_abort check --target wasm32-unknown-unknown -p gpui_platformenv:CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUSTFLAGS: -C target-feature=+atomics,+bulk-memory,+mutable-globals+ RUSTC_BOOTSTRAP: '1'- name: steps::show_sccache_statsrun: sccache --show-stats || true- name: steps::cleanup_cargo_configdiff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rsindex 76736ba471a..d5544dc1aa6 100644--- a/crates/workspace/src/workspace.rs+++ b/crates/workspace/src/workspace.rs@@ -8122,6 +8122,15 @@ impl Render for Workspace {.collect::<Vec<_>>();let bottom_dock_layout = WorkspaceSettings::get_global(cx).bottom_dock_layout;+ let pane_render_context = PaneRenderContext {+ follower_states: &self.follower_states,+ active_call: self.active_call(),+ active_pane: &self.active_pane,+ app_state: &self.app_state,+ project: &self.project,+ workspace: &self.weak_self,+ };+div().relative().size_full()@@ -8129,400 +8138,387 @@ impl Render for Workspace {.flex_col().font(ui_font).gap_0()- .justify_start()- .items_start()- .text_color(colors.text)- .overflow_hidden()- .children(self.titlebar_item.clone())- .on_modifiers_changed(move |_, _, cx| {- for &id in ¬ification_entities {- cx.notify(id);- }- })- .child(- div()- .size_full()- .relative()- .flex_1()- .flex()- .flex_col()- .child(- div()- .id("workspace")- .bg(colors.background)- .relative()- .flex_1()- .w_full()- .flex()- .flex_col()- .overflow_hidden()- .border_t_1()- .border_b_1()- .border_color(colors.border)- .child({- let this = cx.entity();- canvas(- move |bounds, window, cx| {- this.update(cx, |this, cx| {- let bounds_changed = this.bounds != bounds;- this.bounds = bounds;-- if bounds_changed {- this.left_dock.update(cx, |dock, cx| {- dock.clamp_panel_size(- bounds.size.width,- window,- cx,- )- });-- this.right_dock.update(cx, |dock, cx| {- dock.clamp_panel_size(- bounds.size.width,- window,- cx,- )- });-- this.bottom_dock.update(cx, |dock, cx| {- dock.clamp_panel_size(- bounds.size.height,- window,- cx,- )- });- }- })- },- |_, _, _, _| {},- )- .absolute()- .size_full()- })- .when(self.zoomed.is_none(), |this| {- this.on_drag_move(cx.listener(- move |workspace,- e: &DragMoveEvent<DraggedDock>,- window,- cx| {- if workspace.previous_dock_drag_coordinates- != Some(e.event.position)- {- workspace.previous_dock_drag_coordinates =- Some(e.event.position);-- match e.drag(cx).0 {- DockPosition::Left => {- workspace.resize_left_dock(- e.event.position.x- - workspace.bounds.left(),- window,- cx,- );- }- DockPosition::Right => {- workspace.resize_right_dock(- workspace.bounds.right()- - e.event.position.x,- window,- cx,- );- }- DockPosition::Bottom => {- workspace.resize_bottom_dock(- workspace.bounds.bottom()- - e.event.position.y,- window,- cx,- );- }- };- workspace.serialize_workspace(window, cx);- }- },- ))-- })- .child({- match bottom_dock_layout {- BottomDockLayout::Full => div()- .flex()- .flex_col()- .h_full()- .child(- div()- .flex()- .flex_row()- .flex_1()- .overflow_hidden()- .children(self.render_dock(- DockPosition::Left,- &self.left_dock,+ .justify_start()+ .items_start()+ .text_color(colors.text)+ .overflow_hidden()+ .children(self.titlebar_item.clone())+ .on_modifiers_changed(move |_, _, cx| {+ for &id in ¬ification_entities {+ cx.notify(id);+ }+ })+ .child(+ div()+ .size_full()+ .relative()+ .flex_1()+ .flex()+ .flex_col()+ .child(+ div()+ .id("workspace")+ .bg(colors.background)+ .relative()+ .flex_1()+ .w_full()+ .flex()+ .flex_col()+ .overflow_hidden()+ .border_t_1()+ .border_b_1()+ .border_color(colors.border)+ .child({+ let this = cx.entity();+ canvas(+ move |bounds, window, cx| {+ this.update(cx, |this, cx| {+ let bounds_changed = this.bounds != bounds;+ this.bounds = bounds;++ if bounds_changed {+ this.left_dock.update(cx, |dock, cx| {+ dock.clamp_panel_size(+ bounds.size.width,window,cx,- ))-- .child(- div()- .flex()- .flex_col()- .flex_1()- .overflow_hidden()- .child(- h_flex()- .flex_1()- .when_some(- paddings.0,- |this, p| {- this.child(- p.border_r_1(),- )- },- )- .child(self.center.render(- self.zoomed.as_ref(),- &PaneRenderContext {- follower_states:- &self.follower_states,- active_call: self.active_call(),- active_pane: &self.active_pane,- app_state: &self.app_state,- project: &self.project,- workspace: &self.weak_self,- },- window,- cx,- ))- .when_some(- paddings.1,- |this, p| {- this.child(- p.border_l_1(),- )- },- ),- ),)+ });- .children(self.render_dock(- DockPosition::Right,- &self.right_dock,+ this.right_dock.update(cx, |dock, cx| {+ dock.clamp_panel_size(+ bounds.size.width,window,cx,- )),- )- .child(div().w_full().children(self.render_dock(- DockPosition::Bottom,- &self.bottom_dock,- window,- cx- ))),-- BottomDockLayout::LeftAligned => div()- .flex()- .flex_row()- .h_full()- .child(- div()- .flex()- .flex_col()- .flex_1()- .h_full()- .child(- div()- .flex()- .flex_row()- .flex_1()- .children(self.render_dock(DockPosition::Left, &self.left_dock, window, cx))-- .child(- div()- .flex()- .flex_col()- .flex_1()- .overflow_hidden()- .child(- h_flex()- .flex_1()- .when_some(paddings.0, |this, p| this.child(p.border_r_1()))- .child(self.center.render(- self.zoomed.as_ref(),- &PaneRenderContext {- follower_states:- &self.follower_states,- active_call: self.active_call(),- active_pane: &self.active_pane,- app_state: &self.app_state,- project: &self.project,- workspace: &self.weak_self,- },- window,- cx,- ))- .when_some(paddings.1, |this, p| this.child(p.border_l_1())),- )- )-)- .child(- div()- .w_full()- .children(self.render_dock(DockPosition::Bottom, &self.bottom_dock, window, cx))- ),- )- .children(self.render_dock(- DockPosition::Right,- &self.right_dock,- window,- cx,- )),- BottomDockLayout::RightAligned => div()- .flex()- .flex_row()- .h_full()- .children(self.render_dock(- DockPosition::Left,- &self.left_dock,- window,- cx,- ))-- .child(- div()- .flex()- .flex_col()- .flex_1()- .h_full()- .child(- div()- .flex()- .flex_row()- .flex_1()- .child(- div()- .flex()- .flex_col()- .flex_1()- .overflow_hidden()- .child(- h_flex()- .flex_1()- .when_some(paddings.0, |this, p| this.child(p.border_r_1()))- .child(self.center.render(- self.zoomed.as_ref(),- &PaneRenderContext {- follower_states:- &self.follower_states,- active_call: self.active_call(),- active_pane: &self.active_pane,- app_state: &self.app_state,- project: &self.project,- workspace: &self.weak_self,- },- window,- cx,- ))- .when_some(paddings.1, |this, p| this.child(p.border_l_1())),- )- )-- .children(self.render_dock(DockPosition::Right, &self.right_dock, window, cx))- )- .child(- div()- .w_full()- .children(self.render_dock(DockPosition::Bottom, &self.bottom_dock, window, cx))- ),- ),- BottomDockLayout::Contained => div()- .flex()- .flex_row()- .h_full()- .children(self.render_dock(- DockPosition::Left,- &self.left_dock,- window,- cx,- ))-- .child(- div()- .flex()- .flex_col()- .flex_1()- .overflow_hidden()- .child(- h_flex()- .flex_1()- .when_some(paddings.0, |this, p| {- this.child(p.border_r_1())- })- .child(self.center.render(- self.zoomed.as_ref(),- &PaneRenderContext {- follower_states:- &self.follower_states,- active_call: self.active_call(),- active_pane: &self.active_pane,- app_state: &self.app_state,- project: &self.project,- workspace: &self.weak_self,- },- window,- cx,- ))- .when_some(paddings.1, |this, p| {- this.child(p.border_l_1())- }),+ });++ this.bottom_dock.update(cx, |dock, cx| {+ dock.clamp_panel_size(+ bounds.size.height,+ window,+ cx,)- .children(self.render_dock(- DockPosition::Bottom,- &self.bottom_dock,+ });+ }+ })+ },+ |_, _, _, _| {},+ )+ .absolute()+ .size_full()+ })+ .when(self.zoomed.is_none(), |this| {+ this.on_drag_move(cx.listener(+ move |workspace, e: &DragMoveEvent<DraggedDock>, window, cx| {+ if workspace.previous_dock_drag_coordinates+ != Some(e.event.position)+ {+ workspace.previous_dock_drag_coordinates =+ Some(e.event.position);++ match e.drag(cx).0 {+ DockPosition::Left => {+ workspace.resize_left_dock(+ e.event.position.x+ - workspace.bounds.left(),window,cx,- )),- )+ );+ }+ DockPosition::Right => {+ workspace.resize_right_dock(+ workspace.bounds.right()+ - e.event.position.x,+ window,+ cx,+ );+ }+ DockPosition::Bottom => {+ workspace.resize_bottom_dock(+ workspace.bounds.bottom()+ - e.event.position.y,+ window,+ cx,+ );+ }+ };+ workspace.serialize_workspace(window, cx);+ }+ },+ ))+ })+ .child({+ match bottom_dock_layout {+ BottomDockLayout::Full => div()+ .flex()+ .flex_col()+ .h_full()+ .child(+ div()+ .flex()+ .flex_row()+ .flex_1()+ .overflow_hidden()+ .children(self.render_dock(+ DockPosition::Left,+ &self.left_dock,+ window,+ cx,+ ))+ .child(+ div()+ .flex()+ .flex_col()+ .flex_1()+ .overflow_hidden()+ .child(+ h_flex()+ .flex_1()+ .when_some(paddings.0, |this, p| {+ this.child(p.border_r_1())+ })+ .child(self.center.render(+ self.zoomed.as_ref(),+ &pane_render_context,+ window,+ cx,+ ))+ .when_some(+ paddings.1,+ |this, p| {+ this.child(p.border_l_1())+ },+ ),+ ),+ )+ .children(self.render_dock(+ DockPosition::Right,+ &self.right_dock,+ window,+ cx,+ )),+ )+ .child(div().w_full().children(self.render_dock(+ DockPosition::Bottom,+ &self.bottom_dock,+ window,+ cx,+ ))),++ BottomDockLayout::LeftAligned => div()+ .flex()+ .flex_row()+ .h_full()+ .child(+ div()+ .flex()+ .flex_col()+ .flex_1()+ .h_full()+ .child(+ div()+ .flex()+ .flex_row()+ .flex_1()+ .children(self.render_dock(+ DockPosition::Left,+ &self.left_dock,+ window,+ cx,+ ))+ .child(+ div()+ .flex()+ .flex_col()+ .flex_1()+ .overflow_hidden()+ .child(+ h_flex()+ .flex_1()+ .when_some(+ paddings.0,+ |this, p| {+ this.child(+ p.border_r_1(),+ )+ },+ )+ .child(self.center.render(+ self.zoomed.as_ref(),+ &pane_render_context,+ window,+ cx,+ ))+ .when_some(+ paddings.1,+ |this, p| {+ this.child(+ p.border_l_1(),+ )+ },+ ),+ ),+ ),+ )+ .child(div().w_full().children(self.render_dock(+ DockPosition::Bottom,+ &self.bottom_dock,+ window,+ cx,+ ))),+ )+ .children(self.render_dock(+ DockPosition::Right,+ &self.right_dock,+ window,+ cx,+ )),+ BottomDockLayout::RightAligned => div()+ .flex()+ .flex_row()+ .h_full()+ .children(self.render_dock(+ DockPosition::Left,+ &self.left_dock,+ window,+ cx,+ ))+ .child(+ div()+ .flex()+ .flex_col()+ .flex_1()+ .h_full()+ .child(+ div()+ .flex()+ .flex_row()+ .flex_1()+ .child(+ div()+ .flex()+ .flex_col()+ .flex_1()+ .overflow_hidden()+ .child(+ h_flex()+ .flex_1()+ .when_some(+ paddings.0,+ |this, p| {+ this.child(+ p.border_r_1(),+ )+ },+ )+ .child(self.center.render(+ self.zoomed.as_ref(),+ &pane_render_context,+ window,+ cx,+ ))+ .when_some(+ paddings.1,+ |this, p| {+ this.child(+ p.border_l_1(),+ )+ },+ ),+ ),+ )+ .children(self.render_dock(+ DockPosition::Right,+ &self.right_dock,+ window,+ cx,+ )),+ )+ .child(div().w_full().children(self.render_dock(+ DockPosition::Bottom,+ &self.bottom_dock,+ window,+ cx,+ ))),+ ),+ BottomDockLayout::Contained => div()+ .flex()+ .flex_row()+ .h_full()+ .children(self.render_dock(+ DockPosition::Left,+ &self.left_dock,+ window,+ cx,+ ))+ .child(+ div()+ .flex()+ .flex_col()+ .flex_1()+ .overflow_hidden()+ .child(+ h_flex()+ .flex_1()+ .when_some(paddings.0, |this, p| {+ this.child(p.border_r_1())+ })+ .child(self.center.render(+ self.zoomed.as_ref(),+ &pane_render_context,+ window,+ cx,+ ))+ .when_some(paddings.1, |this, p| {+ this.child(p.border_l_1())+ }),+ )+ .children(self.render_dock(+ DockPosition::Bottom,+ &self.bottom_dock,+ window,+ cx,+ )),+ )+ .children(self.render_dock(+ DockPosition::Right,+ &self.right_dock,+ window,+ cx,+ )),+ }+ })+ .children(self.zoomed.as_ref().and_then(|view| {+ let zoomed_view = view.upgrade()?;+ let div = div()+ .occlude()+ .absolute()+ .overflow_hidden()+ .border_color(colors.border)+ .bg(colors.background)+ .child(zoomed_view)+ .inset_0()+ .shadow_lg();++ if !WorkspaceSettings::get_global(cx).zoomed_padding {+ return Some(div);+ }- .children(self.render_dock(- DockPosition::Right,- &self.right_dock,- window,- cx,- )),- }+ Some(match self.zoomed_position {+ Some(DockPosition::Left) => div.right_2().border_r_1(),+ Some(DockPosition::Right) => div.left_2().border_l_1(),+ Some(DockPosition::Bottom) => div.top_2().border_t_1(),+ None => div.top_2().bottom_2().left_2().right_2().border_1(),})- .children(self.zoomed.as_ref().and_then(|view| {- let zoomed_view = view.upgrade()?;- let div = div()- .occlude()- .absolute()- .overflow_hidden()- .border_color(colors.border)- .bg(colors.background)- .child(zoomed_view)- .inset_0()- .shadow_lg();-- if !WorkspaceSettings::get_global(cx).zoomed_padding {- return Some(div);- }-- Some(match self.zoomed_position {- Some(DockPosition::Left) => div.right_2().border_r_1(),- Some(DockPosition::Right) => div.left_2().border_l_1(),- Some(DockPosition::Bottom) => div.top_2().border_t_1(),- None => {- div.top_2().bottom_2().left_2().right_2().border_1()- }- })- }))- .children(self.render_notifications(window, cx)),- )- .when(self.status_bar_visible(cx), |parent| {- parent.child(self.status_bar.clone())- })- .child(self.toast_layer.clone()),- )+ }))+ .children(self.render_notifications(window, cx)),+ )+ .when(self.status_bar_visible(cx), |parent| {+ parent.child(self.status_bar.clone())+ })+ .child(self.toast_layer.clone()),+ )}}diff --git a/tooling/xtask/src/tasks/workflows/run_tests.rs b/tooling/xtask/src/tasks/workflows/run_tests.rsindex 9ab52a0c564..8de3460f6da 100644--- a/tooling/xtask/src/tasks/workflows/run_tests.rs+++ b/tooling/xtask/src/tasks/workflows/run_tests.rs@@ -477,13 +477,14 @@ fn check_wasm() -> NamedJob {fn cargo_check_wasm() -> Step<Run> {named::bash(concat!(- "cargo +nightly -Zbuild-std=std,panic_abort ",+ "cargo -Zbuild-std=std,panic_abort ","check --target wasm32-unknown-unknown -p gpui_platform",)).add_env(("CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUSTFLAGS","-C target-feature=+atomics,+bulk-memory,+mutable-globals",))+ .add_env(("RUSTC_BOOTSTRAP", "1"))}named::job(