-
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.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
weihanglo commentedon Feb 17, 2023
Thank you for the report. We just found that as well during a recent PR review. Personally I'd like to backport a fix to beta channel, copying what this does:
cargo/src/cargo/core/package.rs
Lines 738 to 754 in a66f123
Eh2406 commentedon Feb 17, 2023
+1 for a backport.
bebecue commentedon Feb 17, 2023
Thanks for the pointer, I realized this is 5 years old problem and can be fixed quickly.
As someone haven't done any backport before, I found a guide at Backporting. I think it needs 3 PRs in total.
rust-lang/cargo/master
to fix it like the previous one[beta]
that cherry picks the above commit fromrust-lang/cargo/master
torust-lang/cargo/rust-1.68.0)
[beta]
torust-lang/rust/rust-1.68.0
that updates the Cargo submodule torust-lang/cargo/rust-1.68.0)
Is that right?
weihanglo commentedon Feb 17, 2023
@bebecue, that's pretty much correct!
I might also try to reuse that code snippet if feasible, though it's also fine just copying over at this moment.
Auto merge of #11733 - bebecue:issue-11726, r=weihanglo
weihanglo commentedon Mar 1, 2023
Rust toolchain
v1.68.0-beta.6
should include the fix (rust-lang/rust#108508). Closing and thanks for the help!