mirror of
https://github.com/zed-industries/zed.git
synced 2026-10-20 11:46:49 +00:00
parent
bda9c0bd43
commit
4c841aaf1c
8 changed files with 67 additions and 68 deletions
2
.github/workflows/run_tests.yml
vendored
2
.github/workflows/run_tests.yml
vendored
|
|
@ -616,6 +616,8 @@ jobs:
|
|||
run: cargo build -p collab
|
||||
- name: cargo build --workspace --bins --examples
|
||||
run: cargo build --workspace --bins --examples
|
||||
- name: cargo build -p project_benchmarks --features test-support
|
||||
run: cargo build -p project_benchmarks --features test-support
|
||||
- name: steps::show_sccache_stats
|
||||
run: sccache --show-stats || true
|
||||
- name: steps::cleanup_cargo_config
|
||||
|
|
|
|||
62
Cargo.lock
generated
62
Cargo.lock
generated
|
|
@ -20645,7 +20645,6 @@ dependencies = [
|
|||
"url",
|
||||
"wasmtime",
|
||||
"wasmtime-wasi-io",
|
||||
"wiggle",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
|
|
@ -20662,15 +20661,6 @@ dependencies = [
|
|||
"wasmtime",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wast"
|
||||
version = "35.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2ef140f1b49946586078353a453a1d28ba90adfc54dde75710bc1931de204d68"
|
||||
dependencies = [
|
||||
"leb128",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "watch"
|
||||
version = "0.1.0"
|
||||
|
|
@ -21132,46 +21122,6 @@ dependencies = [
|
|||
"wasite",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wiggle"
|
||||
version = "48.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b871ea219ad85c1e59ee7d013563814e86d2e6aa094d3bc66b7675ec4ca58bb7"
|
||||
dependencies = [
|
||||
"bitflags 2.13.1",
|
||||
"thiserror 2.0.17",
|
||||
"tracing",
|
||||
"wasmtime",
|
||||
"wasmtime-environ",
|
||||
"wiggle-macro",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wiggle-generate"
|
||||
version = "48.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ed981675756e748a4725286a4059c9be006749a8db4120d54e2021d0f167bac3"
|
||||
dependencies = [
|
||||
"heck 0.5.0",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.117",
|
||||
"wasmtime-environ",
|
||||
"witx",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wiggle-macro"
|
||||
version = "48.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7f3927729af874585c58b85710128e40d459a7064bb9aea9b0b420fb5eafd555"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.117",
|
||||
"wiggle-generate",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "winapi"
|
||||
version = "0.3.9"
|
||||
|
|
@ -22332,18 +22282,6 @@ dependencies = [
|
|||
"wasmparser 0.254.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "witx"
|
||||
version = "0.9.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e366f27a5cabcddb2706a78296a40b8fcc451e1a6aba2fc1d94b4a01bdaaef4b"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"log",
|
||||
"thiserror 1.0.69",
|
||||
"wast",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "workspace"
|
||||
version = "0.1.0"
|
||||
|
|
|
|||
10
Cargo.toml
10
Cargo.toml
|
|
@ -552,13 +552,17 @@ async-task = "4.7"
|
|||
async-trait = "0.1"
|
||||
async-tungstenite = "0.33"
|
||||
async_zip = { version = "0.0.18", features = ["deflate", "deflate64"] }
|
||||
aws-config = { version = "1.8.10", features = ["behavior-version-latest"] }
|
||||
aws-config = { version = "1.8.10", default-features = false, features = [
|
||||
"behavior-version-latest",
|
||||
"credentials-process",
|
||||
"rt-tokio",
|
||||
"sso",
|
||||
] }
|
||||
aws-credential-types = { version = "1.2.8", features = [
|
||||
"hardcoded-credentials",
|
||||
] }
|
||||
aws-sdk-bedrockruntime = { version = "1.112.0", default-features = false, features = [
|
||||
"behavior-version-latest",
|
||||
"default-https-client",
|
||||
"rt-tokio",
|
||||
] }
|
||||
aws-sigv4 = { version = "1.4.0", features = ["http1"] }
|
||||
|
|
@ -922,7 +926,7 @@ wasmtime = { version = "48", default-features = false, features = [
|
|||
] }
|
||||
wasm-bindgen = "0.2.120"
|
||||
wasm-bindgen-futures = "0.4"
|
||||
wasmtime-wasi = "48"
|
||||
wasmtime-wasi = { version = "48", default-features = false, features = ["p2"] }
|
||||
wax = "0.7"
|
||||
web-time = "1.1.0"
|
||||
webpki-roots = "1.0.8"
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ collections.workspace = true
|
|||
futures.workspace = true
|
||||
futures-lite.workspace = true
|
||||
gpui.workspace = true
|
||||
http_client = { workspace = true, features = ["test-support"] }
|
||||
http_client.workspace = true
|
||||
log.workspace = true
|
||||
net.workspace = true
|
||||
oauth_callback_server.workspace = true
|
||||
|
|
@ -43,3 +43,4 @@ util.workspace = true
|
|||
|
||||
[dev-dependencies]
|
||||
gpui = { workspace = true, features = ["test-support"] }
|
||||
http_client = { workspace = true, features = ["test-support"] }
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ gpui = { workspace = true, features = ["screen-capture", "x11", "wayland"] }
|
|||
gpui_tokio.workspace = true
|
||||
http_client_tls.workspace = true
|
||||
image.workspace = true
|
||||
livekit_api.workspace = true
|
||||
livekit_api = { workspace = true, optional = true }
|
||||
log.workspace = true
|
||||
nanoid.workspace = true
|
||||
parking_lot.workspace = true
|
||||
|
|
@ -43,6 +43,9 @@ smallvec.workspace = true
|
|||
ui.workspace = true
|
||||
util.workspace = true
|
||||
|
||||
[target.'cfg(any(all(target_os = "windows", target_env = "gnu"), target_os = "freebsd"))'.dependencies]
|
||||
livekit_api.workspace = true
|
||||
|
||||
[target.'cfg(not(any(all(target_os = "windows", target_env = "gnu"), target_os = "freebsd")))'.dependencies]
|
||||
libwebrtc.workspace = true
|
||||
livekit.workspace = true
|
||||
|
|
|
|||
|
|
@ -4,6 +4,14 @@ version = "0.1.0"
|
|||
publish.workspace = true
|
||||
edition.workspace = true
|
||||
|
||||
[features]
|
||||
test-support = ["http_client/test-support"]
|
||||
|
||||
[[bin]]
|
||||
name = "project_benchmarks"
|
||||
path = "src/main.rs"
|
||||
required-features = ["test-support"]
|
||||
|
||||
[dependencies]
|
||||
anyhow.workspace = true
|
||||
askpass.workspace = true
|
||||
|
|
@ -12,7 +20,7 @@ client.workspace = true
|
|||
futures.workspace = true
|
||||
gpui.workspace = true
|
||||
gpui_platform.workspace = true
|
||||
http_client = { workspace = true, features = ["test-support"]}
|
||||
http_client.workspace = true
|
||||
language.workspace = true
|
||||
node_runtime.workspace = true
|
||||
project.workspace = true
|
||||
|
|
|
|||
|
|
@ -613,6 +613,9 @@ fn check_workspace_binaries() -> NamedJob {
|
|||
.add_step(steps::setup_sccache(Platform::Linux))
|
||||
.add_step(steps::script("cargo build -p collab"))
|
||||
.add_step(steps::script("cargo build --workspace --bins --examples"))
|
||||
.add_step(steps::script(
|
||||
"cargo build -p project_benchmarks --features test-support",
|
||||
))
|
||||
.add_step(steps::show_sccache_stats(Platform::Linux))
|
||||
.add_step(steps::cleanup_cargo_config(Platform::Linux)),
|
||||
))
|
||||
|
|
|
|||
|
|
@ -66,6 +66,46 @@ mod tests {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn no_test_support_in_non_dev_dependencies() {
|
||||
let workspace = load_workspace().expect("failed to load cargo metadata");
|
||||
let mut violations = Vec::new();
|
||||
|
||||
for package in workspace.workspace_packages() {
|
||||
for dependency in &package.dependencies {
|
||||
if dependency.kind == DependencyKind::Development
|
||||
|| !dependency
|
||||
.features
|
||||
.iter()
|
||||
.any(|feature| feature == "test-support")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
let manifest = package
|
||||
.manifest_path
|
||||
.strip_prefix(&workspace.workspace_root)
|
||||
.unwrap_or(&package.manifest_path);
|
||||
let name = dependency.rename.as_deref().unwrap_or(&dependency.name);
|
||||
let target = dependency
|
||||
.target
|
||||
.as_ref()
|
||||
.map(|target| format!(" for {target}"))
|
||||
.unwrap_or_default();
|
||||
violations.push(format!(
|
||||
"{manifest}: `{name}` enables `test-support` in {:?} dependencies{target}",
|
||||
dependency.kind,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
assert!(
|
||||
violations.is_empty(),
|
||||
"non-dev dependencies must not enable `test-support`; \
|
||||
use dev-dependencies or explicit feature forwarding instead:\n{violations:?}",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn no_forbidden_dependencies_between_feature_crates() {
|
||||
let workspace = load_workspace().expect("failed to load cargo metadata");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue