Skip to content

docs: add documentation on platform 'triple's, example usages #11398

@kevinushey

Description

@kevinushey

Problem

Primarily related to https://doc.rust-lang.org/cargo/reference/config.html.

I believe it would be helpful if that page included:

  • A brief discussion of what a platform 'triple' is, or a link to a document with such a description;
  • Some instructions on how one can figure out the 'triple' for their host machine, or other potential targets.

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 in config.toml. Here, <triple> refers to a Target Triplet. It has the form <machine>-<vendor>-<os>, and you can use:

rustc -vV

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.

Metadata

Metadata

Assignees

Labels

A-documenting-cargo-itselfArea: Cargo's documentationC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`E-easyExperience: Easy

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions