nix-community / crate2nix

rebuild only changed crates in CI with crate2nix and nix
https://nix-community.github.io/crate2nix/
Apache License 2.0
382 stars 89 forks source link

Error with dep that has a local dep #337

Open zdcthomas opened 8 months ago

zdcthomas commented 8 months ago

Hi! I'm running into an issue where a dependency of mine is failing to build during the unpack phase because one of it's dependencies can't be found. The error I'm getting is:

a0x-crate2nix> Running phase: unpackPhase
a0x-crate2nix> unpacking source archive /nix/store/xdyjj76rbv5ki1496spx6ix7fm3idnrk-k2pmypa8pjnj0aqvlgsl2wgik7n6iax6-source
a0x-crate2nix> source root is k2pmypa8pjnj0aqvlgsl2wgik7n6iax6-source
a0x-crate2nix> Running phase: buildPhase
a0x-crate2nix> ++ crate2nix generate -f ./Cargo.toml -o Cargo-generated.nix -h /nix/store/g1l3s8hcg9zlgih9hcdw3virr23zamh0-a0x-crate2nix/crate-hashes.json
a0x-crate2nix> Error: while retrieving metadata about ./Cargo.toml: `cargo metadata` exited with an error: error: no matching package named `clickhouse-rs-cityhash-sys` found
a0x-crate2nix> location searched: https://github.com/suharev7/clickhouse-rs?branch=async-await#afd8ce54
a0x-crate2nix> required by package `clickhouse-rs v1.1.0-alpha.1 (https://github.com/suharev7/clickhouse-rs?branch=async-await#afd8ce54)`
a0x-crate2nix>     ... which satisfies git dependency `clickhouse-rs` (locked to 1.1.0-alpha.1) of package `a0x v0.1.0 (/private/tmp/nix-build-a0x-crate2nix.drv-0/k2pmypa8pjnj0aqvlgsl2wgik7n6iax6-source)`
a0x-crate2nix>     ... which satisfies path dependency `a0x` (locked to 0.1.0) of package `experimental v0.1.0 (/private/tmp/nix-build-a0x-crate2nix.drv-0/k2pmypa8pjnj0aqvlgsl2wgik7n6iax6-source/experimental)`
a0x-crate2nix> crate2nix failed.
a0x-crate2nix> == cargo/config (BEGIN)
a0x-crate2nix>     [source.crates-io]
a0x-crate2nix>     replace-with = "vendored-sources"
a0x-crate2nix>     [source."https://github.com/suharev7/clickhouse-rs?branch=async-await#afd8ce54e3882fec943fac42ab8aa4425e2f40e9"]
a0x-crate2nix>     git = "https://github.com/suharev7/clickhouse-rs"
a0x-crate2nix>     branch = "async-await"
a0x-crate2nix>     replace-with = "vendored-sources"
a0x-crate2nix>     [source."https://github.com/juhaku/utoipa?rev=4e10648a34978da243792cc2689831ace9bcec04#4e10648a34978da243792cc2689831ace9bcec04"]
a0x-crate2nix>     git = "https://github.com/juhaku/utoipa"
a0x-crate2nix>     rev = "4e10648a34978da243792cc2689831ace9bcec04"
a0x-crate2nix>     replace-with = "vendored-sources"
a0x-crate2nix>     [source.vendored-sources]
a0x-crate2nix>     directory = "/nix/store/9c7rdy1bvfi8rhjfli124z9d6q7i3c6q-deps"
a0x-crate2nix> == cargo/config (END)
a0x-crate2nix> == crate-hashes.json (BEGIN)
a0x-crate2nix>     {
a0x-crate2nix>       "clickhouse-rs 1.1.0-alpha.1 (git+https://github.com/suharev7/clickhouse-rs?branch=async-await#afd8ce54e3882fec943fac42ab8aa4425e2f40e9)": "0zmr7dc5halm60hcx7y9s8w88igjc2qwc5xnq1xd1kbz4psfb81v",
a0x-crate2nix>       "clickhouse-rs-cityhash-sys 0.1.2 (git+https://github.com/suharev7/clickhouse-rs?branch=async-await#afd8ce54e3882fec943fac42ab8aa4425e2f40e9)": "0zmr7dc5halm60hcx7y9s8w88igjc2qwc5xnq1xd1kbz4psfb81v",
a0x-crate2nix>       "utoipa 3.5.0 (git+https://github.com/juhaku/utoipa?rev=4e10648a34978da243792cc2689831ace9bcec04#4e10648a34978da243792cc2689831ace9bcec04)": "1xl0rskx005m2jlnbrrzg0hfzbaqb7qg7znc2kapfna33mw0ziyj",
a0x-crate2nix>       "utoipa-gen 3.5.0 (git+https://github.com/juhaku/utoipa?rev=4e10648a34978da243792cc2689831ace9bcec04#4e10648a34978da243792cc2689831ace9bcec04)": "1xl0rskx005m2jlnbrrzg0hfzbaqb7qg7znc2kapfna33mw0ziyj"
a0x-crate2nix>     }
a0x-crate2nix> == crate-hashes.json (END)

My Cargo.toml specifies the clickhouse-rs crate like this clickhouse-rs = {git = "https://github.com/suharev7/clickhouse-rs", branch = "async-await"} and the clickhouse-rs crate specifies it's dependency on the cityhash crate like this

[dependencies.clickhouse-rs-cityhash-sys]
path = "clickhouse-rs-cityhash-sys"
version = "0.1.2"

It's a local dependency here https://github.com/suharev7/clickhouse-rs/tree/async-await/clickhouse-rs-cityhash-sys

To me, the crate looks properly specified as a local path according to the docs but I could be totally wrong.

Any help would be really appreciated! thanks!