From 918e7abe6b8df03ac8468203855dbff0342aa66a Mon Sep 17 00:00:00 2001 From: Daniel Rainer Date: Wed, 1 Oct 2025 01:19:33 +0200 Subject: [PATCH] Hide output of `msgfmt -h` This command is only used to determine availability of `msgfmt`. Without these changes, the entire help output shows up if the code panics later on, which adds useless bloat to the output, making it harder to analyze what went wrong. Closes #11848 --- crates/gettext-maps/build.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/gettext-maps/build.rs b/crates/gettext-maps/build.rs index 25dea6952..078cce37d 100644 --- a/crates/gettext-maps/build.rs +++ b/crates/gettext-maps/build.rs @@ -2,7 +2,7 @@ env, ffi::OsStr, path::{Path, PathBuf}, - process::Command, + process::{Command, Stdio}, }; fn main() { @@ -34,7 +34,11 @@ fn embed_localizations(cache_dir: &Path) { // for the respective language. let mut catalogs = phf_codegen::Map::new(); - match Command::new("msgfmt").arg("-h").status() { + match Command::new("msgfmt") + .arg("-h") + .stdout(Stdio::null()) + .status() + { Err(e) if e.kind() == std::io::ErrorKind::NotFound => { rsconf::warn!( "Cannot find msgfmt to build gettext message catalogs. Localization will not work."