Fix locale generation on debian base distros#6472
Fix locale generation on debian base distros#6472paulober wants to merge 3 commits intocanonical:mainfrom
Conversation
f74135b to
bfc8063
Compare
|
Hello! Thank you for this proposed change to cloud-init. This pull request is now marked as stale as it has not seen any activity in 14 days. If no activity occurs within the next 7 days, this pull request will automatically close. If you are waiting for code review and you are seeing this message, apologies! Please reply, tagging blackboxsw, and he will ensure that someone takes a look soon. (If the pull request is closed and you would like to continue working on it, please do tag blackboxsw to reopen it.) |
|
@blackboxsw This is required for locale generation on Debian and related distros (except for ubuntu) to work. |
|
Hello! Thank you for this proposed change to cloud-init. This pull request is now marked as stale as it has not seen any activity in 14 days. If no activity occurs within the next 7 days, this pull request will automatically close. If you are waiting for code review and you are seeing this message, apologies! Please reply, tagging blackboxsw, and he will ensure that someone takes a look soon. (If the pull request is closed and you would like to continue working on it, please do tag blackboxsw to reopen it.) |
|
|
Hello! Thank you for this proposed change to cloud-init. This pull request is now marked as stale as it has not seen any activity in 14 days. If no activity occurs within the next 7 days, this pull request will automatically close. If you are waiting for code review and you are seeing this message, apologies! Please reply, tagging blackboxsw, and he will ensure that someone takes a look soon. (If the pull request is closed and you would like to continue working on it, please do tag blackboxsw to reopen it.) |
@blackboxsw Please merge this now. Locale gen in cloud-init is currently broken for every Debian based distribution other than Ubuntu. |
|
Thank you @paulober I'll put this on my list this upcoming week. Where I have some concerns is this appears to change behavior by disallowing the addition supplemental locales and disabling other locales on the system. Once I wrap my head around how I'd like us to approach this with clear direction, I'll add a solid review on this. |
|
Adding this to our milestone for the upcoming 26.1 release. |
|
Hello! Thank you for this proposed change to cloud-init. This pull request is now marked as stale as it has not seen any activity in 14 days. If no activity occurs within the next 7 days, this pull request will automatically close. If you are waiting for code review and you are seeing this message, apologies! Please reply, tagging blackboxsw, and he will ensure that someone takes a look soon. (If the pull request is closed and you would like to continue working on it, please do tag blackboxsw to reopen it.) |
|
blackboxsw
left a comment
There was a problem hiding this comment.
Thank you @paulober for your extended patience here. I have added some significant requests for testing, a couple of questions about certain locale format support and a suggestion for retaining already generated locales.
We definitely want to retain original behavior where new locales can be added, and we don't want to disable or comment existing locales.
blackboxsw
left a comment
There was a problem hiding this comment.
Minimally, we'd need to retain original behavior by only adding new locales, not commenting out pre-existing locales. Additionally, please confirm some of the regex search/compile operations match all expected locale formats/prefixes in unittests.
|
There is an additional integration test that can be run to validate that we don't degrade expected behavior if you have access to a machine with LXD installed: This test currently fails due to the fact that this PR comments out previously configured locales. |
|
Migrating to 26.2 due to my delayed review. We'll pull this in when we can resolve outstanding questions regarding retained behavior. |
Signed-off-by: paulober <paul.oberosler@raspberrypi.com>
bfc8063 to
d56de70
Compare
Signed-off-by: paulober <paul.oberosler@raspberrypi.com>
blackboxsw
left a comment
There was a problem hiding this comment.
Thank you again for the followup @paulober. Things are looking good. One more volley regarding _normalize_locale behavior and a couple of nits. Otherwise I think this is shaping up nicely.
Signed-off-by: paulober <paul.oberosler@raspberrypi.com>
| distro.apply_locale(locale, out_fn=LOCALE_PATH) | ||
| assert [ | ||
| ["locale-gen", locale], | ||
| ["locale-gen"], |
There was a problem hiding this comment.
Thank you @paulober. Minor fixes needed throughout this test file to assert --keep-existing is also provided to the locale-gen command.
blackboxsw
left a comment
There was a problem hiding this comment.
@paulober changes look good here. Thanks for the updates. All that's left is some unittest fixes in test_debian for --keep-existing
|
When we are sure |
|
Hello! Thank you for this proposed change to cloud-init. This pull request is now marked as stale as it has not seen any activity in 14 days. If no activity occurs within the next 7 days, this pull request will automatically close. If you are waiting for code review and you are seeing this message, apologies! Please reply, tagging blackboxsw, and he will ensure that someone takes a look soon. (If the pull request is closed and you would like to continue working on it, please do tag blackboxsw to reopen it.) |
Proposed Commit Message
Additional Context
#6471
Test Steps
Try setting a locale on debian 13 with the current cloud-init release. It will run without problems but not generate the selected locale because
locale-gendoesn't supportlocale-gen <locale>but want you select the locales in/etc/locale.genprior to the execution of this script.Merge type
@tdewey-rpi