From ff2f16212ece82ea75e53275a4c4200778509f34 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 25 Aug 2026 21:14:00 +0200 Subject: [PATCH] ci: generate multibyte locales for the GNU testsuite Without en_US.UTF-8, ru_RU.UTF-8 and el_GR.iso88597 the testsuite silently skips eight multibyte tests, hiding both regressions and improvements. Also make require_el_iso88597_locale_ probe locale -a instead of always skipping. --- .github/workflows/GnuTests.yml | 13 +++++++++++++ util/run-gnu-testsuite.sh | 9 +++++++++ 2 files changed, 22 insertions(+) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index 5316ab9b..7da7930b 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -49,6 +49,19 @@ jobs: # Omit installing part of https://github.com/actions/runner-images/tree/main/images/ubuntu + ### Locales + # Several testsuite scripts guard themselves with require_*_locale_ and + # silently skip when the locale is missing, which hides both regressions + # and improvements in the multibyte code paths. + - name: Generate the locales required by the testsuite + shell: bash + run: | + ## Generate the locales required by the testsuite + sudo localedef -i en_US -f UTF-8 en_US.UTF-8 + sudo localedef -i ru_RU -f UTF-8 ru_RU.UTF-8 + sudo localedef -i el_GR -f ISO-8859-7 el_GR.iso88597 + locale -a + ### Build - name: Build Rust sed binary shell: bash diff --git a/util/run-gnu-testsuite.sh b/util/run-gnu-testsuite.sh index 5f0162e1..2111a841 100755 --- a/util/run-gnu-testsuite.sh +++ b/util/run-gnu-testsuite.sh @@ -56,6 +56,11 @@ usage() { echo "Setup:" echo " To get the GNU sed testsuite for comprehensive testing:" echo " git clone https://github.com/mirror/sed.git ../gnu.sed" + echo "" + echo " Multibyte tests are skipped unless these locales are installed:" + echo " sudo localedef -i en_US -f UTF-8 en_US.UTF-8" + echo " sudo localedef -i ru_RU -f UTF-8 ru_RU.UTF-8" + echo " sudo localedef -i el_GR -f ISO-8859-7 el_GR.iso88597" } log_info() { @@ -352,6 +357,10 @@ require_ru_utf8_locale_() { } require_el_iso88597_locale_() { + # Check if el_GR.iso88597 locale is available (glibc may spell it iso-88597) + if locale -a 2>/dev/null | grep -qi 'el_GR\.iso-\?88597'; then + return 0 + fi skip_ "el_GR.iso88597 locale not available" }