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

Open
achanda opened this Issue Aug 17, 2015 · 5 comments

Comments

Projects
None yet
4 participants
@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.

@achanda

This comment has been minimized.

Copy link
Contributor Author

achanda commented Aug 18, 2015

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

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Aug 18, 2015

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

This comment has been minimized.

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.

@dwijnand

This comment has been minimized.

Copy link
Member

dwijnand commented Oct 12, 2018

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

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Oct 13, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.