-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
A-networkingArea: networking issues, curl, etc.Area: networking issues, curl, etc.A-sparse-registryArea: http sparse registriesArea: http sparse registriesC-bugCategory: bugCategory: bugP-highPriority: HighPriority: Highbeta-nominatedNominated to backport to the beta branch.Nominated to backport to the beta branch.regression-from-stable-to-betaRegression in beta that previously worked in stable.Regression in beta that previously worked in stable.
Description
Problem
When using sparse registry, cargo reports Unsupported protocol
error.
HTTP multiplexing defaults to true at
cargo/src/cargo/sources/registry/http_remote.rs
Lines 223 to 225 in 39c13e6
// We've enabled the `http2` feature of `curl` in Cargo, so treat | |
// failures here as fatal as it would indicate a build-time problem. | |
self.multiplexing = self.config.http_config()?.multiplexing.unwrap_or(true); |
cargo/src/cargo/sources/registry/http_remote.rs
Lines 555 to 556 in 39c13e6
if self.multiplexing { | |
handle.http_version(HttpVersion::V2)?; |
cargo is dynamic linked to
libcurl
, however libcurl
from Apple in macOS 10.12.6 has no HTTP2
😳
Steps
$ env CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse rustup run nightly cargo install oris
Updating crates.io index
error: failed to query replaced source registry `crates-io`
Caused by:
[1] Unsupported protocol
Possible Solution(s)
- fallback to
HTTP/1.1
- replace the ambiguous error message
- maybe add suggestion: set
CARGO_HTTP_MULTIPLEXING
tofalse
iflibcurl
doesn't supportHTTP/2
- maybe add suggestion: set
- static link to
libcurl
Notes
No response
Version
$ rustup run nightly cargo version --verbose
cargo 1.69.0-nightly (39c13e67a 2023-02-12)
release: 1.69.0-nightly
commit-hash: 39c13e67a5962466cc7253d41bc1099bbcb224c3
commit-date: 2023-02-12
host: x86_64-apple-darwin
libgit2: 1.5.0 (sys:0.16.0 vendored)
libcurl: 7.54.0 (sys:0.4.59+curl-7.86.0 system ssl:SecureTransport)
os: Mac OS 10.12.6 [64-bit]
$ otool -L (rustup which --toolchain nightly cargo)
/.rustup/toolchains/nightly-x86_64-apple-darwin/bin/cargo:
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/System/Library/Frameworks/Security.framework/Versions/A/Security (compatibility version 1.0.0, current version 60158.100.133)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1858.112.0)
/usr/lib/libcurl.4.dylib (compatibility version 7.0.0, current version 9.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)
$ /usr/bin/curl-config --version
libcurl 7.54.0
$ /usr/bin/curl-config --feature
SSL
IPv6
UnixSockets
libz
AsynchDNS
GSS-API
SPNEGO
Kerberos
NTLM
NTLM_WB
weihanglo and BigMurry
Metadata
Metadata
Assignees
Labels
A-networkingArea: networking issues, curl, etc.Area: networking issues, curl, etc.A-sparse-registryArea: http sparse registriesArea: http sparse registriesC-bugCategory: bugCategory: bugP-highPriority: HighPriority: Highbeta-nominatedNominated to backport to the beta branch.Nominated to backport to the beta branch.regression-from-stable-to-betaRegression in beta that previously worked in stable.Regression in beta that previously worked in stable.