dream2nix icon indicating copy to clipboard operation
dream2nix copied to clipboard

cargo-lock translator throwing error when same dependency added from different sources in different packages

Open zyansheep opened this issue 2 years ago • 1 comments
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

zyansheep avatar Mar 01 '23 05:03 zyansheep

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)

90-008 avatar Mar 24 '23 14:03 90-008