Extract http from util (#11680)

This avoids the CLI linking libssl etc...

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2024-05-10 15:50:20 -06:00 committed by GitHub
parent df41435d1a
commit 5515ba6043
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
77 changed files with 419 additions and 336 deletions

View file

@ -23,6 +23,7 @@ collections.workspace = true
fs.workspace = true
futures.workspace = true
gpui.workspace = true
http.workspace = true
isahc.workspace = true
language.workspace = true
log.workspace = true

View file

@ -6,6 +6,7 @@ use async_compression::futures::bufread::GzipDecoder;
use async_tar::Archive;
use futures::io::BufReader;
use futures::AsyncReadExt;
use http::{self, AsyncBody, HttpClient};
use serde::Deserialize;
use std::{
env, fs, mem,
@ -13,7 +14,6 @@ use std::{
process::{Command, Stdio},
sync::Arc,
};
use util::http::{self, AsyncBody, HttpClient};
use wasm_encoder::{ComponentSectionId, Encode as _, RawSection, Section as _};
use wasmparser::Parser;
use wit_component::ComponentEncoder;

View file

@ -28,6 +28,7 @@ use gpui::{
actions, AppContext, AsyncAppContext, Context, EventEmitter, Global, Model, ModelContext, Task,
WeakModel,
};
use http::{AsyncBody, HttpClient, HttpClientWithUrl};
use language::{
ContextProviderWithTasks, LanguageConfig, LanguageMatcher, LanguageQueries, LanguageRegistry,
QUERY_FILENAME_PREFIXES,
@ -46,12 +47,7 @@ use std::{
};
use theme::{ThemeRegistry, ThemeSettings};
use url::Url;
use util::{
http::{AsyncBody, HttpClient, HttpClientWithUrl},
maybe,
paths::EXTENSIONS_DIR,
ResultExt,
};
use util::{maybe, paths::EXTENSIONS_DIR, ResultExt};
use wasm_host::{
wit::{is_supported_wasm_api_version, wasm_api_version_range},
WasmExtension, WasmHost,

View file

@ -10,6 +10,7 @@ use collections::BTreeMap;
use fs::{FakeFs, Fs, RealFs};
use futures::{io::BufReader, AsyncReadExt, StreamExt};
use gpui::{Context, TestAppContext};
use http::{FakeHttpClient, Response};
use language::{LanguageMatcher, LanguageRegistry, LanguageServerBinaryStatus, LanguageServerName};
use node_runtime::FakeNodeRuntime;
use parking_lot::Mutex;
@ -22,10 +23,7 @@ use std::{
sync::Arc,
};
use theme::ThemeRegistry;
use util::{
http::{FakeHttpClient, Response},
test::temp_tree,
};
use util::test::temp_tree;
#[cfg(test)]
#[ctor::ctor]

View file

@ -13,6 +13,7 @@ use futures::{
Future, FutureExt, StreamExt as _,
};
use gpui::{AppContext, AsyncAppContext, BackgroundExecutor, Task};
use http::HttpClient;
use language::LanguageRegistry;
use node_runtime::NodeRuntime;
use semantic_version::SemanticVersion;
@ -20,7 +21,6 @@ use std::{
path::{Path, PathBuf},
sync::{Arc, OnceLock},
};
use util::http::HttpClient;
use wasmtime::{
component::{Component, ResourceTable},
Engine, Store,

View file

@ -155,7 +155,7 @@ impl github::Host for WasmState {
options: github::GithubReleaseOptions,
) -> wasmtime::Result<Result<github::GithubRelease, String>> {
maybe!(async {
let release = util::github::latest_github_release(
let release = http::github::latest_github_release(
&repo,
options.require_assets,
options.pre_release,