From bf71c690a36b888496f10f29c95288290cb3c6c8 Mon Sep 17 00:00:00 2001 From: Miles Wirht <114884788+philocalyst@users.noreply.github.com> Date: Sun, 14 Jun 2026 21:58:25 -0400 Subject: [PATCH] Utopian CI setup phase 2: Better HTTP abstractions (#61) --- Cargo.lock | 1012 +---------------- Cargo.toml | 8 +- crates/gpui/Cargo.toml | 7 +- crates/gpui/examples/legacy/image/image.rs | 5 +- crates/gpui/src/app.rs | 25 +- crates/gpui/src/app/headless_app_context.rs | 2 +- crates/gpui/src/app/test_app.rs | 2 +- crates/gpui/src/app/test_context.rs | 2 +- crates/gpui/src/app/visual_test_context.rs | 2 +- crates/gpui/src/elements/img.rs | 40 +- crates/gpui/src/executor.rs | 2 +- crates/gpui/src/gpui.rs | 3 +- crates/gpui/src/http_client.rs | 105 ++ crates/gpui_linux/Cargo.toml | 1 - crates/gpui_linux/src/linux/wayland/client.rs | 2 +- crates/gpui_linux/src/linux/x11/client.rs | 2 +- crates/gpui_web/src/http_client.rs | 140 +-- 17 files changed, 196 insertions(+), 1164 deletions(-) create mode 100644 crates/gpui/src/http_client.rs diff --git a/Cargo.lock b/Cargo.lock index 7e60889886..de1f1973c0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -67,7 +67,7 @@ checksum = "b016ca8db0ea0ea2ceff29a9d6240391492d960716aa471967c00e8cc8cb197c" dependencies = [ "accesskit", "accesskit_atspi_common", - "async-channel 2.5.0", + "async-channel", "async-executor", "async-task", "atspi", @@ -303,23 +303,12 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" dependencies = [ - "event-listener 5.4.1", + "event-listener", "event-listener-strategy", "futures-core", "pin-project-lite", ] -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", -] - [[package]] name = "async-channel" version = "2.5.0" @@ -370,21 +359,6 @@ dependencies = [ "futures-lite 2.6.1", ] -[[package]] -name = "async-global-executor" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" -dependencies = [ - "async-channel 2.5.0", - "async-executor", - "async-io", - "async-lock", - "blocking", - "futures-lite 2.6.1", - "once_cell", -] - [[package]] name = "async-io" version = "2.6.0" @@ -409,7 +383,7 @@ version = "3.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311" dependencies = [ - "event-listener 5.4.1", + "event-listener", "event-listener-strategy", "pin-project-lite", ] @@ -431,14 +405,14 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75" dependencies = [ - "async-channel 2.5.0", + "async-channel", "async-io", "async-lock", "async-signal", "async-task", "blocking", "cfg-if", - "event-listener 5.4.1", + "event-listener", "futures-lite 2.6.1", "rustix 1.1.2", ] @@ -472,47 +446,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "async-std" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c8e079a4ab67ae52b7403632e4618815d6db36d2a010cfe41b02c1b1578f93b" -dependencies = [ - "async-channel 1.9.0", - "async-global-executor", - "async-io", - "async-lock", - "async-process", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite 2.6.1", - "gloo-timers", - "kv-log-macro", - "log", - "memchr", - "once_cell", - "pin-project-lite", - "pin-utils", - "slab", - "wasm-bindgen-futures", -] - -[[package]] -name = "async-tar" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1937db2d56578aa3919b9bdb0e5100693fd7d1c0f145c53eb81fbb03e217550" -dependencies = [ - "async-std", - "filetime", - "libc", - "pin-project", - "redox_syscall 0.2.16", - "xattr", -] - [[package]] name = "async-task" version = "4.7.1" @@ -621,28 +554,6 @@ dependencies = [ "arrayvec", ] -[[package]] -name = "aws-lc-rs" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ec2f1fc3ec205783a5da9a7e6c1509cc69dedf09a1949e412c1e18469326d00" -dependencies = [ - "aws-lc-sys", - "zeroize", -] - -[[package]] -name = "aws-lc-sys" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a2f9779ce85b93ab6170dd940ad0169b5766ff848247aff13bb788b832fe3f4" -dependencies = [ - "cc", - "cmake", - "dunce", - "fs_extra", -] - [[package]] name = "backtrace" version = "0.3.76" @@ -792,7 +703,7 @@ version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e83f8d02be6967315521be875afa792a316e28d57b5a2d401897e2a7921b7f21" dependencies = [ - "async-channel 2.5.0", + "async-channel", "async-task", "futures-io", "futures-lite 2.6.1", @@ -869,15 +780,6 @@ version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" -[[package]] -name = "bzip2" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3a53fac24f34a81bc9954b5d6cfce0c21e18ec6959f44f56e8e90e4bb7c346c" -dependencies = [ - "libbz2-rs-sys", -] - [[package]] name = "calloop" version = "0.14.4" @@ -948,12 +850,6 @@ dependencies = [ "shlex", ] -[[package]] -name = "cesu8" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" - [[package]] name = "cexpr" version = "0.6.0" @@ -1082,15 +978,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" -[[package]] -name = "cmake" -version = "0.1.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678" -dependencies = [ - "cc", -] - [[package]] name = "cocoa" version = "0.25.0" @@ -1192,16 +1079,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" -[[package]] -name = "combine" -version = "4.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" -dependencies = [ - "bytes", - "memchr", -] - [[package]] name = "command-fds" version = "0.3.2" @@ -1218,11 +1095,9 @@ version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef8a506ec4b81c460798f572caead636d57d3d7e940f998160f52bd254bf2d23" dependencies = [ - "bzip2", "compression-core", "deflate64", "flate2", - "memchr", ] [[package]] @@ -1869,12 +1744,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - [[package]] name = "event-listener" version = "5.4.1" @@ -1892,7 +1761,7 @@ version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" dependencies = [ - "event-listener 5.4.1", + "event-listener", "pin-project-lite", ] @@ -1966,18 +1835,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "filetime" -version = "0.2.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc0505cd1b6fa6580283f6bdf70a73fcf4aba1184038c90902b92b3dd0df63ed" -dependencies = [ - "cfg-if", - "libc", - "libredox", - "windows-sys 0.60.2", -] - [[package]] name = "find-msvc-tools" version = "0.1.5" @@ -2136,12 +1993,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "fs_extra" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" - [[package]] name = "futf" version = "0.1.5" @@ -2387,18 +2238,6 @@ dependencies = [ "regex-syntax", ] -[[package]] -name = "gloo-timers" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - [[package]] name = "glow" version = "0.17.0" @@ -2460,7 +2299,7 @@ version = "0.2.2" dependencies = [ "accesskit", "anyhow", - "async-channel 2.5.0", + "async-channel", "async-task", "backtrace", "bindgen", @@ -2491,7 +2330,7 @@ dependencies = [ "gpui_util", "gpui_web", "hdrhistogram", - "http_client", + "http", "image", "inventory", "itertools 0.14.0", @@ -2512,11 +2351,10 @@ dependencies = [ "postage", "profiling", "proptest", - "rand 0.9.2", + "rand 0.9.4", "raw-window-handle", "refineable", "regex", - "reqwest_client", "resvg", "scheduler", "schemars", @@ -2571,7 +2409,6 @@ dependencies = [ "futures", "gpui", "gpui_wgpu", - "http_client", "image", "itertools 0.14.0", "libc", @@ -2707,7 +2544,7 @@ dependencies = [ "futures", "gpui", "gpui_wgpu", - "http_client", + "http", "js-sys", "log", "parking_lot", @@ -2728,6 +2565,7 @@ dependencies = [ "anyhow", "bytemuck", "collections 0.1.0 (git+https://github.com/zed-industries/zed?rev=876ec5a8a074ba83cce2129ed4d76b59c05a37e9)", + "core-video", "cosmic-text", "criterion", "etagere", @@ -2765,7 +2603,7 @@ dependencies = [ "itertools 0.14.0", "log", "parking_lot", - "rand 0.9.2", + "rand 0.9.4", "raw-window-handle", "smallvec", "util", @@ -2773,7 +2611,7 @@ dependencies = [ "windows 0.61.3", "windows-core 0.61.2", "windows-numerics 0.2.0", - "windows-registry 0.5.3", + "windows-registry", "zed-scap", ] @@ -2783,25 +2621,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b40ca9252762c466af32d0b1002e91e4e1bc5398f77455e55474deb466355ff5" -[[package]] -name = "h2" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "171fefbc92fe4a4de27e0698d6a5b392d6a0e333506bc49133760b3bcf948733" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "half" version = "2.7.1" @@ -2954,126 +2773,6 @@ dependencies = [ "itoa", ] -[[package]] -name = "http-body" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" -dependencies = [ - "bytes", - "http", -] - -[[package]] -name = "http-body-util" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" -dependencies = [ - "bytes", - "futures-core", - "http", - "http-body", - "pin-project-lite", -] - -[[package]] -name = "http_client" -version = "0.1.0" -source = "git+https://github.com/zed-industries/zed?rev=876ec5a8a074ba83cce2129ed4d76b59c05a37e9#876ec5a8a074ba83cce2129ed4d76b59c05a37e9" -dependencies = [ - "anyhow", - "async-compression", - "async-fs", - "async-tar", - "bytes", - "derive_more", - "futures", - "http", - "http-body", - "log", - "parking_lot", - "serde", - "serde_json", - "serde_urlencoded", - "sha2", - "tempfile", - "url", - "util", -] - -[[package]] -name = "http_client_tls" -version = "0.1.0" -source = "git+https://github.com/zed-industries/zed?rev=876ec5a8a074ba83cce2129ed4d76b59c05a37e9#876ec5a8a074ba83cce2129ed4d76b59c05a37e9" -dependencies = [ - "rustls", - "rustls-platform-verifier", -] - -[[package]] -name = "httparse" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" - -[[package]] -name = "hyper" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55281c53a1894c864990125767da440a4e630446785086f52523b20033b74498" -dependencies = [ - "atomic-waker", - "bytes", - "futures-channel", - "futures-core", - "h2", - "http", - "http-body", - "httparse", - "itoa", - "pin-project-lite", - "smallvec", - "tokio", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.27.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" -dependencies = [ - "http", - "hyper", - "hyper-util", - "rustls", - "rustls-native-certs", - "tokio", - "tokio-rustls", - "tower-service", -] - -[[package]] -name = "hyper-util" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http", - "http-body", - "hyper", - "libc", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", -] - [[package]] name = "iana-time-zone" version = "0.1.65" @@ -3320,12 +3019,6 @@ dependencies = [ "leaky-cow", ] -[[package]] -name = "ipnet" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" - [[package]] name = "is-docker" version = "0.2.0" @@ -3419,22 +3112,6 @@ dependencies = [ "syn", ] -[[package]] -name = "jni" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" -dependencies = [ - "cesu8", - "cfg-if", - "combine", - "jni-sys", - "log", - "thiserror 1.0.69", - "walkdir", - "windows-sys 0.45.0", -] - [[package]] name = "jni-sys" version = "0.3.0" @@ -3491,15 +3168,6 @@ dependencies = [ "smallvec", ] -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - [[package]] name = "lazy_static" version = "1.5.0" @@ -3533,12 +3201,6 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a79a3332a6609480d7d0c9eab957bca6b455b91bb84e66d19f5ff66294b85b8" -[[package]] -name = "libbz2-rs-sys" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34b357333733e8260735ba5894eb928c02ecc69c78715f01a8019e7fa7f2db4c" - [[package]] name = "libc" version = "0.2.182" @@ -3579,7 +3241,6 @@ checksum = "416f7e718bdb06000964960ffa43b4335ad4012ae8b99060261aa4a8088d5ccb" dependencies = [ "bitflags 2.10.0", "libc", - "redox_syscall 0.5.18", ] [[package]] @@ -3652,12 +3313,6 @@ dependencies = [ "imgref", ] -[[package]] -name = "lru-slab" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" - [[package]] name = "lyon" version = "1.0.16" @@ -3819,22 +3474,6 @@ dependencies = [ "paste", ] -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "mime_guess" -version = "2.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" -dependencies = [ - "mime", - "unicase", -] - [[package]] name = "minimal-lexical" version = "0.2.1" @@ -3851,17 +3490,6 @@ dependencies = [ "simd-adler32", ] -[[package]] -name = "mio" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" -dependencies = [ - "libc", - "wasi", - "windows-sys 0.61.2", -] - [[package]] name = "moxcms" version = "0.7.7" @@ -4014,7 +3642,7 @@ dependencies = [ "num-iter", "num-traits", "once_cell", - "rand 0.9.2", + "rand 0.9.4", "serde", "smallvec", "zeroize", @@ -4370,12 +3998,6 @@ dependencies = [ "pathdiff", ] -[[package]] -name = "openssl-probe" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" - [[package]] name = "option-ext" version = "0.2.0" @@ -4425,7 +4047,7 @@ checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.18", + "redox_syscall", "smallvec", "windows-link 0.2.1", ] @@ -4562,12 +4184,6 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - [[package]] name = "piper" version = "0.2.4" @@ -4740,28 +4356,6 @@ dependencies = [ "toml_edit 0.23.7", ] -[[package]] -name = "proc-macro-error-attr2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" -dependencies = [ - "proc-macro2", - "quote", -] - -[[package]] -name = "proc-macro-error2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" -dependencies = [ - "proc-macro-error-attr2", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "proc-macro2" version = "1.0.106" @@ -4800,7 +4394,7 @@ dependencies = [ "bitflags 2.10.0", "num-traits", "proptest-macro", - "rand 0.9.2", + "rand 0.9.4", "rand_chacha 0.9.0", "rand_xorshift", "regex-syntax", @@ -4888,61 +4482,6 @@ dependencies = [ "serde", ] -[[package]] -name = "quinn" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" -dependencies = [ - "bytes", - "cfg_aliases", - "pin-project-lite", - "quinn-proto", - "quinn-udp", - "rustc-hash 2.1.1", - "rustls", - "socket2", - "thiserror 2.0.17", - "tokio", - "tracing", - "web-time", -] - -[[package]] -name = "quinn-proto" -version = "0.11.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" -dependencies = [ - "bytes", - "getrandom 0.3.4", - "lru-slab", - "rand 0.9.2", - "ring", - "rustc-hash 2.1.1", - "rustls", - "rustls-pki-types", - "slab", - "thiserror 2.0.17", - "tinyvec", - "tracing", - "web-time", -] - -[[package]] -name = "quinn-udp" -version = "0.5.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" -dependencies = [ - "cfg_aliases", - "libc", - "once_cell", - "socket2", - "tracing", - "windows-sys 0.60.2", -] - [[package]] name = "quote" version = "1.0.45" @@ -4966,9 +4505,9 @@ checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" [[package]] name = "rand" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" dependencies = [ "libc", "rand_chacha 0.3.1", @@ -4977,9 +4516,9 @@ dependencies = [ [[package]] name = "rand" -version = "0.9.2" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.3", @@ -5070,7 +4609,7 @@ dependencies = [ "once_cell", "paste", "profiling", - "rand 0.8.5", + "rand 0.8.6", "rand_chacha 0.3.1", "simd_helpers", "system-deps", @@ -5153,15 +4692,6 @@ dependencies = [ "font-types 0.11.1", ] -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.5.18" @@ -5245,24 +4775,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" -[[package]] -name = "reqwest_client" -version = "0.1.0" -source = "git+https://github.com/zed-industries/zed?rev=876ec5a8a074ba83cce2129ed4d76b59c05a37e9#876ec5a8a074ba83cce2129ed4d76b59c05a37e9" -dependencies = [ - "anyhow", - "bytes", - "futures", - "gpui_util", - "http_client", - "http_client_tls", - "log", - "regex", - "serde", - "tokio", - "zed-reqwest", -] - [[package]] name = "resvg" version = "0.45.1" @@ -5289,20 +4801,6 @@ dependencies = [ "bytemuck", ] -[[package]] -name = "ring" -version = "0.17.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" -dependencies = [ - "cc", - "cfg-if", - "getrandom 0.2.16", - "libc", - "untrusted", - "windows-sys 0.52.0", -] - [[package]] name = "roxmltree" version = "0.20.0" @@ -5397,92 +4895,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "rustls" -version = "0.23.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef86cd5876211988985292b91c96a8f2d298df24e75989a43a3c73f2d4d8168b" -dependencies = [ - "aws-lc-rs", - "log", - "once_cell", - "ring", - "rustls-pki-types", - "rustls-webpki", - "subtle", - "zeroize", -] - -[[package]] -name = "rustls-native-certs" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" -dependencies = [ - "openssl-probe", - "rustls-pki-types", - "schannel", - "security-framework", -] - -[[package]] -name = "rustls-pemfile" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" -dependencies = [ - "rustls-pki-types", -] - -[[package]] -name = "rustls-pki-types" -version = "1.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a7197ae7eb376e574fe940d068c30fe0462554a3ddbe4eca7838e049c937a9" -dependencies = [ - "web-time", - "zeroize", -] - -[[package]] -name = "rustls-platform-verifier" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19787cda76408ec5404443dc8b31795c87cd8fec49762dc75fa727740d34acc1" -dependencies = [ - "core-foundation 0.10.0", - "core-foundation-sys", - "jni", - "log", - "once_cell", - "rustls", - "rustls-native-certs", - "rustls-platform-verifier-android", - "rustls-webpki", - "security-framework", - "security-framework-sys", - "webpki-root-certs 0.26.11", - "windows-sys 0.59.0", -] - -[[package]] -name = "rustls-platform-verifier-android" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" - -[[package]] -name = "rustls-webpki" -version = "0.103.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" -dependencies = [ - "aws-lc-rs", - "ring", - "rustls-pki-types", - "untrusted", -] - [[package]] name = "rustversion" version = "1.0.22" @@ -5534,15 +4946,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "schannel" -version = "0.1.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" -dependencies = [ - "windows-sys 0.61.2", -] - [[package]] name = "scheduler" version = "0.1.0" @@ -5554,7 +4957,7 @@ dependencies = [ "flume", "futures", "parking_lot", - "rand 0.9.2", + "rand 0.9.4", "web-time", ] @@ -5625,29 +5028,6 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" -[[package]] -name = "security-framework" -version = "3.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d17b898a6d6948c3a8ee4372c17cb384f90d2e6e912ef00895b14fd7ab54ec38" -dependencies = [ - "bitflags 2.10.0", - "core-foundation 0.10.0", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "self_cell" version = "1.2.2" @@ -5780,18 +5160,6 @@ dependencies = [ "serde_core", ] -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - [[package]] name = "sha1_smol" version = "1.0.1" @@ -5910,7 +5278,7 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a33bd3e260892199c3ccfc487c88b2da2265080acb316cd920da72fdfd7c599f" dependencies = [ - "async-channel 2.5.0", + "async-channel", "async-executor", "async-fs", "async-io", @@ -5931,16 +5299,6 @@ dependencies = [ "serde_core", ] -[[package]] -name = "socket2" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52d1cfed4120b4d927bf7c0f86d2087a4a7d6027c906d9f9d525a80573b9be51" -dependencies = [ - "libc", - "windows-sys 0.61.2", -] - [[package]] name = "spin" version = "0.9.8" @@ -5976,22 +5334,22 @@ checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "stacker" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d74a23609d509411d10e2176dc2a4346e3b4aea2e7b1869f19fdedbc71c013" +checksum = "640c8cdd92b6b12f5bcb1803ca3bbf5ab96e5e6b6b96b9ab77dabe9e880b3190" dependencies = [ "cc", "cfg-if", "libc", "psm", - "windows-sys 0.59.0", + "windows-sys 0.61.2", ] [[package]] name = "stacksafe" -version = "0.1.4" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d9c1172965d317e87ddb6d364a040d958b40a1db82b6ef97da26253a8b3d090" +checksum = "b738765988c43975135c78ade8b0ee940566ab87d7e324897662b7460c44ab83" dependencies = [ "stacker", "stacksafe-macro", @@ -5999,11 +5357,11 @@ dependencies = [ [[package]] name = "stacksafe-macro" -version = "0.1.4" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "172175341049678163e979d9107ca3508046d4d2a7c6682bee46ac541b17db69" +checksum = "9e30778b21fdee0c7dbfcf5cfc2d9e2a0dbc135faf7093c245bf19f088f9fa10" dependencies = [ - "proc-macro-error2", + "proc-macro2", "quote", "syn", ] @@ -6178,15 +5536,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "sync_wrapper" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" -dependencies = [ - "futures-core", -] - [[package]] name = "synstructure" version = "0.13.2" @@ -6221,27 +5570,6 @@ dependencies = [ "windows 0.57.0", ] -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags 2.10.0", - "core-foundation 0.9.4", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "system-deps" version = "6.2.2" @@ -6463,47 +5791,7 @@ version = "1.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27ad5e34374e03cfffefc301becb44e9dc3c17584f414349ebe29ed26661822d" dependencies = [ - "bytes", - "libc", - "mio", "pin-project-lite", - "socket2", - "windows-sys 0.61.2", -] - -[[package]] -name = "tokio-rustls" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" -dependencies = [ - "rustls", - "tokio", -] - -[[package]] -name = "tokio-socks" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7e2948f60dbe26b35f2c7fb74ac2854c1fddded0fe9d7548fcc674a246f7615" -dependencies = [ - "either", - "futures-util", - "thiserror 1.0.69", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", ] [[package]] @@ -6598,33 +5886,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df8b2b54733674ad286d16267dcfc7a71ed5c776e4ac7aa3c3e2561f7c637bf2" -[[package]] -name = "tower" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" -dependencies = [ - "futures-core", - "futures-util", - "pin-project-lite", - "sync_wrapper", - "tokio", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-layer" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" - -[[package]] -name = "tower-service" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" - [[package]] name = "tracing" version = "0.1.43" @@ -6683,12 +5944,6 @@ dependencies = [ "tracing-log", ] -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - [[package]] name = "ttf-parser" version = "0.25.1" @@ -6799,12 +6054,6 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - [[package]] name = "url" version = "2.5.7" @@ -7034,15 +6283,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - [[package]] name = "wasi" version = "0.11.1+wasi-snapshot-preview1" @@ -7144,19 +6384,6 @@ dependencies = [ "wasmparser", ] -[[package]] -name = "wasm-streams" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" -dependencies = [ - "futures-util", - "js-sys", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - [[package]] name = "wasm_thread" version = "0.3.3" @@ -7299,24 +6526,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki-root-certs" -version = "0.26.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75c7f0ef91146ebfb530314f5f1d24528d7f0767efbfd31dce919275413e393e" -dependencies = [ - "webpki-root-certs 1.0.7", -] - -[[package]] -name = "webpki-root-certs" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31141ce3fc3e300ae89b78c0dd67f9708061d1d2eda54b8209346fd6be9a92c" -dependencies = [ - "rustls-pki-types", -] - [[package]] name = "weezl" version = "0.1.10" @@ -7728,17 +6937,6 @@ dependencies = [ "windows-link 0.2.1", ] -[[package]] -name = "windows-registry" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3" -dependencies = [ - "windows-result 0.3.4", - "windows-strings 0.3.1", - "windows-targets 0.53.5", -] - [[package]] name = "windows-registry" version = "0.5.3" @@ -7777,15 +6975,6 @@ dependencies = [ "windows-link 0.2.1", ] -[[package]] -name = "windows-strings" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" -dependencies = [ - "windows-link 0.1.3", -] - [[package]] name = "windows-strings" version = "0.4.2" @@ -7804,24 +6993,6 @@ dependencies = [ "windows-link 0.2.1", ] -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-sys" version = "0.59.0" @@ -7849,21 +7020,6 @@ dependencies = [ "windows-link 0.2.1", ] -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-targets" version = "0.52.6" @@ -7915,12 +7071,6 @@ dependencies = [ "windows-link 0.2.1", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" @@ -7933,12 +7083,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" @@ -7951,12 +7095,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -7981,12 +7119,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - [[package]] name = "windows_i686_msvc" version = "0.52.6" @@ -7999,12 +7131,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - [[package]] name = "windows_x86_64_gnu" version = "0.52.6" @@ -8017,12 +7143,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" @@ -8035,12 +7155,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" @@ -8236,15 +7350,6 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea6fc2961e4ef194dcbfe56bb845534d0dc8098940c7e5c012a258bfec6701bd" -[[package]] -name = "xattr" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc" -dependencies = [ - "libc", -] - [[package]] name = "xcb" version = "1.7.0" @@ -8366,7 +7471,7 @@ dependencies = [ "async-trait", "blocking", "enumflags2", - "event-listener 5.4.1", + "event-listener", "futures-core", "futures-lite 2.6.1", "hex", @@ -8471,55 +7576,6 @@ dependencies = [ "yeslogic-fontconfig-sys", ] -[[package]] -name = "zed-reqwest" -version = "0.12.15-zed" -source = "git+https://github.com/zed-industries/reqwest.git?rev=c15662463bda39148ba154100dd44d3fba5873a4#c15662463bda39148ba154100dd44d3fba5873a4" -dependencies = [ - "base64 0.22.1", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-rustls", - "hyper-util", - "ipnet", - "js-sys", - "log", - "mime", - "mime_guess", - "once_cell", - "percent-encoding", - "pin-project-lite", - "quinn", - "rustls", - "rustls-native-certs", - "rustls-pemfile", - "rustls-pki-types", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper", - "system-configuration", - "tokio", - "tokio-rustls", - "tokio-socks", - "tokio-util", - "tower", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-streams", - "web-sys", - "windows-registry 0.4.0", -] - [[package]] name = "zed-scap" version = "0.0.8-zed" @@ -8530,7 +7586,7 @@ dependencies = [ "core-graphics-helmer-fork", "log", "objc", - "rand 0.8.5", + "rand 0.8.6", "screencapturekit", "screencapturekit-sys", "sysinfo", diff --git a/Cargo.toml b/Cargo.toml index e7392b3532..3f1be0109a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,7 +49,7 @@ derive_more = { version = "2.1.1", features = [ ] } futures = "0.3.32" futures-concurrency = "7.7.1" -http_client = { git = "https://github.com/zed-industries/zed", rev = "876ec5a8a074ba83cce2129ed4d76b59c05a37e9" } +http = "1.3" image = "0.25.1" inventory = "0.3.19" itertools = "0.14.0" @@ -59,7 +59,7 @@ postage = { version = "0.5", features = ["futures-traits"] } proptest = { git = "https://github.com/proptest-rs/proptest", rev = "3dca198a8fef1b32e3a66f1e1897c955b4dc5b5b", features = ["attr-macro"] } chrono = { version = "0.4", features = ["serde"] } profiling = "1" -rand = "0.9" +rand = "0.9.4" regex = "1.5" refineable = { git = "https://github.com/zed-industries/zed", rev = "876ec5a8a074ba83cce2129ed4d76b59c05a37e9" } scheduler = { git = "https://github.com/zed-industries/zed", rev = "876ec5a8a074ba83cce2129ed4d76b59c05a37e9" } @@ -70,7 +70,7 @@ serde_json = { version = "1.0.144", features = ["preserve_order", "raw_value"] } slotmap = "1.0.6" smallvec = { version = "1.6", features = ["union", "const_new"] } async-channel = "2.5.0" -stacksafe = "0.1" +stacksafe = "1.0" strum = { version = "0.27.2", features = ["derive"] } sum_tree = { git = "https://github.com/zed-industries/zed" } thiserror = "2.0.12" @@ -91,7 +91,7 @@ metal = "0.33" scap = { git = "https://github.com/zed-industries/scap", rev = "4afea48c3b002197176fb19cd0f9b180dd36eaac", default-features = false, package = "zed-scap", version = "0.0.8-zed" } env_logger = "0.11" unicode-segmentation = "1.10" -reqwest_client = { git = "https://github.com/zed-industries/zed", rev = "876ec5a8a074ba83cce2129ed4d76b59c05a37e9" } + wasm-bindgen = "0.2.120" heck = "0.5" proc-macro2 = "1.0.93" diff --git a/crates/gpui/Cargo.toml b/crates/gpui/Cargo.toml index c46fce8fb9..343512a472 100644 --- a/crates/gpui/Cargo.toml +++ b/crates/gpui/Cargo.toml @@ -21,7 +21,6 @@ default = ["font-kit", "wayland", "x11", "windows-manifest"] test-support = [ "leak-detection", "collections/test-support", - "http_client/test-support", "wayland", "x11", "proptest", @@ -59,7 +58,7 @@ futures.workspace = true futures-concurrency.workspace = true gpui_macros.workspace = true gpui_shared_string.workspace = true -http_client.workspace = true +http.workspace = true image.workspace = true inventory.workspace = true itertools.workspace = true @@ -159,9 +158,7 @@ rand.workspace = true scheduler = { workspace = true, features = ["test-support"] } unicode-segmentation = { workspace = true } -[target.'cfg(not(target_family = "wasm"))'.dev-dependencies] -http_client = { workspace = true, features = ["test-support"] } -reqwest_client = { workspace = true, features = ["test-support"] } + [target.'cfg(target_family = "wasm")'.dev-dependencies] wasm-bindgen = { workspace = true } diff --git a/crates/gpui/examples/legacy/image/image.rs b/crates/gpui/examples/legacy/image/image.rs index 1e7649437d..d3e215af06 100644 --- a/crates/gpui/examples/legacy/image/image.rs +++ b/crates/gpui/examples/legacy/image/image.rs @@ -8,7 +8,7 @@ use gpui::{ Bounds, Context, ImageSource, KeyBinding, Menu, MenuItem, Point, SharedString, SharedUri, TitlebarOptions, Window, WindowBounds, WindowOptions, }; -use reqwest_client::ReqwestClient; +use std::sync::Arc; struct Assets { base: PathBuf, @@ -155,8 +155,7 @@ fn main() { base: manifest_dir.join("examples"), }) .run(move |cx: &mut App| { - let http_client = ReqwestClient::user_agent("gpui example").unwrap(); - cx.set_http_client(Arc::new(http_client)); + cx.set_http_client(Arc::new(gpui::http_client::BlockedHttpClient::new())); cx.activate(true); cx.on_action(|_: &Quit, cx| cx.quit()); diff --git a/crates/gpui/src/app.rs b/crates/gpui/src/app.rs index fc159b0229..cf40b04f50 100644 --- a/crates/gpui/src/app.rs +++ b/crates/gpui/src/app.rs @@ -29,7 +29,7 @@ pub use entity_map::*; use gpui_util::{ResultExt, debug_panic}; #[cfg(any(test, feature = "test-support"))] pub use headless_app_context::*; -use http_client::{HttpClient, Url}; +use crate::http_client::{HttpClient, NullHttpClient}; use smallvec::SmallVec; #[cfg(any(test, feature = "test-support"))] pub use test_app::*; @@ -2710,30 +2710,7 @@ pub struct KeystrokeEvent { pub context_stack: Vec, } -struct NullHttpClient; -impl HttpClient for NullHttpClient { - fn send( - &self, - _req: http_client::Request, - ) -> futures::future::BoxFuture< - 'static, - anyhow::Result>, - > { - async move { - anyhow::bail!("No HttpClient available"); - } - .boxed() - } - - fn user_agent(&self) -> Option<&http_client::http::HeaderValue> { - None - } - - fn proxy(&self) -> Option<&Url> { - None - } -} /// A mutable reference to an entity owned by GPUI pub struct GpuiBorrow<'a, T> { diff --git a/crates/gpui/src/app/headless_app_context.rs b/crates/gpui/src/app/headless_app_context.rs index b21e64fa36..d8a9b1d9f2 100644 --- a/crates/gpui/src/app/headless_app_context.rs +++ b/crates/gpui/src/app/headless_app_context.rs @@ -87,7 +87,7 @@ impl HeadlessAppContext { ); let text_system = Arc::new(TextSystem::new(platform_text_system)); - let http_client = http_client::FakeHttpClient::with_404_response(); + let http_client = crate::http_client::FakeHttpClient::with_404_response(); let app = App::new_app(platform, asset_source, http_client); app.borrow_mut().mode = GpuiMode::test(); diff --git a/crates/gpui/src/app/test_app.rs b/crates/gpui/src/app/test_app.rs index 268fa891b5..ef0f9be654 100644 --- a/crates/gpui/src/app/test_app.rs +++ b/crates/gpui/src/app/test_app.rs @@ -88,7 +88,7 @@ impl TestApp { ), None => TestPlatform::new(background_executor.clone(), foreground_executor.clone()), }; - let http_client = http_client::FakeHttpClient::with_404_response(); + let http_client = crate::http_client::FakeHttpClient::with_404_response(); let text_system = Arc::new(TextSystem::new( platform_text_system.unwrap_or_else(|| platform.text_system.clone()), )); diff --git a/crates/gpui/src/app/test_context.rs b/crates/gpui/src/app/test_context.rs index 9e32c5dc2d..950eca57aa 100644 --- a/crates/gpui/src/app/test_context.rs +++ b/crates/gpui/src/app/test_context.rs @@ -129,7 +129,7 @@ impl TestAppContext { let foreground_executor = ForegroundExecutor::new(arc_dispatcher); let platform = TestPlatform::new(background_executor.clone(), foreground_executor.clone()); let asset_source = Arc::new(()); - let http_client = http_client::FakeHttpClient::with_404_response(); + let http_client = crate::http_client::FakeHttpClient::with_404_response(); let text_system = Arc::new(TextSystem::new(platform.text_system())); let app = App::new_app(platform.clone(), asset_source, http_client); diff --git a/crates/gpui/src/app/visual_test_context.rs b/crates/gpui/src/app/visual_test_context.rs index b54802a299..b7d0e1e5f9 100644 --- a/crates/gpui/src/app/visual_test_context.rs +++ b/crates/gpui/src/app/visual_test_context.rs @@ -71,7 +71,7 @@ impl VisualTestAppContext { let text_system = Arc::new(TextSystem::new(platform.text_system())); - let http_client = http_client::FakeHttpClient::with_404_response(); + let http_client = crate::http_client::FakeHttpClient::with_404_response(); let mut app = App::new_app(platform.clone(), asset_source, http_client); app.borrow_mut().mode = GpuiMode::test(); diff --git a/crates/gpui/src/elements/img.rs b/crates/gpui/src/elements/img.rs index 6f01182f9e..89aa69765b 100644 --- a/crates/gpui/src/elements/img.rs +++ b/crates/gpui/src/elements/img.rs @@ -618,27 +618,25 @@ impl Asset for ImageAssetLoader { async move { let bytes = match source.clone() { Resource::Path(uri) => fs::read(uri.as_ref())?, - Resource::Uri(uri) => { - use anyhow::Context as _; - use futures::AsyncReadExt as _; + Resource::Uri(uri) => { + use anyhow::Context as _; - let mut response = client - .get(uri.as_ref(), ().into(), true) - .await - .with_context(|| format!("loading image asset from {uri:?}"))?; - let mut body = Vec::new(); - response.body_mut().read_to_end(&mut body).await?; - if !response.status().is_success() { - let mut body = String::from_utf8_lossy(&body).into_owned(); - let first_line = body.lines().next().unwrap_or("").trim_end(); - body.truncate(first_line.len()); - return Err(ImageCacheError::BadStatus { - uri, - status: response.status(), - body, - }); - } - body + let response = client + .get(uri.as_ref(), true) + .await + .with_context(|| format!("loading image asset from {uri:?}"))?; + if !response.status.is_success() { + let mut error_body = + String::from_utf8_lossy(&response.body).into_owned(); + let first_line = error_body.lines().next().unwrap_or("").trim_end(); + error_body.truncate(first_line.len()); + return Err(ImageCacheError::BadStatus { + uri, + status: response.status, + body: error_body, + }); + } + response.body } Resource::Embedded(path) => { let data = asset_source.load(&path).ok().flatten(); @@ -763,7 +761,7 @@ pub enum ImageCacheError { /// The URI of the image. uri: SharedUri, /// The HTTP status code. - status: http_client::StatusCode, + status: http::StatusCode, /// The HTTP response body. body: String, }, diff --git a/crates/gpui/src/executor.rs b/crates/gpui/src/executor.rs index 7f8d7da0d4..42c65fe9b9 100644 --- a/crates/gpui/src/executor.rs +++ b/crates/gpui/src/executor.rs @@ -464,7 +464,7 @@ mod test { let platform = TestPlatform::new(background_executor.clone(), foreground_executor); let asset_source = Arc::new(()); - let http_client = http_client::FakeHttpClient::with_404_response(); + let http_client = crate::http_client::FakeHttpClient::with_404_response(); let app = App::new_app(platform, asset_source, http_client); (dispatcher, background_executor, app) diff --git a/crates/gpui/src/gpui.rs b/crates/gpui/src/gpui.rs index 172749816a..c1cffd8bc2 100644 --- a/crates/gpui/src/gpui.rs +++ b/crates/gpui/src/gpui.rs @@ -100,7 +100,8 @@ pub use gpui_macros::{ }; pub use gpui_shared_string::*; pub use gpui_util::arc_cow::ArcCow; -pub use http_client; +/// HTTP client abstraction for making requests. +pub mod http_client; pub use input::*; pub use inspector::*; pub use interactive::*; diff --git a/crates/gpui/src/http_client.rs b/crates/gpui/src/http_client.rs new file mode 100644 index 0000000000..15ee0358ed --- /dev/null +++ b/crates/gpui/src/http_client.rs @@ -0,0 +1,105 @@ +use futures::future::BoxFuture; +use http::StatusCode; + +/// A simple HTTP response. +pub struct HttpResponse { + /// The HTTP status code. + pub status: StatusCode, + /// The response body bytes. + pub body: Vec, +} + +/// A trait for making HTTP requests. +pub trait HttpClient: 'static + Send + Sync { + /// Perform a GET request and return the full response. + fn get( + &self, + url: &str, + follow_redirects: bool, + ) -> BoxFuture<'static, anyhow::Result>; +} + +/// An HTTP client that always returns an error. +pub struct NullHttpClient; + +impl HttpClient for NullHttpClient { + fn get( + &self, + _url: &str, + _follow_redirects: bool, + ) -> BoxFuture<'static, anyhow::Result> { + Box::pin(async { anyhow::bail!("No HttpClient available") }) + } +} + +/// An HTTP client that blocks all requests. +pub struct BlockedHttpClient; + +impl BlockedHttpClient { + /// Create a new `BlockedHttpClient`. + pub fn new() -> Self { + Self + } +} + +impl Default for BlockedHttpClient { + fn default() -> Self { + Self + } +} + +impl HttpClient for BlockedHttpClient { + fn get( + &self, + _url: &str, + _follow_redirects: bool, + ) -> BoxFuture<'static, anyhow::Result> { + Box::pin(async { + Err(std::io::Error::new( + std::io::ErrorKind::PermissionDenied, + "BlockedHttpClient disallowed request", + ) + .into()) + }) + } +} + +/// A fake HTTP client for testing. +#[cfg(any(test, feature = "test-support"))] +pub struct FakeHttpClient { + status: StatusCode, +} + +#[cfg(any(test, feature = "test-support"))] +impl FakeHttpClient { + /// Create a fake client that returns 404 responses. + pub fn with_404_response() -> std::sync::Arc { + std::sync::Arc::new(Self { + status: StatusCode::NOT_FOUND, + }) + } + + /// Create a fake client that returns 200 responses. + pub fn with_200_response() -> std::sync::Arc { + std::sync::Arc::new(Self { + status: StatusCode::OK, + }) + } +} + +#[cfg(any(test, feature = "test-support"))] +impl HttpClient for FakeHttpClient { + fn get( + &self, + _url: &str, + _follow_redirects: bool, + ) -> BoxFuture<'static, anyhow::Result> { + let status = self.status; + Box::pin(async move { + Ok(HttpResponse { + status, + body: Vec::new(), + }) + }) + } +} diff --git a/crates/gpui_linux/Cargo.toml b/crates/gpui_linux/Cargo.toml index 0e9de0ebc0..a819ef22c5 100644 --- a/crates/gpui_linux/Cargo.toml +++ b/crates/gpui_linux/Cargo.toml @@ -60,7 +60,6 @@ image.workspace = true futures.workspace = true gpui.workspace = true gpui_wgpu = { workspace = true, optional = true, features = ["font-kit"] } -http_client.workspace = true itertools.workspace = true libc.workspace = true log.workspace = true diff --git a/crates/gpui_linux/src/linux/wayland/client.rs b/crates/gpui_linux/src/linux/wayland/client.rs index c5e453b484..fe53aba5d4 100644 --- a/crates/gpui_linux/src/linux/wayland/client.rs +++ b/crates/gpui_linux/src/linux/wayland/client.rs @@ -15,7 +15,7 @@ use calloop::{ use calloop_wayland_source::WaylandSource; use collections::HashMap; use filedescriptor::Pipe; -use http_client::Url; +use url::Url; use smallvec::SmallVec; use util::ResultExt as _; use wayland_backend::client::ObjectId; diff --git a/crates/gpui_linux/src/linux/x11/client.rs b/crates/gpui_linux/src/linux/x11/client.rs index 273bbbe825..d22e25d063 100644 --- a/crates/gpui_linux/src/linux/x11/client.rs +++ b/crates/gpui_linux/src/linux/x11/client.rs @@ -7,7 +7,7 @@ use calloop::{ use collections::HashMap; use core::str; use gpui::{Capslock, TaskTiming, profiler}; -use http_client::Url; +use url::Url; use log::Level; use smallvec::SmallVec; use std::{ diff --git a/crates/gpui_web/src/http_client.rs b/crates/gpui_web/src/http_client.rs index 14d58cf457..331ff9561d 100644 --- a/crates/gpui_web/src/http_client.rs +++ b/crates/gpui_web/src/http_client.rs @@ -1,6 +1,5 @@ use anyhow::anyhow; -use futures::AsyncReadExt as _; -use http_client::{AsyncBody, HttpClient, RedirectPolicy}; +use gpui::http_client::{HttpClient, HttpResponse}; use std::future::Future; use std::pin::Pin; use std::task::Poll; @@ -13,58 +12,29 @@ extern "C" { fn global_fetch(input: &web_sys::Request) -> Result; } -pub struct FetchHttpClient { - user_agent: Option, -} +pub struct FetchHttpClient; impl Default for FetchHttpClient { fn default() -> Self { - Self { user_agent: None } + Self } } #[cfg(feature = "multithreaded")] impl FetchHttpClient { - /// # Safety - /// - /// The caller must ensure that the created `FetchHttpClient` is only used in a single thread environment. pub unsafe fn new() -> Self { - Self::default() - } - - /// # Safety - /// - /// The caller must ensure that the created `FetchHttpClient` is only used in a single thread environment. - pub unsafe fn with_user_agent(user_agent: &str) -> anyhow::Result { - Ok(Self { - user_agent: Some(http_client::http::header::HeaderValue::from_str( - user_agent, - )?), - }) + Self } } #[cfg(not(feature = "multithreaded"))] impl FetchHttpClient { pub fn new() -> Self { - Self::default() - } - - pub fn with_user_agent(user_agent: &str) -> anyhow::Result { - Ok(Self { - user_agent: Some(http_client::http::header::HeaderValue::from_str( - user_agent, - )?), - }) + Self } } /// Wraps a `!Send` future to satisfy the `Send` bound on `BoxFuture`. -/// -/// Safety: only valid in WASM contexts where the `FetchHttpClient` is -/// confined to a single thread (guaranteed by the caller via unsafe -/// constructors when `multithreaded` is enabled, or by the absence of -/// threads when it is not). struct AssertSend(F); unsafe impl Send for AssertSend {} @@ -73,64 +43,29 @@ impl Future for AssertSend { type Output = F::Output; fn poll(self: Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> Poll { - // Safety: pin projection for a single-field newtype wrapper. let inner = unsafe { self.map_unchecked_mut(|this| &mut this.0) }; inner.poll(cx) } } impl HttpClient for FetchHttpClient { - fn user_agent(&self) -> Option<&http_client::http::header::HeaderValue> { - self.user_agent.as_ref() - } - - fn proxy(&self) -> Option<&http_client::Url> { - None - } - - fn send( + fn get( &self, - req: http_client::http::Request, - ) -> futures::future::BoxFuture<'static, anyhow::Result>> - { - let (parts, body) = req.into_parts(); - + url: &str, + follow_redirects: bool, + ) -> futures::future::BoxFuture<'static, anyhow::Result> { + let url = url.to_string(); Box::pin(AssertSend(async move { - let body_bytes = read_body_to_bytes(body).await?; - let init = web_sys::RequestInit::new(); - init.set_method(parts.method.as_str()); + init.set_method("GET"); - if let Some(redirect_policy) = parts.extensions.get::() { - match redirect_policy { - RedirectPolicy::NoFollow => { - init.set_redirect(web_sys::RequestRedirect::Manual); - } - RedirectPolicy::FollowLimit(_) | RedirectPolicy::FollowAll => { - init.set_redirect(web_sys::RequestRedirect::Follow); - } - } + if !follow_redirects { + init.set_redirect(web_sys::RequestRedirect::Manual); } - if let Some(ref bytes) = body_bytes { - let uint8array = js_sys::Uint8Array::from(bytes.as_slice()); - init.set_body(uint8array.as_ref()); - } - - let url = parts.uri.to_string(); let request = web_sys::Request::new_with_str_and_init(&url, &init) .map_err(|error| anyhow!("failed to create fetch Request: {error:?}"))?; - let request_headers = request.headers(); - for (name, value) in &parts.headers { - let value_str = value - .to_str() - .map_err(|_| anyhow!("non-ASCII header value for {name}"))?; - request_headers - .set(name.as_str(), value_str) - .map_err(|error| anyhow!("failed to set header {name}: {error:?}"))?; - } - let promise = global_fetch(&request) .map_err(|error| anyhow!("fetch threw an error: {error:?}"))?; let response_value = wasm_bindgen_futures::JsFuture::from(promise) @@ -141,35 +76,9 @@ impl HttpClient for FetchHttpClient { .dyn_into() .map_err(|error| anyhow!("fetch result is not a Response: {error:?}"))?; - let status = web_response.status(); - let mut builder = http_client::http::Response::builder().status(status); + let status_code = http::StatusCode::from_u16(web_response.status()) + .map_err(|_| anyhow!("invalid status code"))?; - // `Headers` is a JS iterable yielding `[name, value]` pairs. - // `js_sys::Array::from` calls `Array.from()` which accepts any iterable. - let header_pairs = js_sys::Array::from(&web_response.headers()); - for index in 0..header_pairs.length() { - match header_pairs.get(index).dyn_into::() { - Ok(pair) => match (pair.get(0).as_string(), pair.get(1).as_string()) { - (Some(name), Some(value)) => { - builder = builder.header(name, value); - } - (name, value) => { - log::warn!( - "skipping response header at index {index}: \ - name={name:?}, value={value:?}" - ); - } - }, - Err(entry) => { - log::warn!("skipping non-array header entry at index {index}: {entry:?}"); - } - } - } - - // The entire response body is eagerly buffered into memory via - // `arrayBuffer()`. The Fetch API does not expose a synchronous - // streaming interface; streaming would require `ReadableStream` - // interop which is significantly more complex. let body_promise = web_response .array_buffer() .map_err(|error| anyhow!("failed to initiate response body read: {error:?}"))?; @@ -179,21 +88,12 @@ impl HttpClient for FetchHttpClient { let array_buffer: js_sys::ArrayBuffer = body_value .dyn_into() .map_err(|error| anyhow!("response body is not an ArrayBuffer: {error:?}"))?; - let response_bytes = js_sys::Uint8Array::new(&array_buffer).to_vec(); + let body = js_sys::Uint8Array::new(&array_buffer).to_vec(); - builder - .body(AsyncBody::from(response_bytes)) - .map_err(|error| anyhow!(error)) + Ok(HttpResponse { + status: status_code, + body, + }) })) } } - -async fn read_body_to_bytes(mut body: AsyncBody) -> anyhow::Result>> { - let mut buffer = Vec::new(); - body.read_to_end(&mut buffer).await?; - if buffer.is_empty() { - Ok(None) - } else { - Ok(Some(buffer)) - } -}