rust/rustc-1.60.0-disable-http2.patch

87 lines
3.1 KiB
Diff
Raw Normal View History

2022-04-20 00:30:19 +08:00
From 9669318f57818f7ae497ef2bdedcd635298e2ce4 Mon Sep 17 00:00:00 2001
2022-02-27 23:34:12 +08:00
From: Liu Zixian <liuzixian4@huawei.com>
2022-04-20 00:30:19 +08:00
Date: Tue, 19 Apr 2022 22:28:00 +0800
2022-02-27 23:34:12 +08:00
Subject: [PATCH] disable http2
2021-12-18 10:58:18 +08:00
---
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
2022-04-20 00:30:19 +08:00
index 8baf4fbd9..79740b777 100644
2021-12-18 10:58:18 +08:00
--- a/Cargo.lock
+++ b/Cargo.lock
2022-04-20 00:30:19 +08:00
@@ -958,7 +958,6 @@ checksum = "d130987e6a6a34fe0889e1083022fa48cd90e6709a84be3fb8dd95801de5af20"
2021-05-07 16:50:46 +08:00
dependencies = [
"cc",
"libc",
- "libnghttp2-sys",
"libz-sys",
"openssl-sys",
"pkg-config",
2022-04-20 00:30:19 +08:00
@@ -2008,16 +2007,6 @@ version = "0.1.4"
2021-12-18 10:58:18 +08:00
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a"
2021-05-07 16:50:46 +08:00
2021-12-18 10:58:18 +08:00
-[[package]]
2021-05-07 16:50:46 +08:00
-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",
-]
-
2021-12-18 10:58:18 +08:00
[[package]]
name = "libz-sys"
version = "1.1.3"
diff --git a/src/tools/cargo/Cargo.toml b/src/tools/cargo/Cargo.toml
2022-04-20 00:30:19 +08:00
index fba5257a8..9fe466d6d 100644
2021-12-18 10:58:18 +08:00
--- a/src/tools/cargo/Cargo.toml
+++ b/src/tools/cargo/Cargo.toml
2022-02-27 23:34:12 +08:00
@@ -22,7 +22,7 @@ cargo-platform = { path = "crates/cargo-platform", version = "0.1.2" }
2022-04-20 00:30:19 +08:00
cargo-util = { path = "crates/cargo-util", version = "0.1.2" }
crates-io = { path = "crates/crates-io", version = "0.34.0" }
2021-05-07 16:50:46 +08:00
crossbeam-utils = "0.8"
2022-02-27 23:34:12 +08:00
-curl = { version = "0.4.41", features = ["http2"] }
+curl = { version = "0.4.41", features = [] }
curl-sys = "0.4.50"
2021-12-16 00:16:44 +08:00
env_logger = "0.9.0"
2021-05-07 16:50:46 +08:00
pretty_env_logger = { version = "0.4", optional = true }
2021-12-18 10:58:18 +08:00
diff --git a/src/tools/cargo/src/cargo/core/package.rs b/src/tools/cargo/src/cargo/core/package.rs
2022-04-20 00:30:19 +08:00
index 0ebe0277e..1b3fc1ee1 100644
2021-12-18 10:58:18 +08:00
--- a/src/tools/cargo/src/cargo/core/package.rs
+++ b/src/tools/cargo/src/cargo/core/package.rs
2022-04-20 00:30:19 +08:00
@@ -412,14 +412,8 @@ impl<'cfg> PackageSet<'cfg> {
2021-05-07 16:50:46 +08:00
// 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)
2021-12-16 00:16:44 +08:00
- .with_context(|| "failed to enable multiplexing/pipelining in curl")?;
2021-05-07 16:50:46 +08:00
-
- // 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
2022-04-20 00:30:19 +08:00
@@ -648,7 +642,7 @@ impl<'cfg> PackageSet<'cfg> {
2021-05-07 16:50:46 +08:00
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);
}
2021-12-18 10:58:18 +08:00
--
2022-04-20 00:30:19 +08:00
2.35.1
2021-12-18 10:58:18 +08:00