rust/rustc-1.58.1-disable-http2.patch
2022-02-27 23:34:12 +08:00

87 lines
3.1 KiB
Diff

From 39b90a6ca3134982d3eadf96ea2067cc7cfc6d8d Mon Sep 17 00:00:00 2001
From: Liu Zixian <liuzixian4@huawei.com>
Date: Sat, 22 Jan 2022 00:37:26 +0800
Subject: [PATCH] disable http2
---
Cargo.lock | 11 -----------
src/tools/cargo/Cargo.toml | 2 +-
src/tools/cargo/src/cargo/core/package.rs | 12 +++---------
3 files changed, 4 insertions(+), 21 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index 2dbf34d87..908eb2c0b 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -909,7 +909,6 @@ checksum = "d130987e6a6a34fe0889e1083022fa48cd90e6709a84be3fb8dd95801de5af20"
dependencies = [
"cc",
"libc",
- "libnghttp2-sys",
"libz-sys",
"openssl-sys",
"pkg-config",
@@ -1926,16 +1925,6 @@ version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a"
-[[package]]
-name = "libnghttp2-sys"
-version = "0.1.4+1.41.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "03624ec6df166e79e139a2310ca213283d6b3c30810c54844f307086d4488df1"
-dependencies = [
- "cc",
- "libc",
-]
-
[[package]]
name = "libz-sys"
version = "1.1.3"
diff --git a/src/tools/cargo/Cargo.toml b/src/tools/cargo/Cargo.toml
index e23f4ec06..4e615767e 100644
--- a/src/tools/cargo/Cargo.toml
+++ b/src/tools/cargo/Cargo.toml
@@ -22,7 +22,7 @@ cargo-platform = { path = "crates/cargo-platform", version = "0.1.2" }
cargo-util = { path = "crates/cargo-util", version = "0.1.1" }
crates-io = { path = "crates/crates-io", version = "0.33.0" }
crossbeam-utils = "0.8"
-curl = { version = "0.4.41", features = ["http2"] }
+curl = { version = "0.4.41", features = [] }
curl-sys = "0.4.50"
env_logger = "0.9.0"
pretty_env_logger = { version = "0.4", optional = true }
diff --git a/src/tools/cargo/src/cargo/core/package.rs b/src/tools/cargo/src/cargo/core/package.rs
index dd73ea25c..e1ed94321 100644
--- a/src/tools/cargo/src/cargo/core/package.rs
+++ b/src/tools/cargo/src/cargo/core/package.rs
@@ -419,14 +419,8 @@ impl<'cfg> PackageSet<'cfg> {
// Also note that pipelining is disabled as curl authors have indicated
// that it's buggy, and we've empirically seen that it's buggy with HTTP
// proxies.
- let mut multi = Multi::new();
- let multiplexing = config.http_config()?.multiplexing.unwrap_or(true);
- multi
- .pipelining(false, multiplexing)
- .with_context(|| "failed to enable multiplexing/pipelining in curl")?;
-
- // let's not flood crates.io with connections
- multi.set_max_host_connections(2)?;
+ let multi = Multi::new();
+ let multiplexing = false;
Ok(PackageSet {
packages: package_ids
@@ -655,7 +649,7 @@ impl<'cfg> PackageSet<'cfg> {
macro_rules! try_old_curl {
($e:expr, $msg:expr) => {
let result = $e;
- if cfg!(target_os = "macos") {
+ if cfg!(any(target_os = "linux", target_os = "macos")) {
if let Err(e) = result {
warn!("ignoring libcurl {} error: {}", $msg, e);
}
--
2.34.1