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

Filter dependencies by feature, target, and kind #55

Open
jwodder opened this issue May 15, 2023 · 2 comments
Open

Filter dependencies by feature, target, and kind #55

jwodder opened this issue May 15, 2023 · 2 comments

Comments

@jwodder
Copy link

jwodder commented May 15, 2023

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.

@lukaslueg
Copy link
Owner

folding into #49

@jwodder
Copy link
Author

jwodder commented Sep 9, 2023

@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.

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

No branches or pull requests

2 participants