built icon indicating copy to clipboard operation
built copied to clipboard

Filter dependencies by feature, target, and kind

Open jwodder opened this issue 2 years ago • 2 comments
trafficstars

Currently, it appears that built determines the value of DEPENDENCIES by just parsing Cargo.lock and extracting the name & version of every entry. This strikes me as suboptimal, as presumably one would want the list of dependencies stored in a binary to match the actual dependencies used to build it, i.e., excluding dev dependencies, dependencies for other targets, and dependencies for inactive features.

As built currently doesn't do such filtering, I implemented it myself in my own build.rs by using cargo-metadata and traversing the "resolve" nodes; feel free to make use of this MIT-licensed code if you need it.

jwodder avatar May 15 '23 20:05 jwodder

folding into #49

lukaslueg avatar May 18 '23 19:05 lukaslueg

@lukaslueg Could this be re-opened? What I'm asking for is distinctly different from just separating direct dependencies from indirect, and this issue is not resolved by the commit that resolved #49.

jwodder avatar Sep 09 '23 12:09 jwodder