Skip to content

Conversation

@WaterWhisperer
Copy link
Contributor

This PR fixes issue #8594 .

Previously, binaries installed via cargo install would only embed the English (en-US) locale. This change modifies the uucore/build.rs script to detect the system's locale via the LANG environment variable at compile time. It embeds the corresponding locale file if it exists, in addition to the mandatory English (en-US) fallback.

Verification

I verified this fix by setting my system locale to French (export LANG=fr_FR.UTF-8), for which the yes utility has an existing translation.

  1. Ran cargo build --package uu_yes.
  2. Executed ./target/debug/yes --help.

The command correctly displayed the help text in French, confirming that the build script now successfully embeds the user's system locale.

Testing with a Chinese locale (zh_CN) correctly resulted in a fallback to English, as no Chinese translation file currently exists for the yes utility. This demonstrates the fallback mechanism is working as expected.

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)

@sylvestre
Copy link
Contributor

it would be nice to see if this could be checked by github action too :)

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/stdbuf (passes in this run but fails in the 'main' branch)

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

@WaterWhisperer
Copy link
Contributor Author

WaterWhisperer commented Nov 1, 2025

Hi @sylvestre,

I noticed this PR was reviewed and all checks passed back in September. I see that issue #8594 is still open and @oech3 recently asked about the progress in the original issue thread.

Just wanted to check - is there anything else needed before merging? I'm happy to:

  • Rebase on the current main branch if needed
  • Add any additional tests or changes you'd like to see

Thanks for your time and feedback!

@sylvestre
Copy link
Contributor

i just forgot, sorry
could you please the conflict and i will have a look right after :)
thanks

@WaterWhisperer WaterWhisperer force-pushed the embed-sys-locale branch 2 times, most recently from 5e10f32 to 8f1ea78 Compare November 1, 2025 15:46
@github-actions
Copy link

github-actions bot commented Nov 1, 2025

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)

@sylvestre
Copy link
Contributor

about test, i would like a test in github action itself. Unit tests are nice but they don't always cover users needs.

.github/workflows/l10n.yml
to verify that it works as appropriate and we don't regress in the future.

thanks again :)

@github-actions
Copy link

github-actions bot commented Nov 1, 2025

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@github-actions
Copy link

github-actions bot commented Nov 2, 2025

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@oech3
Copy link
Contributor

oech3 commented Nov 10, 2025

@WaterWhisperer ping

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/overlay-headers (passes in this run but fails in the 'main' branch)

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 10, 2025

CodSpeed Performance Report

Merging #8604 will improve performances by 2.25%

Comparing WaterWhisperer:embed-sys-locale (ad48a3a) with main (6cf5b06)

Summary

⚡ 1 improvement
✅ 122 untouched
⏩ 5 skipped1

Benchmarks breakdown

Benchmark BASE HEAD Change
du_max_depth_balanced_tree[(6, 4, 10)] 33 ms 32.3 ms +2.25%

Footnotes

  1. 5 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@sylvestre sylvestre merged commit 9f4fa5b into uutils:main Nov 10, 2025
123 checks passed
@oech3
Copy link
Contributor

oech3 commented Nov 11, 2025

env LANG=fr_FR.UTF-8 cargo build -p uu_yes and env LANG=fr_FR.UTF-8 ./target/debug/yes' --help was english while make built binary supporting french.

romanstingler pushed a commit to romanstingler/coreutils that referenced this pull request Dec 14, 2025
@WaterWhisperer WaterWhisperer deleted the embed-sys-locale branch December 20, 2025 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants