-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
buildRustPackage: found duplicate version of package #30742
Comments
cc @zimbatm |
I did the packaging but actually don't have much insight on how the internals are working. The cargo-vendor author might be able to tell us why the [replace] directive is not overriding the crates.io entry. |
Hey I have run into this issue trying to build a package for "spotifyd". Did you ever find a solution? |
FTR, cargo-vendor has a flag ( |
I was also working on a package for spotifyd (see #47172), but just like @BadDecisionsAlex I ran into this issue. @ljli I couldn't find the Also, I was able to build spotifyd inside nix-shell:
|
The flag
I'll try to have a look tomorrow. |
My first attempt to hook up I think something along those lines should work, it is based on staging because of #46362.
I have no clue why, maybe this is a local problem so you are welcome to try the branch and/or pick it up from there, otherwise I'll investigate after staging got merged. |
Could you perhaps submit a pull request for that? I'm running into the same problem. |
A bunch of things have changed on the rust packaging side which probably fix this issue. Ping me if I should re-open. |
@zimbatm I think this issue is still quite relevant. See: rustPlatform.buildRustPackage {
pname = "weechat-discord";
version = "test";
src = fetchFromGitHub {
owner = "terminal-discord";
repo = "weechat-discord";
rev = "e09bac671b14c389f9909d8393ab76a575c5df73";
sha256 = "0n1681vn0w2a4zjfmaimbbjsfpc5aflp9rr5w7j3zh1mp87wnxdj";
};
cargoSha256 = "0000000000000000000000000000000000000000000000000000";
buildInputs = [
];
} Which for me, fails with:
|
On what version of nixpkgs did you experience the issue? |
Unstable and/or master, and simply trying to build that expression suffices to create that error. Here is it wrapped in a shell script for your convenience: |
I ran into the same error while building a project with a direct dependency that is also a dependency of another direct dependency but from a different source. The resulting https://github.com/paritytech/polkadot/blob/master/Cargo.lock#L6694-L6702 The package builds fine in a nix-shell, but fails in the |
Hit this again trying to build servo. Has anyone got any ideas for this? |
Is there a code somewhere where I can just run |
I posted a shell script a month ago, assuming you didn't try it (the link is now dead). Here is the exact same expression fleshed out to a self-contained default.nix and gisted. It reliably reproduces the error: https://gist.github.com/bqv/3209cb2115075797631b8cd33775a40a Suffice to say, trying to buildRustPackage any of the three projects we've mentioned will result in this failure. |
here is a minimally-reproducible version: { pkgs ?
import <nixpkgs> {
config = {};
overlays = [];
}
}:
pkgs.rustPlatform.buildRustPackage {
pname = "weechat-discord";
version = "test";
src = pkgs.fetchFromGitHub {
owner = "terminal-discord";
repo = "weechat-discord";
rev = "e09bac671b14c389f9909d8393ab76a575c5df73";
sha256 = "0n1681vn0w2a4zjfmaimbbjsfpc5aflp9rr5w7j3zh1mp87wnxdj";
};
cargoSha256 = "0000000000000000000000000000000000000000000000000000";
} |
If you run this: $ git clone https://github.com/terminal-discord/weechat-discord
$ cd weechat-discord
$ cargo vendor
...
Caused by:
found duplicate version of package `parking_lot v0.9.0` vendored from two sources:
source 1: https://github.com/terminal-discord/parking_lot?rev=046a171#046a1714
source 2: registry `https://github.com/rust-lang/crates.io-index` You will get the same error message, since their The nix build relies on Interestingly, $ cargo vendor --no-merge-sources
error: the crates.io `cargo vendor` command has now been merged into Cargo itself
and does not support the flag `--no-merge-sources` currently; to continue using the flag you
can execute `cargo-vendor vendor ...`, and if you would like to see this flag
supported in Cargo itself please feel free to file an issue at
https://github.com/rust-lang/cargo/issues/new |
Correct, this is the case for all three projects. Cargo build succeeds fine on all three however, so we shouldn't be blaming this on cargo |
Unfortunately, |
Same issue when trying to build https://github.com/cloud-hypervisor/cloud-hypervisor Any new information/ideas how to solve this issue? |
To ensure that cargo downloads all the dependencies in a reproducible manner, However Here is for example what I do to fix vendoring for Parity polkadot. |
I marked this as stale due to inactivity. → More info |
Should this be reported upstream to cargo? Is there any work around, I want to build lapce. |
got a similar issue when trying to update neovide, sadly I dont know enough about rust to help
|
Is there a workaround for this? |
There's a PR open to fix this rust-lang/cargo#10344, maintainers of |
cc @danieldk @Ericson2314 @Mic92 @LnL7 @zowoq sorry to bother, just trying to figure out who manages |
I ran into this issue, and in my case it was possible to work around / fix it in the upstream Cargo package. In my case, the problem was a patched dependency through |
I can't init at 1.1.2 because there's an issue while vendoring the packages. v1.1.2 seem to require two different version of the same package, causing an issue similar to NixOS#30742.
Can we get rid of broken We could reconstruct repository at |
Using For example, if you package TiKV, even after working around 3 duplicates, you'll hit at build failure of |
I ran into this issue when trying to wgsl-analyzer. In their With the cancellation of rust-lang/cargo#10344 due to potential syntactic conflict with another Rust RFC, the problem is unlikely to be solved upstream soon. I support @kvtb's idea of migrating away from |
We use the bug/host_header branch in the gateway crate. Using another branch here creates problems when using `cargo vendor`. For more information, see: NixOS/nixpkgs#30742
I reimplemented |
Actually, I don't know if it will be merged or not. This issue seems to be resolved by applying a patch to cargo. |
The cargo's build itself works with |
I wanted to upgrade rustup to 1.6 now that we have a recent rust compiler again thanks to #30088.
Unfortunately I got an error, the log tail is below.
Rustup uses a [replace] section for mio in its Cargo.toml, so that is probably the cause for the error.
The error output itself is from cargo-vendor. I would report it there but I'm not sure why it can't handle this, maybe there is some good reason and we should use it in a different way.
There shouldn't be any trouble to reproduce this, updating the hash and version for the rustup derivation
should do.
I suspect this is a general problem with cargo packages that use [replace], hence the issue name.
The text was updated successfully, but these errors were encountered: