From 09d6ca2311f2fcbcd392534d031a71641b79ee07 Mon Sep 17 00:00:00 2001 From: Aumetra Weisman Date: Wed, 10 Jul 2024 07:31:37 +0200 Subject: [PATCH 1/5] Remove `isahc` support --- .cspell.json | 1 - Cargo.toml | 1 - opentelemetry-http/Cargo.toml | 1 - opentelemetry-http/src/lib.rs | 26 -------------------------- 4 files changed, 29 deletions(-) diff --git a/.cspell.json b/.cspell.json index 47fc5d18e8..23ecd03c8b 100644 --- a/.cspell.json +++ b/.cspell.json @@ -37,7 +37,6 @@ "Dirkjan", "EPYC", "hasher", - "isahc", "Isobel", "jaegertracing", "Kühle", diff --git a/Cargo.toml b/Cargo.toml index f5d93d6b8a..b7f61eea88 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,6 @@ futures-executor = "0.3" futures-util = { version = "0.3", default-features = false } hyper = { version = "0.14", default-features = false } http = { version = "0.2", default-features = false } -isahc = { version = "1.4", default-features = false } log = "0.4.21" once_cell = "1.13" ordered-float = "4.0" diff --git a/opentelemetry-http/Cargo.toml b/opentelemetry-http/Cargo.toml index a3fda11719..f7472054df 100644 --- a/opentelemetry-http/Cargo.toml +++ b/opentelemetry-http/Cargo.toml @@ -18,7 +18,6 @@ async-trait = { workspace = true } bytes = { workspace = true } http = { workspace = true } hyper = { workspace = true, features = ["http2", "client", "tcp"], optional = true } -isahc = { workspace = true, optional = true } opentelemetry = { version = "0.23", path = "../opentelemetry", features = ["trace"] } reqwest = { workspace = true, features = ["blocking"], optional = true } tokio = { workspace = true, features = ["time"], optional = true } diff --git a/opentelemetry-http/src/lib.rs b/opentelemetry-http/src/lib.rs index cee858b647..b921a41d9c 100644 --- a/opentelemetry-http/src/lib.rs +++ b/opentelemetry-http/src/lib.rs @@ -99,32 +99,6 @@ mod reqwest { } } -#[cfg(feature = "isahc")] -mod isahc { - use crate::ResponseExt; - - use super::{async_trait, Bytes, HttpClient, HttpError, Request, Response}; - use isahc::AsyncReadResponseExt; - use std::convert::TryInto as _; - - #[async_trait] - impl HttpClient for isahc::HttpClient { - async fn send(&self, request: Request>) -> Result, HttpError> { - let mut response = self.send_async(request).await?; - let mut bytes = Vec::with_capacity(response.body().len().unwrap_or(0).try_into()?); - response.copy_to(&mut bytes).await?; - - let headers = std::mem::take(response.headers_mut()); - let mut http_response = Response::builder() - .status(response.status().as_u16()) - .body(bytes.into())?; - *http_response.headers_mut() = headers; - - Ok(http_response.error_for_status()?) - } - } -} - #[cfg(feature = "hyper")] pub mod hyper { use crate::ResponseExt; From b55088442ee8c97ac7ada0d72356537d16850469 Mon Sep 17 00:00:00 2001 From: Aumetra Weisman Date: Wed, 10 Jul 2024 07:36:38 +0200 Subject: [PATCH 2/5] Add changelog entry --- opentelemetry-http/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/opentelemetry-http/CHANGELOG.md b/opentelemetry-http/CHANGELOG.md index c19fd56dea..51880f3c31 100644 --- a/opentelemetry-http/CHANGELOG.md +++ b/opentelemetry-http/CHANGELOG.md @@ -3,6 +3,7 @@ ## vNext - **Breaking** Correct the misspelling of "webkpi" to "webpki" in features [#1842](https://github.com/open-telemetry/opentelemetry-rust/pull/1842) +- **Breaking** Remove support for the `isahc` HTTP client [#1924](https://github.com/open-telemetry/opentelemetry-rust/pull/1924) ## v0.12.0 From b7fe43c045262eac7de4b0c6ce6b71f7488ebb2e Mon Sep 17 00:00:00 2001 From: Aumetra Weisman Date: Wed, 10 Jul 2024 07:46:07 +0200 Subject: [PATCH 3/5] Use pinning trick for cc --- Cargo.toml | 1 + opentelemetry/Cargo.toml | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index b7f61eea88..5c918fbc54 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,6 +19,7 @@ debug = 1 async-std = "1.10" async-trait = "0.1" bytes = "1" +cc = "=1.0.105" # pinning version supporting rustc 1.65 criterion = "0.5" futures-core = "0.3" futures-executor = "0.3" diff --git a/opentelemetry/Cargo.toml b/opentelemetry/Cargo.toml index 3d181fce76..cd7e423a44 100644 --- a/opentelemetry/Cargo.toml +++ b/opentelemetry/Cargo.toml @@ -30,6 +30,11 @@ thiserror = { workspace = true } [target.'cfg(all(target_arch = "wasm32", not(target_os = "wasi")))'.dependencies] js-sys = "0.3.63" +# This cfg can't ever be enabled but cargo will respect it anyway. +# Meaning we can use this to pin unused transitive dependencies. +[target.'cfg(any())'.dependencies] +cc = { workspace = true } + [features] default = ["trace", "metrics", "logs"] trace = ["pin-project-lite"] From 06ca64ba2c7ae3cd03b429925ec64c867b7abccf Mon Sep 17 00:00:00 2001 From: Aumetra Weisman Date: Wed, 10 Jul 2024 08:34:14 +0200 Subject: [PATCH 4/5] Patch versions via `patch_version.sh` --- Cargo.toml | 3 +-- opentelemetry/Cargo.toml | 5 ----- scripts/patch_dependencies.sh | 2 ++ 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5c918fbc54..8400ebae7f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,6 @@ debug = 1 async-std = "1.10" async-trait = "0.1" bytes = "1" -cc = "=1.0.105" # pinning version supporting rustc 1.65 criterion = "0.5" futures-core = "0.3" futures-executor = "0.3" @@ -46,4 +45,4 @@ tokio-stream = "0.1.1" tracing = { version = "0.1", default-features = false } tracing-core = { version = "0.1", default-features = false } tracing-subscriber = { version = "0.3", default-features = false } -url = { version = "=2.5.0", default-features = false } #pinning the version supporting rustc 1.65 +url = { version = "2.5", default-features = false } #pinning the version supporting rustc 1.65 diff --git a/opentelemetry/Cargo.toml b/opentelemetry/Cargo.toml index cd7e423a44..3d181fce76 100644 --- a/opentelemetry/Cargo.toml +++ b/opentelemetry/Cargo.toml @@ -30,11 +30,6 @@ thiserror = { workspace = true } [target.'cfg(all(target_arch = "wasm32", not(target_os = "wasi")))'.dependencies] js-sys = "0.3.63" -# This cfg can't ever be enabled but cargo will respect it anyway. -# Meaning we can use this to pin unused transitive dependencies. -[target.'cfg(any())'.dependencies] -cc = { workspace = true } - [features] default = ["trace", "metrics", "logs"] trace = ["pin-project-lite"] diff --git a/scripts/patch_dependencies.sh b/scripts/patch_dependencies.sh index ff7ffc7070..d52547db67 100755 --- a/scripts/patch_dependencies.sh +++ b/scripts/patch_dependencies.sh @@ -6,3 +6,5 @@ function patch_version() { cargo update -p $1:$latest_version --precise $2 } +patch_version cc 1.0.105 +patch_version url 2.5.0 From fd4d81aac8d11b68901aeaef7ca3e3ec13c006ea Mon Sep 17 00:00:00 2001 From: Aumetra Weisman Date: Wed, 10 Jul 2024 08:38:48 +0200 Subject: [PATCH 5/5] Remove pinning notice --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 8400ebae7f..28a0dea98d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,4 +45,4 @@ tokio-stream = "0.1.1" tracing = { version = "0.1", default-features = false } tracing-core = { version = "0.1", default-features = false } tracing-subscriber = { version = "0.3", default-features = false } -url = { version = "2.5", default-features = false } #pinning the version supporting rustc 1.65 +url = { version = "2.5", default-features = false }