Skip to content

Commit c80b044

Browse files
committed
move rust.description to build.description
Signed-off-by: onur-ozkan <[email protected]>
1 parent 96cfc75 commit c80b044

File tree

2 files changed

+22
-13
lines changed

2 files changed

+22
-13
lines changed

config.example.toml

+11-11
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,17 @@
189189
# The default stage to use for the `bench` subcommand
190190
#bench-stage = 2
191191

192+
# A descriptive string to be appended to version output (e.g., `rustc --version`),
193+
# which is also used in places like debuginfo `DW_AT_producer`. This may be useful for
194+
# supplementary build information, like distro-specific package versions.
195+
#
196+
# The Rust compiler will differentiate between versions of itself, including
197+
# based on this string, which means that if you wish to be compatible with
198+
# upstream Rust you need to set this to "". However, note that if you are not
199+
# actually compatible -- for example if you've backported patches that change
200+
# behavior -- this may lead to miscompilations or other bugs.
201+
#description = ""
202+
192203
# Build triple for the pre-compiled snapshot compiler. If `rustc` is set, this must match its host
193204
# triple (see `rustc --version --verbose`; cross-compiling the rust build system itself is NOT
194205
# supported). If `rustc` is unset, this must be a platform with pre-compiled host tools
@@ -614,17 +625,6 @@
614625
# otherwise, it's "dev".
615626
#channel = if "is a tarball source" { content of `src/ci/channel` file } else { "dev" }
616627

617-
# A descriptive string to be appended to `rustc --version` output, which is
618-
# also used in places like debuginfo `DW_AT_producer`. This may be useful for
619-
# supplementary build information, like distro-specific package versions.
620-
#
621-
# The Rust compiler will differentiate between versions of itself, including
622-
# based on this string, which means that if you wish to be compatible with
623-
# upstream Rust you need to set this to "". However, note that if you are not
624-
# actually compatible -- for example if you've backported patches that change
625-
# behavior -- this may lead to miscompilations or other bugs.
626-
#description = ""
627-
628628
# The root location of the musl installation directory. The library directory
629629
# will also need to contain libunwind.a for an unwinding implementation. Note
630630
# that this option only makes sense for musl targets that produce statically

src/bootstrap/src/core/config/config.rs

+11-2
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,7 @@ define_config! {
894894
#[derive(Default)]
895895
struct Build {
896896
build: Option<String> = "build",
897+
description: Option<String> = "description",
897898
host: Option<Vec<String>> = "host",
898899
target: Option<Vec<String>> = "target",
899900
build_dir: Option<String> = "build-dir",
@@ -1176,6 +1177,7 @@ define_config! {
11761177
incremental: Option<bool> = "incremental",
11771178
default_linker: Option<String> = "default-linker",
11781179
channel: Option<String> = "channel",
1180+
// FIXME: Remove this field at Q2 2025, it has been replaced by build.description
11791181
description: Option<String> = "description",
11801182
musl_root: Option<String> = "musl-root",
11811183
rpath: Option<bool> = "rpath",
@@ -1583,6 +1585,7 @@ impl Config {
15831585
config.change_id = toml.change_id.inner;
15841586

15851587
let Build {
1588+
mut description,
15861589
build,
15871590
host,
15881591
target,
@@ -1827,7 +1830,7 @@ impl Config {
18271830
randomize_layout,
18281831
default_linker,
18291832
channel: _, // already handled above
1830-
description,
1833+
description: rust_description,
18311834
musl_root,
18321835
rpath,
18331836
verbose_tests,
@@ -1920,7 +1923,12 @@ impl Config {
19201923
set(&mut config.jemalloc, jemalloc);
19211924
set(&mut config.test_compare_mode, test_compare_mode);
19221925
set(&mut config.backtrace, backtrace);
1923-
config.description = description;
1926+
if rust_description.is_some() {
1927+
eprintln!(
1928+
"Warning: rust.description is deprecated. Use build.description instead."
1929+
);
1930+
}
1931+
description = description.or(rust_description);
19241932
set(&mut config.rust_dist_src, dist_src);
19251933
set(&mut config.verbose_tests, verbose_tests);
19261934
// in the case "false" is set explicitly, do not overwrite the command line args
@@ -1986,6 +1994,7 @@ impl Config {
19861994
}
19871995

19881996
config.reproducible_artifacts = flags.reproducible_artifact;
1997+
config.description = description;
19891998

19901999
// We need to override `rust.channel` if it's manually specified when using the CI rustc.
19912000
// This is because if the compiler uses a different channel than the one specified in config.toml,

0 commit comments

Comments
 (0)