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

Cargo.toml should include supported platforms info #1911

Closed
achanda opened this issue Aug 17, 2015 · 6 comments
Closed

Cargo.toml should include supported platforms info #1911

achanda opened this issue Aug 17, 2015 · 6 comments
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself. A-target-dependencies Area: [target.'cfg(foo)'.dependencies]

Comments

@achanda
Copy link
Contributor

achanda commented Aug 17, 2015

Some crates are platform dependent. It will be nice if this dependency can be advertised in the Cargo.toml file. When building a crate on a system, the cargo binary can then use this info to determine if any of the dependencies do not support this platform. This will help in erring out early while building a crate.

@alexcrichton alexcrichton added the A-diagnostics Area: Error and warning messages generated by Cargo itself. label Aug 17, 2015
@achanda
Copy link
Contributor Author

achanda commented Aug 18, 2015

@alexcrichton how do I get feedback on this? Should this be a RFC?

@alexcrichton
Copy link
Member

Yeah I'd recommend starting out with a discussion on internals or users to see if others have feedback, and then eventually there'd need to be an RFC for this.

I would personally not want to dive too much into this space, we've already got a number of pain points of platform-specific logic in Cargo.toml. In general we've gotten a whole lot more mileage for pushing this kind of logic into the source code rather than Cargo itself. I also generally feel that lots of infrastructure for just a better error message may not always be worth it, but there may be some other benefits we could get here as well maybe?

@achanda
Copy link
Contributor Author

achanda commented Aug 20, 2015

@alexcrichton I understand.
I was looking at https://internals.rust-lang.org/t/production-user-research-summary/2530 and it seems one of the customer asks is this. I will follow up on this.

@carols10cents carols10cents added the A-external-dependencies Area: dependencies on things outside of cargo label May 10, 2017
@dwijnand
Copy link
Member

What's the state of platform-specific dependencies in 2018 cargo?

@alexcrichton
Copy link
Member

Platform-specific dependencies are supported through either:

[target.wasm32-unknown-unknown.dependencies] # full target name 
# ...

[target.'cfg(windows)'.dependencies] # `cfg` expressions
# ...

I think this issue though is moreso about explicitly specifying platform-support in Cargo.toml to have Cargo print a better error message about "This crate doesn't compile or work on Windows", for example, than being about platform-specific dependencies.

@weihanglo weihanglo added A-target-dependencies Area: [target.'cfg(foo)'.dependencies] and removed A-external-dependencies Area: dependencies on things outside of cargo labels Oct 11, 2022
@weihanglo
Copy link
Member

Going to close this in favor of #11313. #11313 contains a more complete proposal and recent discussions.

@weihanglo weihanglo closed this as not planned Won't fix, can't repro, duplicate, stale May 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself. A-target-dependencies Area: [target.'cfg(foo)'.dependencies]
Projects
None yet
Development

No branches or pull requests

5 participants