-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(uucore): Use embedded locales in release mode. #9879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
GNU testsuite comparison: |
CodSpeed Performance ReportMerging #9879 will degrade performance by 4.47%Comparing Summary
Benchmarks breakdown
Footnotes
|
People installing from source does not require all locales, but distibutor still needs all locales. |
|
GNU testsuite comparison: |
- Update setup_localization() to have implementation specific to debug or release. - Update create_english_bundle_from_embedded() to not be specific to english. - Update init_localization() to have implementations specific to debug or release. - Delete get_locales_dir() release mode implementation because it was useless.
In "Test Make installation" step, set french locale BEFORE building with make. If not, the binary is build with no embedded french locale.
7b12e54 to
8b1d9f6
Compare
|
@oech3 Sorry, didn't know this. Rebased without the GNUmakefile commit. |
|
Is non-embedded |
|
GNU testsuite comparison: |
|
@oech3 Not in release mode. |
|
If needed, i can fix the original get_locales_dir() function that was throwing an error in release and then add fallback to .ftl files.
Yes. Needed. Distributor would hope to support all langs at packaging level.
I guess embedding is needed only for default one (and packager should manually set English).
|
TL;DR
PR #8604 was incomplete. It was indeed embedding the locales but they weren't used and
get_locales_dir()implementation was still looking for a path which throw an error insetup_localization()which force to fallback to english, even if the locales were really embedded.Implementation :
I mainly reformated
setup_localization()andinit_localization()to have implementations specific to debug and release.From what I gathered from the codebase, in debug we look for the
.ftlfiles (and eventually fallback to embedded english) and in release it seems that there was a sort of legacy version that was looking for a folder relative to the executable (which was the source of the error).The debug implementations is mainly the same, the release implementations follows the same structure except that we get the localized text from
get_embedded_locale().The implementation comes from the preexisting function
create_english_bundle_from_embedded()where I replaced the "en-US" identifier to a parameter one.Testing :
For consistency, I tested on 5 packages for each configuration (
cp,split,truncate,mvandls).I was also using the devcontainer provided.
I compiled :
With no error/warning and then ran :
Which would print French help text for all the packages in all mode.
I then ran the tests :
With result :
313 tests run: 312 passed, 1 failed, 2 skippedEdits :
l10n_installation_testwas not set properly. Locale should be set before building or the embedding won't be done.