cargo-unmaintained icon indicating copy to clipboard operation
cargo-unmaintained copied to clipboard

Allow selecting target

Open jayvdb opened this issue 1 year ago • 3 comments

It would be very helpful to be able to select the target or targets that I care about, and cargo-unmaintained removes crates which are not used in those targets.

The output for my work monorepo includes

num_cpus (https://github.com/seanmonstar/num_cpus updated 369 days ago)
    hermit-abi (requirement: ^0.3.0, version used: 0.3.9, latest: 0.4.0)

and

wasm-timer (https://github.com/tomaka/wasm-timer updated 1401 days ago)
    parking_lot (requirement: ^0.11, version used: 0.11.2, latest: 0.12.3)
rand_hc (not in https://github.com/rust-random/rand)
atomic-polyfill (https://github.com/embassy-rs/atomic-polyfill archived)

We do use num_cpus, but https://github.com/seanmonstar/num_cpus/blob/master/Cargo.toml states hermit-abi is only used for RustyHermit target, which we dont care about.

And wasm-timer is obviously only a dependency in the wasm target, which we dont care about. Likewise rand_hc & atomic-polyfill are dependencies indirectly only for a target that we dont care about.

I am interested in working with upstreams to fix the problems highlighted by cargo-unmaintained, but not for arch targets that I am not using.

jayvdb avatar Jul 03 '24 00:07 jayvdb

In case it helps, I recently found that cargo-deny supports limiting the active dependency tree by targets. (https://github.com/EmbarkStudios/rust-ecosystem/issues/41#issuecomment-2319992598). Maybe they have a trick which could help here.

jayvdb avatar Aug 30 '24 04:08 jayvdb

I think the trick they are using is https://github.com/EmbarkStudios/cfg-expr

jayvdb avatar Apr 09 '25 01:04 jayvdb

@jayvdb Thanks!

If someone would like to submit a PR for this, I would consider it.

smoelius avatar Apr 09 '25 11:04 smoelius