Closed thecaralice closed 3 hours ago
Looks like the same bug in https://github.com/rust-lang/cargo/issues/11085, and is already fixed via https://github.com/rust-lang/cargo/pull/12280 and now is part of lockfile v4 https://github.com/rust-lang/cargo/pull/12852. Could you try changing version = 3
to version = 4
in Cargo.lock, and run
cargo vendor` again and see if it works?
Yep, changing the version to 4 and running cargo update
changed ?branch=avnik/vsock+tonic
fragment in the lockfile to ?branch=avnik%2Fvsock%2Btonic
and this fixes everything. Closing as already fixed.
Problem
In the example given below, this is what
cargo check says
:Expected behavior: no issue with vendoring this dependency. This was also reported in ipetkov/crane#549 but seems to actually be a bug in cargo.
Steps
Possible Solution(s)
Percent-encode URLs more strictly (see notes)
Notes
This is what
cargo update
says in the example given:Looks like
cargo
treats+
in the URL as a space symbol encoded following RFC 1866, notices that the actual branch name has a plus and not a space, but does not encode the+
symbol as recommended by RFC 3986.Version
cargo 1.82.0-nightly (257b72b8a 2024-07-30) release: 1.82.0-nightly commit-hash: 257b72b8adfb1f2aa9916cefca67285c21666276 commit-date: 2024-07-30 host: aarch64-apple-darwin libgit2: 1.8.1 (sys:0.19.0 vendored) libcurl: 8.9.1 (sys:0.4.73+curl-8.8.0 system ssl:OpenSSL/3.0.14) ssl: OpenSSL 3.3.1 4 Jun 2024 os: Mac OS 14.4.1 [64-bit]