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

Require a method to avoid vendoring target deps that will never be used #12393

Closed
flukejones opened this issue Jul 23, 2023 · 4 comments
Closed
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage.

Comments

@flukejones
Copy link

Problem

This is best illustrated with some screenshots.

Screenshot from 2023-07-24 10-26-26

Screenshot from 2023-07-24 10-28-01

I have a project that will only ever be built for Linux. I don't see any obvious way to specify this as such and so I'm not sure how best to handle it. But it is an issue because this project gets built on external servers for packaging for distros, and having such an absurdly high vendoring size can adversely affect these constrained environments.

Proposed Solution

Something along the lines of:

[package]
name = "named_thing"
version.workspace = true
license = "MPL-2.0"
target = "unix"
target_arch = "x86_64"

which would then restrict all chained [target.'cfg(TARGET_OS)'.dependencies] automatically as they could then never be built, and as such vendoring for these targets can be fully ignored.

Notes

No response

@flukejones flukejones added C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage. labels Jul 23, 2023
@weihanglo
Copy link
Member

Thanks for the report.
Feel like this is a duplicate of #7058 to some extent. The solution of each of them is very likely the same.

@weihanglo
Copy link
Member

These are all feature requests for partial vendoring:

@flukejones
Copy link
Author

Sounds like a much needed feature then. Especially for target-os and feature sets, where both of these would contribute heavily to reduced source package sizes for Linux distribution builds.

@weihanglo
Copy link
Member

Thanks. I'll close this in favor of the aforementioned issues.

@weihanglo weihanglo closed this as not planned Won't fix, can't repro, duplicate, stale Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

2 participants