Skip to content

Commit

Permalink
move rust.description to build.description
Browse files Browse the repository at this point in the history
Signed-off-by: onur-ozkan <work@onurozkan.dev>
  • Loading branch information
onur-ozkan committed Feb 27, 2025
1 parent 96cfc75 commit b3cae68
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
22 changes: 11 additions & 11 deletions config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,17 @@
# The default stage to use for the `bench` subcommand
#bench-stage = 2

# A descriptive string to be appended to version output (e.g., `rustc --version`),
# which is also used in places like debuginfo `DW_AT_producer`. This may be useful for
# supplementary build information, like distro-specific package versions.
#
# The Rust compiler will differentiate between versions of itself, including
# based on this string, which means that if you wish to be compatible with
# upstream Rust you need to set this to "". However, note that if you set this to "" but
# are not actually compatible -- for example if you've backported patches that change
# behavior -- this may lead to miscompilations or other bugs.
#description = ""

# Build triple for the pre-compiled snapshot compiler. If `rustc` is set, this must match its host
# triple (see `rustc --version --verbose`; cross-compiling the rust build system itself is NOT
# supported). If `rustc` is unset, this must be a platform with pre-compiled host tools
Expand Down Expand Up @@ -614,17 +625,6 @@
# otherwise, it's "dev".
#channel = if "is a tarball source" { content of `src/ci/channel` file } else { "dev" }

# A descriptive string to be appended to `rustc --version` output, which is
# also used in places like debuginfo `DW_AT_producer`. This may be useful for
# supplementary build information, like distro-specific package versions.
#
# The Rust compiler will differentiate between versions of itself, including
# based on this string, which means that if you wish to be compatible with
# upstream Rust you need to set this to "". However, note that if you are not
# actually compatible -- for example if you've backported patches that change
# behavior -- this may lead to miscompilations or other bugs.
#description = ""

# The root location of the musl installation directory. The library directory
# will also need to contain libunwind.a for an unwinding implementation. Note
# that this option only makes sense for musl targets that produce statically
Expand Down
13 changes: 11 additions & 2 deletions src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,7 @@ define_config! {
#[derive(Default)]
struct Build {
build: Option<String> = "build",
description: Option<String> = "description",
host: Option<Vec<String>> = "host",
target: Option<Vec<String>> = "target",
build_dir: Option<String> = "build-dir",
Expand Down Expand Up @@ -1176,6 +1177,7 @@ define_config! {
incremental: Option<bool> = "incremental",
default_linker: Option<String> = "default-linker",
channel: Option<String> = "channel",
// FIXME: Remove this field at Q2 2025, it has been replaced by build.description
description: Option<String> = "description",
musl_root: Option<String> = "musl-root",
rpath: Option<bool> = "rpath",
Expand Down Expand Up @@ -1583,6 +1585,7 @@ impl Config {
config.change_id = toml.change_id.inner;

let Build {
mut description,
build,
host,
target,
Expand Down Expand Up @@ -1827,7 +1830,7 @@ impl Config {
randomize_layout,
default_linker,
channel: _, // already handled above
description,
description: rust_description,
musl_root,
rpath,
verbose_tests,
Expand Down Expand Up @@ -1920,7 +1923,12 @@ impl Config {
set(&mut config.jemalloc, jemalloc);
set(&mut config.test_compare_mode, test_compare_mode);
set(&mut config.backtrace, backtrace);
config.description = description;
if rust_description.is_some() {
eprintln!(
"Warning: rust.description is deprecated. Use build.description instead."
);
}
description = description.or(rust_description);
set(&mut config.rust_dist_src, dist_src);
set(&mut config.verbose_tests, verbose_tests);
// in the case "false" is set explicitly, do not overwrite the command line args
Expand Down Expand Up @@ -1986,6 +1994,7 @@ impl Config {
}

config.reproducible_artifacts = flags.reproducible_artifact;
config.description = description;

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

0 comments on commit b3cae68

Please sign in to comment.