Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[workspace]
members = ["crates/embed-resource", "crates/herdr-client", "crates/herdr-gpui", "crates/herdr-gpui-launcher", "crates/herdr-protocol"]
# Vendored third-party crates keep their upstream layout and lint baseline.
exclude = ["vendor/gpui-pre-linux"]
resolver = "2"

[workspace.package]
Expand Down Expand Up @@ -138,3 +140,6 @@ zeroize = "=1.9.1"
# no-op stands in for it. See crates/embed-resource.
[patch.crates-io]
embed-resource = { path = "crates/embed-resource" }
# Unmodified gpui-pre-linux 0.3.6 (zed@bcf6582), vendored so Linux platform
# fixes can ship before a gpui-pre release carries them. See vendor/README.md.
gpui-pre-linux = { path = "vendor/gpui-pre-linux" }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Nix builds lose required source

The new path patch requires vendor/gpui-pre-linux, but flake.nix copies an explicit list of source directories that leaves out vendor. Cargo cannot find vendor/gpui-pre-linux/Cargo.toml, so the Nix package fails before compilation. Add the vendored crate to the Nix source list alongside this patch.

3 changes: 2 additions & 1 deletion scripts/check-file-size.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# Fail when a tracked source file (Rust, Python, shell, Swift) exceeds MAX_LINES.
# There is no allowlist: split an oversized file by responsibility instead.
# Third-party crates under vendor/ keep their upstream layout and are skipped.

set -euo pipefail

Expand All @@ -17,7 +18,7 @@ while IFS= read -r -d '' file; do
echo "FAIL: $file has $lines lines (limit $MAX_LINES)"
failures=$((failures + 1))
fi
done < <(git ls-files -z -- '*.rs' '*.py' '*.sh' '*.swift')
done < <(git ls-files -z -- '*.rs' '*.py' '*.sh' '*.swift' ':(exclude)vendor/**')

if ((failures > 0)); then
echo
Expand Down
13 changes: 13 additions & 0 deletions vendor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Vendored crates

## gpui-pre-linux

`gpui-pre-linux` 0.3.6 from crates.io, Zed's `gpui_linux` crate at
zed-industries/zed@bcf6582ce3500df93a8a39366640173e6786cea6. It replaces the
registry crate through `[patch.crates-io]` in the workspace `Cargo.toml` and
is excluded from the workspace, so it keeps its upstream layout.

The first commit adding it is a byte-for-byte copy of the published crate
(without the registry's `Cargo.toml.orig` and `.cargo-ok`). Later commits carry
only fixes that are also proposed upstream to Zed; drop the vendored copy once
a `gpui-pre` release includes them.
307 changes: 307 additions & 0 deletions vendor/gpui-pre-linux/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,307 @@
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.

[package]
edition = "2024"
name = "gpui-pre-linux"
version = "0.3.6"
build = false
publish = true
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Zed's `gpui_linux` crate (gpui-pre snapshot of zed@bcf6582)"
readme = false
license = "Apache-2.0"
repository = "https://github.com/zed-industries/zed"
resolver = "2"

[package.metadata.cargo-shear]
ignored = [
"bitflags",
"scap",
"x11-clipboard",
]

[package.metadata.gpui-pre]
zed-crate = "gpui_linux"
zed-version = "0.1.0"
zed-rev = "bcf6582ce3500df93a8a39366640173e6786cea6"

[features]
default = [
"wayland",
"x11",
]
screen-capture = [
"gpui/screen-capture",
"scap",
]
test-support = ["gpui/test-support"]
wayland = [
"bitflags",
"gpui_wgpu",
"ashpd/wayland",
"calloop-wayland-source",
"wayland-backend",
"wayland-client",
"wayland-cursor",
"wayland-protocols",
"wayland-protocols-plasma",
"wayland-protocols-wlr",
"filedescriptor",
"xkbcommon/wayland",
"open",
"gpui/wayland",
]
x11 = [
"gpui_wgpu",
"ashpd",
"as-raw-xcb-connection",
"x11rb",
"xkbcommon/x11",
"xim",
"x11-clipboard",
"filedescriptor",
"open",
"scap?/x11",
]

[lib]
name = "gpui_linux"
path = "src/gpui_linux.rs"
doctest = false

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.accesskit]
version = "0.24.0"
features = ["enumn"]

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.accesskit_unix]
version = "0.22"

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.anyhow]
version = "1.0.86"

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.as-raw-xcb-connection]
version = "1"
optional = true

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.ashpd]
version = "0.13"
features = [
"async-io",
"inhibit",
"notification",
"open_uri",
"file_chooser",
"settings",
"trash",
]
optional = true
default-features = false

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.bitflags]
version = "2.6.0"
optional = true

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.bytemuck]
version = "1"

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.calloop]
version = "0.14.3"

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.calloop-wayland-source]
version = "0.4.1"
optional = true

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.collections]
version = "=0.3.6"
package = "gpui-pre-collections"

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.filedescriptor]
version = "0.8.2"
optional = true

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.futures]
version = "0.3.34"

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.gpui]
version = "=0.3.6"
default-features = false
package = "gpui-pre"

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.gpui_util]
version = "=0.3.6"
package = "gpui-pre-util"

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.gpui_wgpu]
version = "=0.3.6"
features = ["font-kit"]
optional = true
package = "gpui-pre-wgpu"

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.http_client]
version = "=0.3.6"
package = "gpui-pre-http-client"

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.libc]
version = "0.2"

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.log]
version = "0.4.16"
features = [
"kv_unstable_serde",
"serde",
]

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.notify-rust]
version = "4"

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.oo7]
version = "0.6"
features = [
"async-std",
"native_crypto",
]
default-features = false

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.open]
version = "5.2.0"
optional = true

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.parking_lot]
version = "0.12.1"

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.raw-window-handle]
version = "0.6"

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.scap]
version = "0.0.8-zed"
optional = true
default-features = false
package = "zed-scap"

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.smallvec]
version = "1.6"
features = [
"union",
"const_new",
]

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.smol]
version = "2.0"

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.strum]
version = "0.28"
features = ["derive"]

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.url]
version = "2.2"

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.uuid]
version = "1.1.2"
features = [
"v4",
"v5",
"v7",
"serde",
]

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.wayland-backend]
version = "0.3.15"
features = [
"client_system",
"dlopen",
"log",
]
optional = true

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.wayland-client]
version = "0.31.11"
optional = true

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.wayland-cursor]
version = "0.31.11"
optional = true

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.wayland-protocols]
version = "0.32.9"
features = [
"client",
"staging",
"unstable",
]
optional = true

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.wayland-protocols-plasma]
version = "0.3.9"
features = ["client"]
optional = true

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.wayland-protocols-wlr]
version = "0.3.9"
features = ["client"]
optional = true

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.x11-clipboard]
version = "0.9.3"
optional = true

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.x11rb]
version = "0.13.1"
features = [
"allow-unsafe-code",
"xkb",
"randr",
"xinput",
"cursor",
"resource_manager",
"sync",
"dri3",
]
optional = true

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.xim]
version = "0.4.0-zed"
features = [
"x11rb-xcb",
"x11rb-client",
]
optional = true
package = "zed-xim"

[target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies.xkbcommon]
version = "0.8.0"
optional = true
default-features = false

[lints.clippy]
dbg_macro = "deny"
declare_interior_mutable_const = "deny"
disallowed_methods = "deny"
large_enum_variant = "allow"
let_underscore_future = "allow"
nonminimal_bool = "allow"
redundant_clone = "deny"
single_range_in_vec_init = "allow"
todo = "deny"
too_many_arguments = "allow"
type_complexity = "allow"

[lints.clippy.style]
level = "allow"
priority = -1

[lints.rust.unexpected_cfgs]
level = "allow"
priority = 0
Loading
Loading