Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Failed to match errors in cargo-geiger #263

Merged
merged 1 commit into from
Feb 19, 2022

Conversation

ilyatrefilov
Copy link
Contributor

@ilyatrefilov ilyatrefilov commented Feb 18, 2022

This fixes the issue with Failed to match errors, which was caused by cargo-metadata behaviour of not resolving dev-dependencies of crate dependency.

Now we check if crate is root and if not, we won't collect dev deps for this package, cause they are anyways not in krates graph, which relies on cargo-metadata resolve output field.

Also changed argument for Failed to match error, cause it mentioned
not the real one unmatched package.

Relates to #240

This fixes the issue with `Failed to match` errors, which was caused by
cargo-metadata behaviour of not resolving dev-dependencies of crate
dependency. Now we check if crate is root and if not, we won't collect
dev deps for this package, cause they are anyways not in krates graph,
which relies on cargo-metadata `resolve` output field.
Also changed argument for `Failed to match` error, cause it mentioned
not the real one unmatched package.

Relates to geiger-rs#240
@pinkforest pinkforest self-requested a review February 19, 2022 11:26
@pinkforest
Copy link
Collaborator

pinkforest commented Feb 19, 2022

Thanks for working on this - looks to solve most issues - we need to add support for handling workspaces -

Like git2-rs still complains about serde but that's because we don't handle items in workspaces e.g. running geiger on it's root:

Failed to match (ignoring source) package: serde 1.0.136 (registry+https://github.com/rust-lang/crates.io-index) 
Failed to match (ignoring source) package: serde 1.0.136 (registry+https://github.com/rust-lang/crates.io-index) 
Failed to match (ignoring source) package: serde 1.0.136 (registry+https://github.com/rust-lang/crates.io-index) 
Failed to match (ignoring source) package: serde 1.0.136 (registry+https://github.com/rust-lang/crates.io-index) 
Failed to match (ignoring source) package: serde 1.0.136 (registry+https://github.com/rust-lang/crates.io-index) 
Failed to match (ignoring source) package: serde 1.0.136 (registry+https://github.com/rust-lang/crates.io-index) 
Failed to match (ignoring source) package: serde 1.0.136 (registry+https://github.com/rust-lang/crates.io-index) 
Failed to match (ignoring source) package: serde 1.0.136 (registry+https://github.com/rust-lang/crates.io-index) 
Failed to match (ignoring source) package: serde 1.0.136 (registry+https://github.com/rust-lang/crates.io-index) 
Failed to match (ignoring source) package: serde 1.0.136 (registry+https://github.com/rust-lang/crates.io-index) 
Failed to match (ignoring source) package: serde 1.0.136 (registry+https://github.com/rust-lang/crates.io-index) 
Failed to match (ignoring source) package: serde 1.0.136 (registry+https://github.com/rust-lang/crates.io-index) 
Failed to match (ignoring source) package: serde 1.0.136 (registry+https://github.com/rust-lang/crates.io-index) 
Failed to match (ignoring source) package: serde 1.0.136 (registry+https://github.com/rust-lang/crates.io-index) 
Failed to match (ignoring source) package: serde 1.0.136 (registry+https://github.com/rust-lang/crates.io-index) 
Failed to match (ignoring source) package: serde 1.0.136 (registry+https://github.com/rust-lang/crates.io-index) 
Failed to match (ignoring source) package: serde 1.0.136 (registry+https://github.com/rust-lang/crates.io-index) 
Failed to match (ignoring source) package: serde 1.0.136 (registry+https://github.com/rust-lang/crates.io-index) 
Failed to match (ignoring source) package: serde 1.0.136 (registry+https://github.com/rust-lang/crates.io-index) 
Failed to match (ignoring source) package: serde 1.0.136 (registry+https://github.com/rust-lang/crates.io-index) 
Failed to match (ignoring source) package: serde 1.0.136 (registry+https://github.com/rust-lang/crates.io-index) 
Failed to match (ignoring source) package: serde 1.0.136 (registry+https://github.com/rust-lang/crates.io-index) 
Failed to match (ignoring source) package: serde 1.0.136 (registry+https://github.com/rust-lang/crates.io-index) 
Failed to match (ignoring source) package: serde 1.0.136 (registry+https://github.com/rust-lang/crates.io-index) 
Failed to match (ignoring source) package: serde 1.0.136 (registry+https://github.com/rust-lang/crates.io-index) 

cargo tree does not show serde in graph but yet it's in Cargo.lock via systest crate via workspace which we don't graph these workspace members causing these adidtional failed to matches perhaps;

[[package]]
name = "systest"
dependencies = [
 ..
 "ctest",
]

[[package]]
name = "ctest"
version = "0.2.22"
dependencies = [
 ..
 "syntex_syntax2",
]

[[package]]
name = "syntex_syntax2"
version = "0.0.2"
dependencies = [
  ..
  "serde",
  "extprim",
]

[[package]]
name = "extprim"
version = "1.7.1"
dependencies = [
   ..
   "serde",
]

@pinkforest
Copy link
Collaborator

p.s. if you want to hang in discord - please feel free to join: https://discord.gg/5E2gQNaB

@pinkforest pinkforest merged commit 086033b into geiger-rs:master Feb 19, 2022
@ilyatrefilov ilyatrefilov deleted the fix_failed_to_match branch February 19, 2022 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants