-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cargo vendor can't handle duplicates. #10310
Comments
What were you doing when you got this error? How did you have things set up? |
This repo terminal-discord/weechat-discord is reproducible. And this is a reproducible test case: registry::alt_init();
let p = project()
.file(
"Cargo.toml",
r#"
[project]
name = "foo"
version = "0.0.1"
authors = []
[dependencies]
bar = "0.0.1"
[dependencies.foo]
package = "bar"
version = "0.0.1"
registry = "alternative"
"#,
)
.file("src/main.rs", "fn main() {}")
.build();
Package::new("bar", "0.0.1").publish();
Package::new("bar", "0.0.1").alternative(true).publish();
p.cargo("build").run();
p.cargo("vendor --respect-source-config")
.with_stderr(
"\
[ERROR] failed to sync
Caused by:
found duplicate version of package `bar v0.0.1` vendored from two sources:
<tab>source 1: registry `alternative`
<tab>source 2: registry `crates-io`
",
)
.with_status(101)
.run() There is also an existing test case for the issue: |
Unfortunately, When running under a project with 2018 edition and lockfile v1,
Version I used to compile
|
Something else I noticed is that I can't seem to patch the .lock file to avoid this issue. I was trying to build this package here: https://github.com/lapce/lapce |
I'm also having this issue running
|
I ran into this yesterday when trying to use my own fork of a library for testing. Judging by the error messages here, that seems to be the typical case. While I think there may not be much legitimate use for the old I would suggest changing the error message to show which packages are requesting the duplicate package - and if the "please use my fork" case is in fact the typical case, perhaps the message could be tailored to that as well. |
Thanks for sharing your case. Note that the previous work was suspended due to namespaced package RFC, see #10344 (comment) for the reason. |
I too am having issue with this when referring to my fork via git url of a crates.io crate. |
Problem
Steps
No response
Possible Solution(s)
reimplement
--no-merge-sources
fromcargo-vendor
Notes
Makes building packages on NixOS a pain to maintain:
NixOS/nixpkgs#30742
Version
No response
The text was updated successfully, but these errors were encountered: