uudoc: move tldr.zip warning to build.rs (#10039)

Move the tldr.zip missing warning from runtime (uudoc.rs) to compile
time (build.rs). This ensures the warning is printed only once during
the build, instead of 100+ times when make calls uudoc separately for
each utility.

Fixes #9940
This commit is contained in:
Ruiyang Wang
2026-01-18 18:54:50 +01:00
committed by GitHub
parent 3c55820f5e
commit eb482fb2ee
3 changed files with 25 additions and 26 deletions
+12 -6
View File
@@ -28,9 +28,11 @@ fn test_manpage_generation() {
"Command failed with status: {}",
output.status
);
// Note: tldr warning is now printed at build time (in build.rs), not at runtime
assert!(
String::from_utf8_lossy(&output.stderr).contains("Warning: No tldr archive found"),
"stderr should contains tldr alert",
output.stderr.is_empty(),
"stderr should be empty but got: {}",
String::from_utf8_lossy(&output.stderr)
);
let output_str = String::from_utf8_lossy(&output.stdout);
@@ -52,9 +54,11 @@ fn test_manpage_coreutils() {
"Command failed with status: {}",
output.status
);
// Note: tldr warning is now printed at build time (in build.rs), not at runtime
assert!(
String::from_utf8_lossy(&output.stderr).contains("Warning: No tldr archive found"),
"stderr should contains tldr alert",
output.stderr.is_empty(),
"stderr should be empty but got: {}",
String::from_utf8_lossy(&output.stderr)
);
let output_str = String::from_utf8_lossy(&output.stdout);
@@ -123,9 +127,11 @@ fn test_manpage_base64() {
"Command failed with status: {}",
output.status
);
// Note: tldr warning is now printed at build time (in build.rs), not at runtime
assert!(
String::from_utf8_lossy(&output.stderr).contains("Warning: No tldr archive found"),
"stderr should contains tldr alert",
output.stderr.is_empty(),
"stderr should be empty but got: {}",
String::from_utf8_lossy(&output.stderr)
);
let output_str = String::from_utf8_lossy(&output.stdout);