Skip to content

Commit b23e0a9

Browse files
committed
documentation for host target specifier
1 parent b3f5e05 commit b23e0a9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+704
-363
lines changed

src/cargo/util/command_prelude.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ pub trait ArgMatchesExt {
670670
bail!(
671671
"\"--target\" takes a target architecture as an argument.
672672
673-
Run `{cmd}` to see possible targets."
673+
Run `{cmd}` to see possible targets, or specify `host` for the host architecture."
674674
);
675675
}
676676
Ok(self._values_of("target"))
@@ -1258,7 +1258,9 @@ fn get_target_triples() -> Vec<clap_complete::CompletionCandidate> {
12581258
}
12591259

12601260
// Allow tab-completion for `host` as the desired target.
1261-
candidates.push(clap_complete::CompletionCandidate::new("host"));
1261+
candidates.push(clap_complete::CompletionCandidate::new("host").help(Some(
1262+
concat!("alias for: ", env!("RUST_HOST_TARGET")).into(),
1263+
)));
12621264

12631265
candidates
12641266
}

src/doc/man/generated_txt/cargo-bench.txt

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -220,18 +220,30 @@ OPTIONS
220220

221221
Compilation Options
222222
--target triple
223-
Benchmark for the given architecture. The default is the host
224-
architecture. The general format of the triple is
225-
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for
226-
a list of supported targets. This flag may be specified multiple
227-
times.
223+
Benchmark for the specified target (may be specified multiple times)
224+
The default is the host architecture. The general format of the
225+
triple is <arch><sub>-<vendor>-<sys>-<abi>.
226+
227+
You may specify the following kinds of targets:
228+
229+
o Any supported target in rustc --print target-list (note: you have
230+
to install/add the target to use it).
231+
232+
o host, which will internally be substituted by the host’s
233+
target. This can be particularly useful if you’re
234+
cross-compiling some crates, and don’t want to specify your
235+
host’s machine as a target (for instance, an xtask in a shared
236+
project that may be worked on by many hosts).
237+
238+
o A path to a custom target specification (further reading here
239+
<https://doc.rust-lang.org/rustc/targets/custom.html#custom-target-lookup-path>).
228240

229241
This may also be specified with the build.target config value
230242
<https://doc.rust-lang.org/cargo/reference/config.html>.
231243

232-
Note that specifying this flag makes Cargo run in a different mode
233-
where the target artifacts are placed in a separate directory. See
234-
the build cache
244+
Note: Specifying this flag makes Cargo run in a different mode where
245+
the target artifacts are placed in a separate directory. See the
246+
build cache
235247
<https://doc.rust-lang.org/cargo/reference/build-cache.html>
236248
documentation for more details.
237249

src/doc/man/generated_txt/cargo-build.txt

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,18 +137,30 @@ OPTIONS
137137

138138
Compilation Options
139139
--target triple
140-
Build for the given architecture. The default is the host
141-
architecture. The general format of the triple is
142-
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for
143-
a list of supported targets. This flag may be specified multiple
144-
times.
140+
Build for the specified target (may be specified multiple times) The
141+
default is the host architecture. The general format of the triple
142+
is <arch><sub>-<vendor>-<sys>-<abi>.
143+
144+
You may specify the following kinds of targets:
145+
146+
o Any supported target in rustc --print target-list (note: you have
147+
to install/add the target to use it).
148+
149+
o host, which will internally be substituted by the host’s
150+
target. This can be particularly useful if you’re
151+
cross-compiling some crates, and don’t want to specify your
152+
host’s machine as a target (for instance, an xtask in a shared
153+
project that may be worked on by many hosts).
154+
155+
o A path to a custom target specification (further reading here
156+
<https://doc.rust-lang.org/rustc/targets/custom.html#custom-target-lookup-path>).
145157

146158
This may also be specified with the build.target config value
147159
<https://doc.rust-lang.org/cargo/reference/config.html>.
148160

149-
Note that specifying this flag makes Cargo run in a different mode
150-
where the target artifacts are placed in a separate directory. See
151-
the build cache
161+
Note: Specifying this flag makes Cargo run in a different mode where
162+
the target artifacts are placed in a separate directory. See the
163+
build cache
152164
<https://doc.rust-lang.org/cargo/reference/build-cache.html>
153165
documentation for more details.
154166

src/doc/man/generated_txt/cargo-check.txt

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,18 +134,30 @@ OPTIONS
134134

135135
Compilation Options
136136
--target triple
137-
Check for the given architecture. The default is the host
138-
architecture. The general format of the triple is
139-
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for
140-
a list of supported targets. This flag may be specified multiple
141-
times.
137+
Check for the specified target (may be specified multiple times) The
138+
default is the host architecture. The general format of the triple
139+
is <arch><sub>-<vendor>-<sys>-<abi>.
140+
141+
You may specify the following kinds of targets:
142+
143+
o Any supported target in rustc --print target-list (note: you have
144+
to install/add the target to use it).
145+
146+
o host, which will internally be substituted by the host’s
147+
target. This can be particularly useful if you’re
148+
cross-compiling some crates, and don’t want to specify your
149+
host’s machine as a target (for instance, an xtask in a shared
150+
project that may be worked on by many hosts).
151+
152+
o A path to a custom target specification (further reading here
153+
<https://doc.rust-lang.org/rustc/targets/custom.html#custom-target-lookup-path>).
142154

143155
This may also be specified with the build.target config value
144156
<https://doc.rust-lang.org/cargo/reference/config.html>.
145157

146-
Note that specifying this flag makes Cargo run in a different mode
147-
where the target artifacts are placed in a separate directory. See
148-
the build cache
158+
Note: Specifying this flag makes Cargo run in a different mode where
159+
the target artifacts are placed in a separate directory. See the
160+
build cache
149161
<https://doc.rust-lang.org/cargo/reference/build-cache.html>
150162
documentation for more details.
151163

src/doc/man/generated_txt/cargo-clean.txt

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,30 @@ OPTIONS
4545
target in the root of the workspace.
4646

4747
--target triple
48-
Clean for the given architecture. The default is the host
49-
architecture. The general format of the triple is
50-
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for
51-
a list of supported targets. This flag may be specified multiple
52-
times.
48+
Clean for the specified target (may be specified multiple times) The
49+
default is the host architecture. The general format of the triple
50+
is <arch><sub>-<vendor>-<sys>-<abi>.
51+
52+
You may specify the following kinds of targets:
53+
54+
o Any supported target in rustc --print target-list (note: you have
55+
to install/add the target to use it).
56+
57+
o host, which will internally be substituted by the host’s
58+
target. This can be particularly useful if you’re
59+
cross-compiling some crates, and don’t want to specify your
60+
host’s machine as a target (for instance, an xtask in a shared
61+
project that may be worked on by many hosts).
62+
63+
o A path to a custom target specification (further reading here
64+
<https://doc.rust-lang.org/rustc/targets/custom.html#custom-target-lookup-path>).
5365

5466
This may also be specified with the build.target config value
5567
<https://doc.rust-lang.org/cargo/reference/config.html>.
5668

57-
Note that specifying this flag makes Cargo run in a different mode
58-
where the target artifacts are placed in a separate directory. See
59-
the build cache
69+
Note: Specifying this flag makes Cargo run in a different mode where
70+
the target artifacts are placed in a separate directory. See the
71+
build cache
6072
<https://doc.rust-lang.org/cargo/reference/build-cache.html>
6173
documentation for more details.
6274

src/doc/man/generated_txt/cargo-doc.txt

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,18 +112,30 @@ OPTIONS
112112

113113
Compilation Options
114114
--target triple
115-
Document for the given architecture. The default is the host
116-
architecture. The general format of the triple is
117-
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for
118-
a list of supported targets. This flag may be specified multiple
119-
times.
115+
Document for the specified target (may be specified multiple times)
116+
The default is the host architecture. The general format of the
117+
triple is <arch><sub>-<vendor>-<sys>-<abi>.
118+
119+
You may specify the following kinds of targets:
120+
121+
o Any supported target in rustc --print target-list (note: you have
122+
to install/add the target to use it).
123+
124+
o host, which will internally be substituted by the host’s
125+
target. This can be particularly useful if you’re
126+
cross-compiling some crates, and don’t want to specify your
127+
host’s machine as a target (for instance, an xtask in a shared
128+
project that may be worked on by many hosts).
129+
130+
o A path to a custom target specification (further reading here
131+
<https://doc.rust-lang.org/rustc/targets/custom.html#custom-target-lookup-path>).
120132

121133
This may also be specified with the build.target config value
122134
<https://doc.rust-lang.org/cargo/reference/config.html>.
123135

124-
Note that specifying this flag makes Cargo run in a different mode
125-
where the target artifacts are placed in a separate directory. See
126-
the build cache
136+
Note: Specifying this flag makes Cargo run in a different mode where
137+
the target artifacts are placed in a separate directory. See the
138+
build cache
127139
<https://doc.rust-lang.org/cargo/reference/build-cache.html>
128140
documentation for more details.
129141

src/doc/man/generated_txt/cargo-fetch.txt

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,30 @@ DESCRIPTION
2525
OPTIONS
2626
Fetch options
2727
--target triple
28-
Fetch for the given architecture. The default is all architectures.
29-
The general format of the triple is
30-
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for
31-
a list of supported targets. This flag may be specified multiple
32-
times.
28+
Fetch for the specified target (may be specified multiple times) The
29+
default is all architectures. The general format of the triple is
30+
<arch><sub>-<vendor>-<sys>-<abi>.
31+
32+
You may specify the following kinds of targets:
33+
34+
o Any supported target in rustc --print target-list (note: you have
35+
to install/add the target to use it).
36+
37+
o host, which will internally be substituted by the host’s
38+
target. This can be particularly useful if you’re
39+
cross-compiling some crates, and don’t want to specify your
40+
host’s machine as a target (for instance, an xtask in a shared
41+
project that may be worked on by many hosts).
42+
43+
o A path to a custom target specification (further reading here
44+
<https://doc.rust-lang.org/rustc/targets/custom.html#custom-target-lookup-path>).
3345

3446
This may also be specified with the build.target config value
3547
<https://doc.rust-lang.org/cargo/reference/config.html>.
3648

37-
Note that specifying this flag makes Cargo run in a different mode
38-
where the target artifacts are placed in a separate directory. See
39-
the build cache
49+
Note: Specifying this flag makes Cargo run in a different mode where
50+
the target artifacts are placed in a separate directory. See the
51+
build cache
4052
<https://doc.rust-lang.org/cargo/reference/build-cache.html>
4153
documentation for more details.
4254

src/doc/man/generated_txt/cargo-fix.txt

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -208,18 +208,30 @@ OPTIONS
208208

209209
Compilation Options
210210
--target triple
211-
Fix for the given architecture. The default is the host
212-
architecture. The general format of the triple is
213-
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for
214-
a list of supported targets. This flag may be specified multiple
215-
times.
211+
Fix for the specified target (may be specified multiple times) The
212+
default is the host architecture. The general format of the triple
213+
is <arch><sub>-<vendor>-<sys>-<abi>.
214+
215+
You may specify the following kinds of targets:
216+
217+
o Any supported target in rustc --print target-list (note: you have
218+
to install/add the target to use it).
219+
220+
o host, which will internally be substituted by the host’s
221+
target. This can be particularly useful if you’re
222+
cross-compiling some crates, and don’t want to specify your
223+
host’s machine as a target (for instance, an xtask in a shared
224+
project that may be worked on by many hosts).
225+
226+
o A path to a custom target specification (further reading here
227+
<https://doc.rust-lang.org/rustc/targets/custom.html#custom-target-lookup-path>).
216228

217229
This may also be specified with the build.target config value
218230
<https://doc.rust-lang.org/cargo/reference/config.html>.
219231

220-
Note that specifying this flag makes Cargo run in a different mode
221-
where the target artifacts are placed in a separate directory. See
222-
the build cache
232+
Note: Specifying this flag makes Cargo run in a different mode where
233+
the target artifacts are placed in a separate directory. See the
234+
build cache
223235
<https://doc.rust-lang.org/cargo/reference/build-cache.html>
224236
documentation for more details.
225237

src/doc/man/generated_txt/cargo-install.txt

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,17 +186,30 @@ OPTIONS
186186

187187
Compilation Options
188188
--target triple
189-
Install for the given architecture. The default is the host
189+
Install for the specified target The default is the host
190190
architecture. The general format of the triple is
191-
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for
192-
a list of supported targets.
191+
<arch><sub>-<vendor>-<sys>-<abi>.
192+
193+
You may specify the following kinds of targets:
194+
195+
o Any supported target in rustc --print target-list (note: you have
196+
to install/add the target to use it).
197+
198+
o host, which will internally be substituted by the host’s
199+
target. This can be particularly useful if you’re
200+
cross-compiling some crates, and don’t want to specify your
201+
host’s machine as a target (for instance, an xtask in a shared
202+
project that may be worked on by many hosts).
203+
204+
o A path to a custom target specification (further reading here
205+
<https://doc.rust-lang.org/rustc/targets/custom.html#custom-target-lookup-path>).
193206

194207
This may also be specified with the build.target config value
195208
<https://doc.rust-lang.org/cargo/reference/config.html>.
196209

197-
Note that specifying this flag makes Cargo run in a different mode
198-
where the target artifacts are placed in a separate directory. See
199-
the build cache
210+
Note: Specifying this flag makes Cargo run in a different mode where
211+
the target artifacts are placed in a separate directory. See the
212+
build cache
200213
<https://doc.rust-lang.org/cargo/reference/build-cache.html>
201214
documentation for more details.
202215

src/doc/man/generated_txt/cargo-package.txt

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,18 +188,30 @@ OPTIONS
188188

189189
Compilation Options
190190
--target triple
191-
Package for the given architecture. The default is the host
192-
architecture. The general format of the triple is
193-
<arch><sub>-<vendor>-<sys>-<abi>. Run rustc --print target-list for
194-
a list of supported targets. This flag may be specified multiple
195-
times.
191+
Package for the specified target (may be specified multiple times)
192+
The default is the host architecture. The general format of the
193+
triple is <arch><sub>-<vendor>-<sys>-<abi>.
194+
195+
You may specify the following kinds of targets:
196+
197+
o Any supported target in rustc --print target-list (note: you have
198+
to install/add the target to use it).
199+
200+
o host, which will internally be substituted by the host’s
201+
target. This can be particularly useful if you’re
202+
cross-compiling some crates, and don’t want to specify your
203+
host’s machine as a target (for instance, an xtask in a shared
204+
project that may be worked on by many hosts).
205+
206+
o A path to a custom target specification (further reading here
207+
<https://doc.rust-lang.org/rustc/targets/custom.html#custom-target-lookup-path>).
196208

197209
This may also be specified with the build.target config value
198210
<https://doc.rust-lang.org/cargo/reference/config.html>.
199211

200-
Note that specifying this flag makes Cargo run in a different mode
201-
where the target artifacts are placed in a separate directory. See
202-
the build cache
212+
Note: Specifying this flag makes Cargo run in a different mode where
213+
the target artifacts are placed in a separate directory. See the
214+
build cache
203215
<https://doc.rust-lang.org/cargo/reference/build-cache.html>
204216
documentation for more details.
205217

0 commit comments

Comments
 (0)