Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upCargo.toml should include supported platforms info #1911
Comments
alexcrichton
added
the
A-errors
label
Aug 17, 2015
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton how do I get feedback on this? Should this be a RFC? |
This comment has been minimized.
This comment has been minimized.
|
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? |
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton I understand. |
carols10cents
added
the
A-external-dependencies
label
May 10, 2017
This comment has been minimized.
This comment has been minimized.
|
What's the state of platform-specific dependencies in 2018 cargo? |
This comment has been minimized.
This comment has been minimized.
|
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. |
achanda commentedAug 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.