Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d1e2640

Browse files
committedNov 9, 2023
chore(bootstrap): capitalize {error, warning, info, note} tags
This should enhance the readability. Signed-off-by: onur-ozkan <work@onurozkan.dev>
1 parent 42fbf3e commit d1e2640

23 files changed

+92
-92
lines changed
 

‎src/bootstrap/bootstrap.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def require(cmd, exit=True, exception=False):
211211
if exception:
212212
raise
213213
elif exit:
214-
eprint("error: unable to run `{}`: {}".format(' '.join(cmd), exc))
214+
eprint("ERROR: unable to run `{}`: {}".format(' '.join(cmd), exc))
215215
eprint("Please make sure it's installed and in the path.")
216216
sys.exit(1)
217217
return None
@@ -681,7 +681,7 @@ def get_answer():
681681

682682
answer = self._should_fix_bins_and_dylibs = get_answer()
683683
if answer:
684-
eprint("info: You seem to be using Nix.")
684+
eprint("INFO: You seem to be using Nix.")
685685
return answer
686686

687687
def fix_bin_or_dylib(self, fname):
@@ -727,7 +727,7 @@ def fix_bin_or_dylib(self, fname):
727727
"nix-build", "-E", nix_expr, "-o", nix_deps_dir,
728728
])
729729
except subprocess.CalledProcessError as reason:
730-
eprint("warning: failed to call nix-build:", reason)
730+
eprint("WARNING: failed to call nix-build:", reason)
731731
return
732732
self.nix_deps_dir = nix_deps_dir
733733

@@ -747,7 +747,7 @@ def fix_bin_or_dylib(self, fname):
747747
try:
748748
subprocess.check_output([patchelf] + patchelf_args + [fname])
749749
except subprocess.CalledProcessError as reason:
750-
eprint("warning: failed to call patchelf:", reason)
750+
eprint("WARNING: failed to call patchelf:", reason)
751751
return
752752

753753
def rustc_stamp(self):
@@ -1005,7 +1005,7 @@ def check_vendored_status(self):
10051005
if 'SUDO_USER' in os.environ and not self.use_vendored_sources:
10061006
if os.getuid() == 0:
10071007
self.use_vendored_sources = True
1008-
eprint('info: looks like you\'re trying to run this command as root')
1008+
eprint('INFO: looks like you\'re trying to run this command as root')
10091009
eprint(' and so in order to preserve your $HOME this will now')
10101010
eprint(' use vendored sources by default.')
10111011

@@ -1017,14 +1017,14 @@ def check_vendored_status(self):
10171017
"--sync ./src/tools/rust-analyzer/Cargo.toml " \
10181018
"--sync ./compiler/rustc_codegen_cranelift/Cargo.toml " \
10191019
"--sync ./src/bootstrap/Cargo.toml "
1020-
eprint('error: vendoring required, but vendor directory does not exist.')
1020+
eprint('ERROR: vendoring required, but vendor directory does not exist.')
10211021
eprint(' Run `cargo vendor {}` to initialize the '
10221022
'vendor directory.'.format(sync_dirs))
10231023
eprint('Alternatively, use the pre-vendored `rustc-src` dist component.')
10241024
raise Exception("{} not found".format(vendor_dir))
10251025

10261026
if not os.path.exists(cargo_dir):
1027-
eprint('error: vendoring required, but .cargo/config does not exist.')
1027+
eprint('ERROR: vendoring required, but .cargo/config does not exist.')
10281028
raise Exception("{} not found".format(cargo_dir))
10291029
else:
10301030
if os.path.exists(cargo_dir):
@@ -1125,7 +1125,7 @@ def main():
11251125
# process has to happen before anything is printed out.
11261126
if help_triggered:
11271127
eprint(
1128-
"info: Downloading and building bootstrap before processing --help command.\n"
1128+
"INFO: Downloading and building bootstrap before processing --help command.\n"
11291129
" See src/bootstrap/README.md for help with common commands.")
11301130

11311131
exit_code = 0

‎src/bootstrap/bootstrap_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def serialize_and_parse(configure_args, bootstrap_args=None):
3434
# Verify this is actually valid TOML.
3535
tomllib.loads(build.config_toml)
3636
except ImportError:
37-
print("warning: skipping TOML validation, need at least python 3.11", file=sys.stderr)
37+
print("WARNING: skipping TOML validation, need at least python 3.11", file=sys.stderr)
3838
return build
3939

4040

‎src/bootstrap/configure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def parse_args(args):
253253
if not found:
254254
unknown_args.append(arg)
255255

256-
# Note: here and a few other places, we use [-1] to apply the *last* value
256+
# NOTE: here and a few other places, we use [-1] to apply the *last* value
257257
# passed. But if option-checking is enabled, then the known_args loop will
258258
# also assert that options are only passed once.
259259
option_checking = ('option-checking' not in known_args
@@ -477,7 +477,7 @@ def configure_section(lines, config):
477477
# These are used by rpm, but aren't accepted by x.py.
478478
# Give a warning that they're ignored, but not a hard error.
479479
if key in ["infodir", "localstatedir"]:
480-
print("warning: {} will be ignored".format(key))
480+
print("WARNING: {} will be ignored".format(key))
481481
else:
482482
raise RuntimeError("failed to find config line for {}".format(key))
483483

‎src/bootstrap/src/bin/main.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ fn main() {
6363
if suggest_setup {
6464
println!("WARNING: you have not made a `config.toml`");
6565
println!(
66-
"help: consider running `./x.py setup` or copying `config.example.toml` by running \
66+
"HELP: consider running `./x.py setup` or copying `config.example.toml` by running \
6767
`cp config.example.toml config.toml`"
6868
);
6969
} else if let Some(suggestion) = &changelog_suggestion {
@@ -76,7 +76,7 @@ fn main() {
7676
if suggest_setup {
7777
println!("WARNING: you have not made a `config.toml`");
7878
println!(
79-
"help: consider running `./x.py setup` or copying `config.example.toml` by running \
79+
"HELP: consider running `./x.py setup` or copying `config.example.toml` by running \
8080
`cp config.example.toml config.toml`"
8181
);
8282
} else if let Some(suggestion) = &changelog_suggestion {
@@ -97,7 +97,7 @@ fn main() {
9797
}
9898

9999
if suggest_setup || changelog_suggestion.is_some() {
100-
println!("note: this message was printed twice to make it more likely to be seen");
100+
println!("NOTE: this message was printed twice to make it more likely to be seen");
101101
}
102102
}
103103

@@ -128,14 +128,14 @@ fn check_version(config: &Config) -> Option<String> {
128128

129129
msg.push_str("WARNING: there have been changes to x.py since you last updated.\n");
130130

131-
msg.push_str("note: to silence this warning, ");
131+
msg.push_str("NOTE: to silence this warning, ");
132132
msg.push_str(&format!(
133133
"update `config.toml` to use `change-id = {latest_config_id}` instead"
134134
));
135135
}
136136
} else {
137137
msg.push_str("WARNING: The `change-id` is missing in the `config.toml`. This means that you will not be able to track the major changes made to the bootstrap configurations.\n");
138-
msg.push_str("note: to silence this warning, ");
138+
msg.push_str("NOTE: to silence this warning, ");
139139
msg.push_str(&format!("add `change-id = {latest_config_id}` at the top of `config.toml`"));
140140
};
141141

‎src/bootstrap/src/bin/rustc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ fn main() {
242242

243243
if status.success() {
244244
std::process::exit(0);
245-
// note: everything below here is unreachable. do not put code that
245+
// NOTE: everything below here is unreachable. do not put code that
246246
// should run on success, after this block.
247247
}
248248
if verbose > 0 {

‎src/bootstrap/src/core/build_steps/clean.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ fn rm_rf(path: &Path) {
178178
&& p.file_name().and_then(std::ffi::OsStr::to_str)
179179
== Some("bootstrap.exe")
180180
{
181-
eprintln!("warning: failed to delete '{}'.", p.display());
181+
eprintln!("WARNING: failed to delete '{}'.", p.display());
182182
return Ok(());
183183
}
184184
Err(e)

‎src/bootstrap/src/core/build_steps/compile.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ impl Step for Std {
141141
if builder.config.keep_stage.contains(&compiler.stage)
142142
|| builder.config.keep_stage_std.contains(&compiler.stage)
143143
{
144-
builder.info("Warning: Using a potentially old libstd. This may not behave well.");
144+
builder.info("WARNING: Using a potentially old libstd. This may not behave well.");
145145

146146
copy_third_party_objects(builder, &compiler, target);
147147
copy_self_contained_objects(builder, &compiler, target);
@@ -817,8 +817,8 @@ impl Step for Rustc {
817817
builder.ensure(Std::new(compiler, target));
818818

819819
if builder.config.keep_stage.contains(&compiler.stage) {
820-
builder.info("Warning: Using a potentially old librustc. This may not behave well.");
821-
builder.info("Warning: Use `--keep-stage-std` if you want to rebuild the compiler when it changes");
820+
builder.info("WARNING: Using a potentially old librustc. This may not behave well.");
821+
builder.info("WARNING: Use `--keep-stage-std` if you want to rebuild the compiler when it changes");
822822
builder.ensure(RustcLink::from_rustc(self, compiler));
823823
return;
824824
}
@@ -1203,8 +1203,8 @@ fn is_codegen_cfg_needed(path: &TaskPath, run: &RunConfig<'_>) -> bool {
12031203
}
12041204
if needs_codegen_backend_config {
12051205
run.builder.info(
1206-
"Warning: no codegen-backends config matched the requested path to build a codegen backend. \
1207-
Help: add backend to codegen-backends in config.toml.",
1206+
"WARNING: no codegen-backends config matched the requested path to build a codegen backend. \
1207+
HELP: add backend to codegen-backends in config.toml.",
12081208
);
12091209
return true;
12101210
}
@@ -1250,7 +1250,7 @@ impl Step for CodegenBackend {
12501250

12511251
if builder.config.keep_stage.contains(&compiler.stage) {
12521252
builder.info(
1253-
"Warning: Using a potentially old codegen backend. \
1253+
"WARNING: Using a potentially old codegen backend. \
12541254
This may not behave well.",
12551255
);
12561256
// Codegen backends are linked separately from this step today, so we don't do
@@ -1525,14 +1525,14 @@ impl Step for Sysroot {
15251525
let sysroot_lib_rustlib_src_rust = sysroot_lib_rustlib_src.join("rust");
15261526
if let Err(e) = symlink_dir(&builder.config, &builder.src, &sysroot_lib_rustlib_src_rust) {
15271527
eprintln!(
1528-
"warning: creating symbolic link `{}` to `{}` failed with {}",
1528+
"WARNING: creating symbolic link `{}` to `{}` failed with {}",
15291529
sysroot_lib_rustlib_src_rust.display(),
15301530
builder.src.display(),
15311531
e,
15321532
);
15331533
if builder.config.rust_remap_debuginfo {
15341534
eprintln!(
1535-
"warning: some `tests/ui` tests will fail when lacking `{}`",
1535+
"WARNING: some `tests/ui` tests will fail when lacking `{}`",
15361536
sysroot_lib_rustlib_src_rust.display(),
15371537
);
15381538
}
@@ -1545,7 +1545,7 @@ impl Step for Sysroot {
15451545
symlink_dir(&builder.config, &builder.src, &sysroot_lib_rustlib_rustcsrc_rust)
15461546
{
15471547
eprintln!(
1548-
"warning: creating symbolic link `{}` to `{}` failed with {}",
1548+
"WARNING: creating symbolic link `{}` to `{}` failed with {}",
15491549
sysroot_lib_rustlib_rustcsrc_rust.display(),
15501550
builder.src.display(),
15511551
e,
@@ -1986,7 +1986,7 @@ pub fn stream_cargo(
19861986
builder.verbose(&format!("running: {cargo:?}"));
19871987
let mut child = match cargo.spawn() {
19881988
Ok(child) => child,
1989-
Err(e) => panic!("failed to execute command: {cargo:?}\nerror: {e}"),
1989+
Err(e) => panic!("failed to execute command: {cargo:?}\nERROR: {e}"),
19901990
};
19911991

19921992
// Spawn Cargo slurping up its JSON output. We'll start building up the
@@ -2050,7 +2050,7 @@ pub fn strip_debug(builder: &Builder<'_>, target: TargetSelection, path: &Path)
20502050
}
20512051

20522052
let previous_mtime = FileTime::from_last_modification_time(&path.metadata().unwrap());
2053-
// Note: `output` will propagate any errors here.
2053+
// NOTE: `output` will propagate any errors here.
20542054
output(Command::new("strip").arg("--strip-debug").arg(path));
20552055

20562056
// After running `strip`, we have to set the file modification time to what it was before,

‎src/bootstrap/src/core/build_steps/install.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ install!((self, builder, _config),
269269
}
270270
};
271271
RustDemangler, alias = "rust-demangler", Self::should_build(_config), only_hosts: true, {
272-
// Note: Even though `should_build` may return true for `extended` default tools,
272+
// NOTE: Even though `should_build` may return true for `extended` default tools,
273273
// dist::RustDemangler may still return None, unless the target-dependent `profiler` config
274274
// is also true, or the `tools` array explicitly includes "rust-demangler".
275275
if let Some(tarball) = builder.ensure(dist::RustDemangler {

‎src/bootstrap/src/core/build_steps/llvm.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@ pub(crate) fn detect_llvm_sha(config: &Config, is_git: bool) -> String {
156156

157157
if llvm_sha.is_empty() {
158158
eprintln!("error: could not find commit hash for downloading LLVM");
159-
eprintln!("help: maybe your repository history is too shallow?");
160-
eprintln!("help: consider disabling `download-ci-llvm`");
161-
eprintln!("help: or fetch enough history to include one upstream commit");
159+
eprintln!("HELP: maybe your repository history is too shallow?");
160+
eprintln!("HELP: consider disabling `download-ci-llvm`");
161+
eprintln!("HELP: or fetch enough history to include one upstream commit");
162162
panic!();
163163
}
164164

‎src/bootstrap/src/core/build_steps/setup.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl Step for Profile {
126126
if path.exists() {
127127
eprintln!();
128128
eprintln!(
129-
"error: you asked for a new config file, but one already exists at `{}`",
129+
"ERROR: you asked for a new config file, but one already exists at `{}`",
130130
t!(path.canonicalize()).display()
131131
);
132132

@@ -212,7 +212,7 @@ pub fn setup(config: &Config, profile: Profile) {
212212
if profile == Profile::Tools {
213213
eprintln!();
214214
eprintln!(
215-
"note: the `tools` profile sets up the `stage2` toolchain (use \
215+
"NOTE: the `tools` profile sets up the `stage2` toolchain (use \
216216
`rustup toolchain link 'name' build/host/stage2` to use rustc)"
217217
)
218218
}
@@ -414,8 +414,8 @@ pub fn interactive_path() -> io::Result<Profile> {
414414
break match parse_with_abbrev(&input) {
415415
Ok(profile) => profile,
416416
Err(err) => {
417-
eprintln!("error: {err}");
418-
eprintln!("note: press Ctrl+C to exit");
417+
eprintln!("ERROR: {err}");
418+
eprintln!("NOTE: press Ctrl+C to exit");
419419
continue;
420420
}
421421
};
@@ -444,8 +444,8 @@ fn prompt_user(prompt: &str) -> io::Result<Option<PromptResult>> {
444444
"p" | "print" => return Ok(Some(PromptResult::Print)),
445445
"" => return Ok(None),
446446
_ => {
447-
eprintln!("error: unrecognized option '{}'", input.trim());
448-
eprintln!("note: press Ctrl+C to exit");
447+
eprintln!("ERROR: unrecognized option '{}'", input.trim());
448+
eprintln!("NOTE: press Ctrl+C to exit");
449449
}
450450
};
451451
}
@@ -512,7 +512,7 @@ undesirable, simply delete the `pre-push` file from .git/hooks."
512512
match fs::hard_link(src, &dst) {
513513
Err(e) => {
514514
eprintln!(
515-
"error: could not create hook {}: do you already have the git hook installed?\n{}",
515+
"ERROR: could not create hook {}: do you already have the git hook installed?\n{}",
516516
dst.display(),
517517
e
518518
);
@@ -578,10 +578,10 @@ fn create_vscode_settings_maybe(config: &Config) -> io::Result<()> {
578578
);
579579
match mismatched_settings {
580580
Some(true) => eprintln!(
581-
"warning: existing `.vscode/settings.json` is out of date, x.py will update it"
581+
"WARNING: existing `.vscode/settings.json` is out of date, x.py will update it"
582582
),
583583
Some(false) => eprintln!(
584-
"warning: existing `.vscode/settings.json` has been modified by user, x.py will back it up and replace it"
584+
"WARNING: existing `.vscode/settings.json` has been modified by user, x.py will back it up and replace it"
585585
),
586586
_ => (),
587587
}
@@ -608,7 +608,7 @@ fn create_vscode_settings_maybe(config: &Config) -> io::Result<()> {
608608
// exists and is not current version or outdated, so back it up
609609
let mut backup = vscode_settings.clone();
610610
backup.set_extension("json.bak");
611-
eprintln!("warning: copying `settings.json` to `settings.json.bak`");
611+
eprintln!("WARNING: copying `settings.json` to `settings.json.bak`");
612612
fs::copy(&vscode_settings, &backup)?;
613613
"Updated"
614614
}

‎src/bootstrap/src/core/build_steps/suggest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@ pub fn suggest(builder: &Builder<'_>, run: bool) {
6868
build.build();
6969
}
7070
} else {
71-
println!("help: consider using the `--run` flag to automatically run suggested tests");
71+
println!("HELP: consider using the `--run` flag to automatically run suggested tests");
7272
}
7373
}

‎src/bootstrap/src/core/build_steps/test.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,10 +1127,10 @@ impl Step for Tidy {
11271127
let inferred_rustfmt_dir = builder.initial_rustc.parent().unwrap();
11281128
eprintln!(
11291129
"\
1130-
error: no `rustfmt` binary found in {PATH}
1131-
info: `rust.channel` is currently set to \"{CHAN}\"
1132-
help: if you are testing a beta branch, set `rust.channel` to \"beta\" in the `config.toml` file
1133-
help: to skip test's attempt to check tidiness, pass `--skip src/tools/tidy` to `x.py test`",
1130+
ERROR: no `rustfmt` binary found in {PATH}
1131+
INFO: `rust.channel` is currently set to \"{CHAN}\"
1132+
HELP: if you are testing a beta branch, set `rust.channel` to \"beta\" in the `config.toml` file
1133+
HELP: to skip test's attempt to check tidiness, pass `--skip src/tools/tidy` to `x.py test`",
11341134
PATH = inferred_rustfmt_dir.display(),
11351135
CHAN = builder.config.channel,
11361136
);
@@ -1183,7 +1183,7 @@ impl Step for ExpandYamlAnchors {
11831183
/// appropriate configuration for all our CI providers. This step ensures the tool was called
11841184
/// by the user before committing CI changes.
11851185
fn run(self, builder: &Builder<'_>) {
1186-
// Note: `.github/` is not included in dist-src tarballs
1186+
// NOTE: `.github/` is not included in dist-src tarballs
11871187
if !builder.src.join(".github/workflows/ci.yml").exists() {
11881188
builder.info("Skipping YAML anchors check: GitHub Actions config not found");
11891189
return;
@@ -1566,10 +1566,10 @@ impl Step for Compiletest {
15661566
fn run(self, builder: &Builder<'_>) {
15671567
if builder.top_stage == 0 && env::var("COMPILETEST_FORCE_STAGE0").is_err() {
15681568
eprintln!("\
1569-
error: `--stage 0` runs compiletest on the beta compiler, not your local changes, and will almost always cause tests to fail
1570-
help: to test the compiler, use `--stage 1` instead
1571-
help: to test the standard library, use `--stage 0 library/std` instead
1572-
note: if you're sure you want to do this, please open an issue as to why. In the meantime, you can override this with `COMPILETEST_FORCE_STAGE0=1`."
1569+
ERROR: `--stage 0` runs compiletest on the beta compiler, not your local changes, and will almost always cause tests to fail
1570+
HELP: to test the compiler, use `--stage 1` instead
1571+
HELP: to test the standard library, use `--stage 0 library/std` instead
1572+
NOTE: if you're sure you want to do this, please open an issue as to why. In the meantime, you can override this with `COMPILETEST_FORCE_STAGE0=1`."
15731573
);
15741574
crate::exit!(1);
15751575
}

‎src/bootstrap/src/core/build_steps/tool.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ impl Step for Rustdoc {
422422

423423
fn make_run(run: RunConfig<'_>) {
424424
run.builder.ensure(Rustdoc {
425-
// Note: this is somewhat unique in that we actually want a *target*
425+
// NOTE: this is somewhat unique in that we actually want a *target*
426426
// compiler here, because rustdoc *is* a compiler. We won't be using
427427
// this as the compiler to build with, but rather this is "what
428428
// compiler are we producing"?
@@ -454,7 +454,7 @@ impl Step for Rustdoc {
454454
// compiler, since you do just as much work.
455455
if !builder.config.dry_run() && builder.download_rustc() && build_compiler.stage == 0 {
456456
println!(
457-
"warning: `download-rustc` does nothing when building stage1 tools; consider using `--stage 2` instead"
457+
"WARNING: `download-rustc` does nothing when building stage1 tools; consider using `--stage 2` instead"
458458
);
459459
}
460460

@@ -787,9 +787,9 @@ macro_rules! tool_extended {
787787
}
788788
}
789789

790-
// Note: tools need to be also added to `Builder::get_step_descriptions` in `builder.rs`
790+
// NOTE: tools need to be also added to `Builder::get_step_descriptions` in `builder.rs`
791791
// to make `./x.py build <tool>` work.
792-
// Note: Most submodule updates for tools are handled by bootstrap.py, since they're needed just to
792+
// NOTE: Most submodule updates for tools are handled by bootstrap.py, since they're needed just to
793793
// invoke Cargo to build bootstrap. See the comment there for more details.
794794
tool_extended!((self, builder),
795795
Cargofmt, "src/tools/rustfmt", "cargo-fmt", stable=true;

‎src/bootstrap/src/core/build_steps/toolstate.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ impl Step for ToolStateCheck {
172172
for (tool, _) in STABLE_TOOLS.iter().chain(NIGHTLY_TOOLS.iter()) {
173173
if !toolstates.contains_key(*tool) {
174174
did_error = true;
175-
eprintln!("error: Tool `{tool}` was not recorded in tool state.");
175+
eprintln!("ERROR: Tool `{tool}` was not recorded in tool state.");
176176
}
177177
}
178178

@@ -190,7 +190,7 @@ impl Step for ToolStateCheck {
190190
if state != ToolState::TestPass {
191191
if !is_nightly {
192192
did_error = true;
193-
eprintln!("error: Tool `{tool}` should be test-pass but is {state}");
193+
eprintln!("ERROR: Tool `{tool}` should be test-pass but is {state}");
194194
} else if in_beta_week {
195195
let old_state = old_toolstate
196196
.iter()
@@ -200,14 +200,14 @@ impl Step for ToolStateCheck {
200200
if state < old_state {
201201
did_error = true;
202202
eprintln!(
203-
"error: Tool `{tool}` has regressed from {old_state} to {state} during beta week."
203+
"ERROR: Tool `{tool}` has regressed from {old_state} to {state} during beta week."
204204
);
205205
} else {
206206
// This warning only appears in the logs, which most
207207
// people won't read. It's mostly here for testing and
208208
// debugging.
209209
eprintln!(
210-
"warning: Tool `{tool}` is not test-pass (is `{state}`), \
210+
"WARNING: Tool `{tool}` is not test-pass (is `{state}`), \
211211
this should be fixed before beta is branched."
212212
);
213213
}

‎src/bootstrap/src/core/builder.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -386,13 +386,13 @@ impl StepDescription {
386386
}
387387

388388
if !paths.is_empty() {
389-
eprintln!("error: no `{}` rules matched {:?}", builder.kind.as_str(), paths,);
389+
eprintln!("ERROR: no `{}` rules matched {:?}", builder.kind.as_str(), paths,);
390390
eprintln!(
391-
"help: run `x.py {} --help --verbose` to show a list of available paths",
391+
"HELP: run `x.py {} --help --verbose` to show a list of available paths",
392392
builder.kind.as_str()
393393
);
394394
eprintln!(
395-
"note: if you are adding a new Step to bootstrap itself, make sure you register it with `describe!`"
395+
"NOTE: if you are adding a new Step to bootstrap itself, make sure you register it with `describe!`"
396396
);
397397
crate::exit!(1);
398398
}
@@ -1360,9 +1360,9 @@ impl<'a> Builder<'a> {
13601360
}
13611361
}).unwrap_or_else(|_| {
13621362
eprintln!(
1363-
"error: `x.py clippy` requires a host `rustc` toolchain with the `clippy` component"
1363+
"ERROR: `x.py clippy` requires a host `rustc` toolchain with the `clippy` component"
13641364
);
1365-
eprintln!("help: try `rustup component add clippy`");
1365+
eprintln!("HELP: try `rustup component add clippy`");
13661366
crate::exit!(1);
13671367
});
13681368
if !t!(std::str::from_utf8(&output.stdout)).contains("nightly") {

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,7 @@ impl Config {
14621462
if available_backends.contains(&backend) {
14631463
panic!("Invalid value '{s}' for 'rust.codegen-backends'. Instead, please use '{backend}'.");
14641464
} else {
1465-
println!("help: '{s}' for 'rust.codegen-backends' might fail. \
1465+
println!("HELP: '{s}' for 'rust.codegen-backends' might fail. \
14661466
Codegen backends are mostly defined without the '{CODEGEN_BACKEND_PREFIX}' prefix. \
14671467
In this case, it would be referred to as '{backend}'.");
14681468
}
@@ -1806,9 +1806,9 @@ impl Config {
18061806
}
18071807
(channel, version) => {
18081808
let src = self.src.display();
1809-
eprintln!("error: failed to determine artifact channel and/or version");
1809+
eprintln!("ERROR: failed to determine artifact channel and/or version");
18101810
eprintln!(
1811-
"help: consider using a git checkout or ensure these files are readable"
1811+
"HELP: consider using a git checkout or ensure these files are readable"
18121812
);
18131813
if let Err(channel) = channel {
18141814
eprintln!("reading {src}/src/ci/channel failed: {channel:?}");
@@ -2064,10 +2064,10 @@ impl Config {
20642064
);
20652065
let commit = merge_base.trim_end();
20662066
if commit.is_empty() {
2067-
println!("error: could not find commit hash for downloading rustc");
2068-
println!("help: maybe your repository history is too shallow?");
2069-
println!("help: consider disabling `download-rustc`");
2070-
println!("help: or fetch enough history to include one upstream commit");
2067+
println!("ERROR: could not find commit hash for downloading rustc");
2068+
println!("HELP: maybe your repository history is too shallow?");
2069+
println!("HELP: consider disabling `download-rustc`");
2070+
println!("HELP: or fetch enough history to include one upstream commit");
20712071
crate::exit!(1);
20722072
}
20732073

@@ -2081,14 +2081,14 @@ impl Config {
20812081
if if_unchanged {
20822082
if self.verbose > 0 {
20832083
println!(
2084-
"warning: saw changes to compiler/ or library/ since {commit}; \
2084+
"WARNING: saw changes to compiler/ or library/ since {commit}; \
20852085
ignoring `download-rustc`"
20862086
);
20872087
}
20882088
return None;
20892089
}
20902090
println!(
2091-
"warning: `download-rustc` is enabled, but there are changes to \
2091+
"WARNING: `download-rustc` is enabled, but there are changes to \
20922092
compiler/ or library/"
20932093
);
20942094
}

‎src/bootstrap/src/core/config/flags.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ impl Flags {
190190
if let Ok(HelpVerboseOnly { help: true, verbose: 1.., cmd: subcommand }) =
191191
HelpVerboseOnly::try_parse_from(it.clone())
192192
{
193-
println!("note: updating submodules before printing available paths");
193+
println!("NOTE: updating submodules before printing available paths");
194194
let config = Config::parse(&[String::from("build")]);
195195
let build = Build::new(config);
196196
let paths = Builder::get_help(&build, subcommand);

‎src/bootstrap/src/core/download.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ impl Config {
114114
is_nixos
115115
});
116116
if val {
117-
eprintln!("info: You seem to be using Nix.");
117+
eprintln!("INFO: You seem to be using Nix.");
118118
}
119119
val
120120
}
@@ -606,10 +606,10 @@ impl Config {
606606

607607
let mut help_on_error = "";
608608
if destination == "ci-rustc" {
609-
help_on_error = "error: failed to download pre-built rustc from CI
609+
help_on_error = "ERROR: failed to download pre-built rustc from CI
610610
611-
note: old builds get deleted after a certain time
612-
help: if trying to compile an old commit of rustc, disable `download-rustc` in config.toml:
611+
NOTE: old builds get deleted after a certain time
612+
HELP: if trying to compile an old commit of rustc, disable `download-rustc` in config.toml:
613613
614614
[rust]
615615
download-rustc = false
@@ -685,10 +685,10 @@ download-rustc = false
685685
let filename = format!("rust-dev-{}-{}.tar.xz", version, self.build.triple);
686686
let tarball = rustc_cache.join(&filename);
687687
if !tarball.exists() {
688-
let help_on_error = "error: failed to download llvm from ci
688+
let help_on_error = "ERROR: failed to download llvm from ci
689689
690-
help: old builds get deleted after a certain time
691-
help: if trying to compile an old commit of rustc, disable `download-ci-llvm` in config.toml:
690+
HELP: old builds get deleted after a certain time
691+
HELP: if trying to compile an old commit of rustc, disable `download-ci-llvm` in config.toml:
692692
693693
[llvm]
694694
download-ci-llvm = false

‎src/bootstrap/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,7 +1568,7 @@ impl Build {
15681568

15691569
if !stamp.exists() {
15701570
eprintln!(
1571-
"Error: Unable to find the stamp file {}, did you try to keep a nonexistent build stage?",
1571+
"ERROR: Unable to find the stamp file {}, did you try to keep a nonexistent build stage?",
15721572
stamp.display()
15731573
);
15741574
crate::exit!(1);
@@ -1697,7 +1697,7 @@ impl Build {
16971697
self.verbose_than(1, &format!("Install {src:?} to {dst:?}"));
16981698
t!(fs::create_dir_all(dstdir));
16991699
if !src.exists() {
1700-
panic!("Error: File \"{}\" not found!", src.display());
1700+
panic!("ERROR: File \"{}\" not found!", src.display());
17011701
}
17021702
self.copy_internal(src, &dst, true);
17031703
chmod(&dst, perms);

‎src/bootstrap/src/utils/bin_helpers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ pub(crate) fn parse_rustc_verbose() -> usize {
2222
pub(crate) fn parse_rustc_stage() -> String {
2323
std::env::var("RUSTC_STAGE").unwrap_or_else(|_| {
2424
// Don't panic here; it's reasonable to try and run these shims directly. Give a helpful error instead.
25-
eprintln!("rustc shim: fatal: RUSTC_STAGE was not set");
26-
eprintln!("rustc shim: note: use `x.py build -vvv` to see all environment variables set by bootstrap");
25+
eprintln!("rustc shim: FATAL: RUSTC_STAGE was not set");
26+
eprintln!("rustc shim: NOTE: use `x.py build -vvv` to see all environment variables set by bootstrap");
2727
std::process::exit(101);
2828
})
2929
}

‎src/bootstrap/src/utils/helpers.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ pub fn check_run(cmd: &mut Command, print_cmd_on_fail: bool) -> bool {
233233
let status = match cmd.status() {
234234
Ok(status) => status,
235235
Err(e) => {
236-
println!("failed to execute command: {cmd:?}\nerror: {e}");
236+
println!("failed to execute command: {cmd:?}\nERROR: {e}");
237237
return false;
238238
}
239239
};
@@ -262,7 +262,7 @@ pub fn make(host: &str) -> PathBuf {
262262
pub fn output(cmd: &mut Command) -> String {
263263
let output = match cmd.stderr(Stdio::inherit()).output() {
264264
Ok(status) => status,
265-
Err(e) => fail(&format!("failed to execute command: {cmd:?}\nerror: {e}")),
265+
Err(e) => fail(&format!("failed to execute command: {cmd:?}\nERROR: {e}")),
266266
};
267267
if !output.status.success() {
268268
panic!(
@@ -327,7 +327,7 @@ pub(crate) fn absolute(path: &Path) -> PathBuf {
327327
}
328328
#[cfg(not(any(unix, windows)))]
329329
{
330-
println!("warning: bootstrap is not supported on non-unix platforms");
330+
println!("WARNING: bootstrap is not supported on non-unix platforms");
331331
t!(std::fs::canonicalize(t!(std::env::current_dir()))).join(path)
332332
}
333333
}

‎src/bootstrap/src/utils/metrics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ impl BuildMetrics {
180180
t!(serde_json::from_slice::<JsonRoot>(&contents)).invocations
181181
} else {
182182
println!(
183-
"warning: overriding existing build/metrics.json, as it's not \
183+
"WARNING: overriding existing build/metrics.json, as it's not \
184184
compatible with build metrics format version {CURRENT_FORMAT_VERSION}."
185185
);
186186
Vec::new()

‎src/bootstrap/src/utils/render_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ impl<'a> Renderer<'a> {
197197
println!("{stdout}");
198198
}
199199
if let Some(message) = &failure.message {
200-
println!("note: {message}");
200+
println!("NOTE: {message}");
201201
}
202202
}
203203
}

0 commit comments

Comments
 (0)
Please sign in to comment.