Disable HTTP/2 support, lacking in system libcurl.

This commit is contained in:
Josh Stone 2019-08-16 20:23:50 -07:00
parent 9d647b418c
commit 9d6ffbec00
2 changed files with 92 additions and 0 deletions

View File

@ -40,6 +40,13 @@
%bcond_with bundled_libssh2
%endif
%if 0%{?rhel} && 0%{?rhel} <= 7
%bcond_with curl_http2
%else
%bcond_without curl_http2
%endif
# LLDB isn't available everywhere...
%if !0%{?rhel}
%bcond_without lldb
@ -67,6 +74,10 @@ Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz
# We do have the necessary fix in our LLVM 7.
Patch1: rust-pr57840-llvm7-debuginfo-variants.patch
# libcurl on EL7 doesn't have http2, but since cargo requests it, curl-sys
# will try to build it statically -- instead we turn off the feature.
Patch10: rustc-1.37.0-disable-http2.patch
# Get the Rust triple for any arch.
%{lua: function rust_triple(arch)
local abi = "gnu"
@ -398,6 +409,11 @@ test -f '%{local_rust_root}/bin/rustc'
%patch1 -p1 -R
%if %without curl_http2
%patch10 -p1
rm -rf vendor/libnghttp2-sys/
%endif
%if "%{python}" == "python3"
sed -i.try-py3 -e '/try python2.7/i try python3 "$@"' ./configure
%endif
@ -702,6 +718,7 @@ rm -f %{buildroot}%{rustlibdir}/etc/lldb_*.py*
%changelog
* Thu Aug 15 2019 Josh Stone <jistone@redhat.com> - 1.37.0-1
- Update to 1.37.0.
- Disable HTTP/2 support, lacking in system libcurl.
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.36.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

View File

@ -0,0 +1,75 @@
--- rustc-1.37.0-src/Cargo.lock.orig 2019-08-12 23:27:22.000000000 -0700
+++ rustc-1.37.0-src/Cargo.lock 2019-08-16 14:23:18.346656639 -0700
@@ -700,7 +700,6 @@ source = "registry+https://github.com/ru
dependencies = [
"cc 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)",
- "libnghttp2-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.9.43 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1400,15 +1399,6 @@ dependencies = [
]
[[package]]
-name = "libnghttp2-sys"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "cc 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
name = "libssh2-sys"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -4341,7 +4331,6 @@ source = "registry+https://github.com/ru
"checksum lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f"
"checksum libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)" = "c6785aa7dd976f5fbf3b71cfd9cd49d7f783c1ff565a858d71031c6c313aa5c6"
"checksum libgit2-sys 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "941a41e23f77323b8c9d2ee118aec9ee39dfc176078c18b4757d3bad049d9ff7"
-"checksum libnghttp2-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d75d7966bda4730b722d1eab8e668df445368a24394bae9fc1e8dc0ab3dbe4f4"
"checksum libssh2-sys 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "126a1f4078368b163bfdee65fbab072af08a1b374a5551b21e87ade27b1fbf9d"
"checksum libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe"
"checksum lock_api 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "949826a5ccf18c1b3a7c3d57692778d21768b79e46eb9dd07bfc4c2160036c54"
--- rustc-1.37.0-src/src/tools/cargo/Cargo.toml.orig 2019-08-12 23:27:40.000000000 -0700
+++ rustc-1.37.0-src/src/tools/cargo/Cargo.toml 2019-08-16 14:21:20.165084813 -0700
@@ -24,7 +24,7 @@ bytesize = "1.0"
crates-io = { path = "crates/crates-io", version = "0.26" }
crossbeam-utils = "0.6"
crypto-hash = "0.3.1"
-curl = { version = "0.4.21", features = ['http2'] }
+curl = { version = "0.4.21", features = [] }
curl-sys = "0.4.18"
env_logger = "0.6.0"
pretty_env_logger = { version = "0.3", optional = true }
--- rustc-1.37.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2019-08-12 23:27:40.000000000 -0700
+++ rustc-1.37.0-src/src/tools/cargo/src/cargo/core/package.rs 2019-08-16 18:39:56.053468497 -0700
@@ -374,16 +374,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
- .get::<Option<bool>>("http.multiplexing")?
- .unwrap_or(true);
- multi
- .pipelining(false, multiplexing)
- .chain_err(|| "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
@@ -460,7 +452,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);
}