-
Notifications
You must be signed in to change notification settings - Fork 175
Open
Description
The workspace Cargo.lock contains three crates that appear from both crates.io and git forks with the same name-version:
bls12_381 v0.8.0— registry +https://github.com/lambdaclass/bls12_381(branchexpose-fp-struct)halo2curves-axiom v0.7.2— registry +https://github.com/axiom-crypto/halo2curves.git(tagv0.7.2)zkhash v0.2.0— registry +https://github.com/HorizenLabs/poseidon2.git(revbb476b9)
This works fine with cargo build (which resolves from the lockfile), but breaks vendoring tools like cargo vendor and Nix's importCargoLock/fetchCargoVendor, which cannot handle two sources for the same package name-version:
error: found duplicate version of package `bls12_381 v0.8.0` vendored from two sources
Adding these lines to the workspace Cargo.toml would unify the sources and fix vendoring:
[patch.crates-io]
bls12_381 = { git = "https://github.com/lambdaclass/bls12_381", branch = "expose-fp-struct" }
halo2curves-axiom = { git = "https://github.com/axiom-crypto/halo2curves.git", tag = "v0.7.2" }
zkhash = { git = "https://github.com/HorizenLabs/poseidon2.git", rev = "bb476b9" }This tells Cargo to always use the git fork instead of the registry version, eliminating the duplicate. The existing Cargo.lock resolution stays the same — it just makes vendoring work.
Found while packaging ethrex for nix-community/ethereum.nix.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels