Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Run cargo udeps as part of CI #1500

Closed
D4nte opened this issue Oct 8, 2019 · 2 comments
Closed

Run cargo udeps as part of CI #1500

D4nte opened this issue Oct 8, 2019 · 2 comments

Comments

@D4nte
Copy link
Contributor

D4nte commented Oct 8, 2019

Problem

We have no way to ensure that any of the deps in Cargo.toml are used.

Goal

Make CI fail if Cargo.toml contains unused deps

Recommendation

Try with https://lib.rs/crates/cargo-udeps

@thomaseizinger
Copy link
Contributor

thomaseizinger commented Oct 8, 2019

We may want to consider not running it as part of CI because the README of this thing says it can yield false-positives.
I'd be keen to have a GitHub action that runs every day or something and opens a PR that removes the resulting dependency instead of doing it as part of CI. This way we would have more control over false-positives and can add them to a manual ignore list or something.
See actions-rs/meta#11.

@D4nte
Copy link
Contributor Author

D4nte commented Oct 20, 2019

Udeps is not stable:

error: internal compiler error: src/librustc/ty/context.rs:211: node type <L>::Identity (hir_id=HirId { owner: DefIndex(4112), local_id: 5 }) with HirId::owner DefId(0:4112 ~ cnd[3821]::http_api[0]::routes[0]::rfc003[0]::accept[0]::_IMPL_DESERIALIZE_FOR_OnlyRedeem[0]::{{impl}}[0]) cannot be placed in TypeckTables with local_id_root DefId(0:4109 ~ cnd[3821]::http_api[0]::routes[0]::rfc003[0]::accept[0]::_IMPL_DESERIALIZE_FOR_OnlyRedeem[0])

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:917:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.40.0-nightly (20cc75272 2019-10-09) running on x86_64-apple-darwin

note: compiler flags: -Z save-analysis -C debuginfo=2 -C incremental --crate-type lib

note: some of the compiler flags provided by cargo are hidden

error: aborting due to previous error

Error: StrErr("Could not compile `cnd`.")

@D4nte D4nte closed this as completed Oct 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants