-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
docs: add documentation on platform 'triple's, example usages #11398
Comments
Thanks for the report! Target triple has its own place in the appendix. Cargo also mentions target triple in the manual of each build command, such as We may want to refer to the appendix, but I am not sure where to add and what is the right amount of doc to add. Maybe put a reference under |
Thank you for pointing that out! I like the idea of adding a link to the target triple section in the appendix. Maybe the simplest answer here is to add a sentence after the example configuration in https://doc.rust-lang.org/cargo/reference/config.html#configuration-format, with something like:
|
@rustbot claim |
cargo/src/doc/src/reference/config.md Lines 1034 to 1039 in fc2242a
I'd suggest making |
I think that is sufficient, despite that you cannot link to Target Triple directly 🥲. We could also update other pages mentioning that if possible. (Except |
cargo/src/doc/src/appendix/glossary.md Lines 181 to 200 in fc2242a
Couldn't we convert the list in the glossary to
|
Could try that. Just list item feels more natural to me with the surrounding context. |
True. Also the |
[Doc]: Added links to the `Target` section of the glossary for occurences of `target triple` Fix for #11398. #11398 raises the concern that it isn't always abundantly clear in the cargo book, what a `target triple` (i.e. `x86_64-unknown-linux-gnu`) is. This is unfortunate, as it is well described in the [glossary](https://doc.rust-lang.org/cargo/appendix/glossary.html#target) of the cargo book (including the command on how to get all targets supported by `rustc`). To mitigate this problem I added links to the glossary entry for target triples to the sections where triples are referenced, but not enough information is given on what they are and how they look like.
I believe #11603 fixes this. Close it now. Thank you everyone for participating in the discussion and fix! |
Thanks everyone! :-) |
Problem
Primarily related to https://doc.rust-lang.org/cargo/reference/config.html.
I believe it would be helpful if that page included:
Proposed Solution
Perhaps a small section could be added immediately after https://doc.rust-lang.org/cargo/reference/config.html#configuration-format. Here's a short draft:
Platform Triples
Platform-specific compiler and linker flags can be specified as part of
[target.<triple>]
configuration entries inconfig.toml
. Here,<triple>
refers to a Target Triplet. It has the form<machine>-<vendor>-<os>
, and you can use:to infer your machine's platform triple, which is printed as part of the
host:
field.Notes
I'm making this as an issue first just to confirm whether this feels like a worthwhile change; if so, I can make a PR.
The text was updated successfully, but these errors were encountered: