dream2nix
dream2nix copied to clipboard
cargo-lock translator throwing error when same dependency added from different sources in different packages
trafficstars
Hello! I found an error :D
Error
> nix develop
error: attribute 'metadata' missing
at /nix/store/9ky8w9ynamwx3qxx0zqifsnw37jj3xk0-source/src/subsystems/rust/translators/cargo-lock/default.nix:104:7:
103| in
104| parsedLock.metadata."${key}";
| ^
105|
(use '--show-trace' to show detailed location information)
Reproduction
./Cargo.toml:
[package]
name = "nci-test"
version = "0.1.0"
edition = "2018"
[dependencies]
log = "0.3" # Also fails if the same version as Git (i.e. 0.4)
subcrate = { path = "subcrate" }
./subcrate/Cargo.toml
[package]
name = "subcrate"
version = "0.1.0"
edition = "2018"
[dependencies]
log = { git = "https://github.com/rust-lang/log" }
MRE repo: https://github.com/zyansheep/nci-test
I merged #481, it doesn't actually fix this but it adds support to fix this into dream2nix itself. cargo's vendoring functionality needs to be fixed in order for this to be fixed. (see https://github.com/rust-lang/cargo/issues/10310)