Closed joao-paulo-parity closed 1 year ago
windows-sys didn't show up in the logs of https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/1651556/raw (from https://github.com/paritytech/substrate/pull/11722) despite sc-executor-wasmtime
being used. I infer it's because it's a dependency for Windows and the CI runner was running Ubuntu. That being said, something inside of cargo_lock
- which I still haven't figured out what it is exactly - caught a problem which neither cargo metadata
nor cargo check
ran into, so there must be a lead there. If for some reason cargo-lock doesn't suffice, another option would be to use cargo's APIs directly.
So far I haven't been able to reproduce that problem, but at the same time I didn't spend a lot of time on it; I still expect to make some progress on this soon.
Related cargo_lock
ticket: https://github.com/rustsec/rustsec/issues/606
V2+ lockfiles need to resolve dependencies based on the minimum amount of the (package_name, version, source_id) tuple which is needed to unambiguously identify them.
More context for a possible solution was provided in https://github.com/rustsec/rustsec/issues/606#issuecomment-1189472257
IMO Not a job of check-dependent
Problem: In https://github.com/paritytech/polkadot/pull/5731, the initial commit's lockfile had two windows-sys
https://github.com/koute/polkadot/blob/8ff2627f00c88e5f0997b44f444b67d3a83d3444/Cargo.lock#L12687
https://github.com/koute/polkadot/blob/8ff2627f00c88e5f0997b44f444b67d3a83d3444/Cargo.lock#L12700
However one of the packages didn't qualify which one of the two versions to use, as shown in https://github.com/koute/polkadot/blob/8ff2627f00c88e5f0997b44f444b67d3a83d3444/Cargo.lock#L6054
The follow-up commit had to fix that in https://github.com/paritytech/polkadot/pull/5731/commits/2abfa1c7435b57155aa28ecc106f547539b454c7#diff-13ee4b2252c9e516a0547f2891aa2105c3ca71c6d7a1e682c69be97998dfc87eR6054.
The problem here is that the integration check didn't catch the invalid lockfile before merge.
Solution: check the lockfile more thoroughly for ambiguous dependencies. Need to figure out why neither
cargo check
norcargo metadata
complained in that case.