-
Notifications
You must be signed in to change notification settings - Fork 8
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
feat: add optional dep-kind parameter #102
feat: add optional dep-kind parameter #102
Conversation
99068cd
to
2da513e
Compare
@cgwalters it turned out to be more complicated that I initially thought, but here is a solution with hopefully minimal impact to everyone not needing the additional filtering. Let me know what you think. |
I very superficially skimmed this and it seems sane but I'd like to cut a new release first before merging and then take this one for the next cycle if that's OK. |
ba5cfaf
to
3309c3e
Compare
OK provided we can agree on a reasonable timeline for your next cycle 😉 The change is fully backwards compatible and nothing additional is computed or filtered until the Some background to the last commit: the only dev dependency of this crate $ cargo tree --package once_cell --invert
once_cell v1.20.2
├── openssl v0.10.68
│ └── cargo-vendor-filterer v0.5.14
├── serial_test v3.1.1
│ [dev-dependencies]
│ └── cargo-vendor-filterer v0.5.14
└── tempfile v3.13.0
└── cargo-vendor-filterer v0.5.14
[dev-dependencies]
└── cargo-vendor-filterer v0.5.14 To ensure the logic is tested I pull in a Should bringing this dev-dependency for testing purposes be a problem, I can remove problematic tests or use a different crate. |
ba8f940
to
c48a504
Compare
allows filtering dev or build dependencies
note that once_cell becomes a normal dependency because it is required by a tempfile v3.13.0
c48a504
to
eaadf9f
Compare
The serial_test seems fine to me, skimming https://crates.io/crates/serial_test/reverse_dependencies it's pulled in by rustix e.g. Still without looking deep at the code yet...it looks like the tracking issue you filed against cargo got put in their (looong) backlog, which is totally understandable. The bar is relatively lower for landing features here 😄 (which is both good and bad). My biggest concern is:
Subconcerns:
|
86444a9
to
d3a3281
Compare
Thanks for the review. I agree with your main point that Initially, I started by changing the I like your idea of avoiding a potential conflict with the |
d3a3281
to
0cbf338
Compare
0cbf338
to
68d9427
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one doc change that needs doing and a nit, otherwise looks good to me
Ah yeah now we need to drop the unnecessary |
Co-authored-by: Colin Walters <[email protected]>
dcdf239
to
ff33b63
Compare
SGTM.
This is also fine by me. It seems somewhat unlikely that cargo would add the option with the same name but different functionality in the end too. |
Thanks for your contribution! OK now I think we should get #107 in after the submitter comes back with fixes and then I think we can do a new release later this next week. It's probably about time to submit that next release to various Rust news channels like reddit.com/r/rust perhaps? Probably everyone who needs this project has already found it but still it's important to talk about what we're doing sometimes. |
Thanks for your detailed review and I agree with the proposed next steps. I think it makes sense to mention this project in relevant open cargo issues – this is how we found your project as a solution to a not-yet-solved point there. |
Adds an optional
--dep-kinds
flag allowing to filtering out dev or build dependencies similarly to the edges option in cargo tree (https://doc.rust-lang.org/cargo/commands/cargo-tree.html)Possible values are:
all
(default)normal
build
dev
no-normal
no-build
no-dev
The goal was to modify as little as possible the existing code base and to add the additional filtering only if the optional parameter is set.
Ideally this filter will be added to the cargo metadata, so that the commit can be reworked to apply the filter directly in function
add_packages_for_platform()
Closes #101